FogOfWar.cginc 486 B

12345678910111213141516171819
  1. #ifndef VOLUMETRIC_FOG_2_FOW
  2. #define VOLUMETRIC_FOG_2_FOW
  3. CBUFFER_START(VolumetricFog2FogOfWarBuffers)
  4. sampler2D _FogOfWar;
  5. float3 _FogOfWarCenter;
  6. float3 _FogOfWarSize;
  7. float3 _FogOfWarCenterAdjusted;
  8. CBUFFER_END
  9. half4 ApplyFogOfWar(float3 wpos) {
  10. float2 fogTexCoord = wpos.xz / _FogOfWarSize.xz - _FogOfWarCenterAdjusted.xz;
  11. half4 fowColor = tex2Dlod(_FogOfWar, float4(fogTexCoord, 0, 0));
  12. return half4(fowColor.rgb * fowColor.a, fowColor.a);
  13. }
  14. #endif