|
|
|
|
|
|
#pragma shader_feature _ _ALPHATEST_ON _ALPHABLEND_ON |
|
|
|
#pragma multi_compile_instancing |
|
|
|
|
|
|
|
// ------------------------------------- |
|
|
|
// Unity defined keywords |
|
|
|
#pragma multi_compile _ DIRLIGHTMAP_COMBINED |
|
|
|
#pragma multi_compile _ LIGHTMAP_ON |
|
|
|
|
|
|
|
// Lighting include is needed because of GI |
|
|
|
#include "LWRP/ShaderLibrary/Lighting.hlsl" |
|
|
|
#include "LWRP/ShaderLibrary/InputSurface.hlsl" |
|
|
|
|
|
|
|
|
|
|
#if _SAMPLE_GI |
|
|
|
OUTPUT_NORMAL(v, o); |
|
|
|
half3 normalWS = o.normal; |
|
|
|
OUTPUT_SH(normalWS, o.lightmapOrVertexSH); |
|
|
|
OUTPUT_SH(o.normal, o.lightmapOrVertexSH); |
|
|
|
#endif |
|
|
|
return o; |
|
|
|
} |
|
|
|
|
|
|
#else |
|
|
|
half3 normalWS = normalize(IN.normal); |
|
|
|
#endif |
|
|
|
color += SampleGI(IN.lightmapOrVertexSH, normalWS); |
|
|
|
color *= SampleGI(IN.lightmapOrVertexSH, normalWS); |
|
|
|
#endif |
|
|
|
ApplyFog(color, IN.uv0AndFogCoord.z); |
|
|
|
|
|
|
|