1
- /*
2
- * Copyright ( c) Meta Platforms, Inc. and affiliates.
3
- * All rights reserved.
4
- *
5
- * Licensed under the Oculus SDK License Agreement ( the "License" );
6
- * you may not use the Oculus SDK except in compliance with the License,
7
- * which is provided at the time of installation or download, or which
8
- * otherwise accompanies this software in either electronic or hard copy form.
9
- *
10
- * You may obtain a copy of the License at
11
- *
12
- * https://developer.oculus.com/licenses/oculussdk/
13
- *
14
- * Unless required by applicable law or agreed to in writing, the Oculus SDK
15
- * distributed under the License is distributed on an "AS IS" BASIS,
16
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
- * See the License for the specific language governing permissions and
18
- * limitations under the License.
19
- */
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
20
2
21
3
Shader "TheWorldBeyond/OppyDimension"
22
4
{
@@ -33,7 +15,7 @@ Shader "TheWorldBeyond/OppyDimension"
33
15
_MainTex( "MainTex" , 2D ) = "white" {}
34
16
_TriPlanarFalloff( "Triplanar Falloff" , Range (0 , 10 )) = 1
35
17
_OppyPosition( "Oppy Position" , Vector ) = (0 ,1000 ,0 ,0 )
36
- _OppyRippleStrength( "Oppy Ripple Strength" , Range (0 , 1 )) = 1
18
+ _OppyRippleStrength( "Oppy Ripple Strength" , Range (0 , 1 )) = 1
37
19
_MaskRippleStrength( "Mask Ripple Strength" , Range (0 , 1 )) = 0
38
20
39
21
_Color( "Color" , Color ) = (0 ,0 ,0 ,0 )
@@ -57,11 +39,11 @@ Shader "TheWorldBeyond/OppyDimension"
57
39
Cull Back
58
40
ColorMask RGBA
59
41
ZWrite On
60
- ZTest LEqual
61
-
42
+ ZTest LEqual
43
+
62
44
// the blending here (specifically the second part of each line: Min, One Zero) is what reveals Passthrough
63
45
BlendOp Add , Min
64
- Blend One Zero , One Zero
46
+ Blend One Zero , One Zero
65
47
66
48
Offset 0 , 0
67
49
@@ -172,7 +154,7 @@ Shader "TheWorldBeyond/OppyDimension"
172
154
{
173
155
UNITY_SETUP_INSTANCE_ID (i);
174
156
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX (i);
175
-
157
+
176
158
// main texture
177
159
half4 mainTextureTriPlanar = TriplanarSampler (_MainTex, i.worldPos, i.normalSign, i.projNormal, _MainTex_ST.xy );
178
160
@@ -199,8 +181,8 @@ Shader "TheWorldBeyond/OppyDimension"
199
181
// saturating with distance
200
182
half3 finalColor = lerp ( desaturatedColor.xxx, foggedColor, _SaturationAmount);
201
183
finalColor = fastPow (finalColor, 0.455 );
202
-
203
- // clip out pixels when toggling walls
184
+
185
+ // clip out pixels when toggling walls
204
186
// this allows depth writing to still happen, ensuring that transparent effects aren't visible "through" the wall
205
187
float radialDist = distance (i.worldPos, _EffectPosition) * 10 ;
206
188
float dist = saturate (radialDist + 5 - _EffectTimer * 50 );
@@ -209,16 +191,16 @@ Shader "TheWorldBeyond/OppyDimension"
209
191
dist = 0 ;
210
192
}
211
193
float alpha = lerp (dist, 1 - dist, _InvertedMask);
212
- clip (alpha.r - 0.5 );
213
-
214
- half distanceToBall = distance (_OppyPosition, i.worldPos);
194
+ clip (alpha.r - 0.5 );
195
+
196
+ half distanceToBall = distance (_OppyPosition, i.worldPos);
215
197
half maskRipple = saturate (sin ((distanceToBall * 20 ) + (_Time .w * 2 )) * 0.5 + 0.25 ) * saturate (1 - (distanceToBall * 0.5 )) * 0.7 ;
216
198
maskRipple *= saturate ((distanceToBall-0.2 )*5 );
217
199
return half4 (finalColor, maskRipple * _MaskRippleStrength);
218
200
}
219
- ENDCG
220
- }
201
+ ENDCG
202
+ }
203
+
221
204
222
-
223
205
}
224
- }
206
+ }
0 commit comments