61 lines
2.0 KiB
Plaintext
61 lines
2.0 KiB
Plaintext
|
|
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
Shader "TripleBrick/showcase_bg" {
|
||
|
|
Properties {
|
||
|
|
_SkyColor ("Sky Color", Color) = (0.02553246,0.03709318,0.1827586,1)
|
||
|
|
_HorizonColor ("Horizon Color", Color) = (0.06617647,0.5468207,1,1)
|
||
|
|
}
|
||
|
|
SubShader {
|
||
|
|
Tags {
|
||
|
|
"IgnoreProjector"="True"
|
||
|
|
"Queue"="Background"
|
||
|
|
"RenderType"="Opaque"
|
||
|
|
"PreviewType"="Skybox"
|
||
|
|
}
|
||
|
|
Pass {
|
||
|
|
Name "FORWARD"
|
||
|
|
Tags {
|
||
|
|
"LightMode"="ForwardBase"
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
CGPROGRAM
|
||
|
|
#pragma vertex vert
|
||
|
|
#pragma fragment frag
|
||
|
|
#define UNITY_PASS_FORWARDBASE
|
||
|
|
#include "UnityCG.cginc"
|
||
|
|
#pragma multi_compile_fwdbase
|
||
|
|
#pragma exclude_renderers gles3 metal d3d11_9x xbox360 xboxone ps3 ps4 psp2
|
||
|
|
#pragma target 3.0
|
||
|
|
uniform float4 _SkyColor;
|
||
|
|
uniform float4 _HorizonColor;
|
||
|
|
struct VertexInput {
|
||
|
|
float4 vertex : POSITION;
|
||
|
|
};
|
||
|
|
struct VertexOutput {
|
||
|
|
float4 pos : SV_POSITION;
|
||
|
|
float4 posWorld : TEXCOORD0;
|
||
|
|
};
|
||
|
|
VertexOutput vert (VertexInput v) {
|
||
|
|
VertexOutput o = (VertexOutput)0;
|
||
|
|
o.posWorld = mul(unity_ObjectToWorld, v.vertex);
|
||
|
|
o.pos = UnityObjectToClipPos(v.vertex );
|
||
|
|
return o;
|
||
|
|
}
|
||
|
|
float4 frag(VertexOutput i) : COLOR {
|
||
|
|
float3 viewDirection = normalize(_WorldSpaceCameraPos.xyz - i.posWorld.xyz);
|
||
|
|
////// Lighting:
|
||
|
|
////// Emissive:
|
||
|
|
float3 node_2737 = lerp(_SkyColor.rgb,_HorizonColor.rgb,pow((1.0 - max(0,dot(viewDirection,float3(0,1,0)))),0.1)); // Sky
|
||
|
|
float3 emissive = node_2737;
|
||
|
|
float3 finalColor = emissive;
|
||
|
|
return fixed4(finalColor,1);
|
||
|
|
}
|
||
|
|
ENDCG
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|