We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7f05101 commit 9f90238Copy full SHA for 9f90238
ProceduralSkybox.shader
@@ -0,0 +1,26 @@
1
+Shader "Procedural Skybox"
2
+{
3
+ Subshader
4
+ {
5
+ Pass
6
7
+ CGPROGRAM
8
+ #pragma vertex SetVertexShader
9
+ #pragma fragment SetPixelShader
10
+
11
+ void SetVertexShader (inout float4 Vertex:POSITION, out float3 Point:TEXCOORD0)
12
13
+ Point = mul(unity_ObjectToWorld, Vertex); // World Space coordinate
14
+ Vertex = UnityObjectToClipPos (Vertex); // Screen Space coordinate
15
+ }
16
17
+ void SetPixelShader (float4 Vertex:POSITION, float3 Point:TEXCOORD0, out float4 Color:SV_TARGET)
18
19
+ float3 Direction = normalize(Point - _WorldSpaceCameraPos); //Direction vector
20
+ Color = (Direction.y>0.0) ? Direction.yyyy : 0; //Pixel color
21
22
23
+ ENDCG
24
25
26
+}
0 commit comments