Shader "URP/Environment/Sky&Fog/VolumetricFog" {
	Properties{
		_noiseTexture("Noise 3D", 2D) = "white" {}
		_densityTexture("density texture", 2D) = "white" {}
		_lightingTexture("lighting texture", 2D) = "white" {}
	}

		SubShader{
			Tags { "PreviewType" = "Plane"}

			// Volumetric Fog and Lighting
			// Bartlomiej Wro´nski
			// GPU Pro 6 Chapter III-3

			// insert density
			Pass {
				Cull Off
				Blend SrcAlpha   DstAlpha, One One
				HLSLPROGRAM
				#include "VolumetricFogInc.hlsl"
				#pragma target 3.0
				#pragma vertex MainVS
				#pragma fragment PS_Density
				//#pragma enable_d3d11_debug_symbols
				ENDHLSL
			}

		// lighting at a given point and a density - related extinction coefficient
		Pass {
				Cull Off
				HLSLPROGRAM
				#include "VolumetricFogInc.hlsl"
				#pragma target 3.0
				#pragma multi_compile _ _ADDITIONAL_LIGHTS_VERTEX _ADDITIONAL_LIGHTS
				#pragma multi_compile _ _ADDITIONAL_LIGHT_SHADOWS
				#pragma multi_compile _ SHADOWS_SHADOWMASK
				#pragma multi_compile _ LIGHTMAP_SHADOW_MIXING
				#pragma multi_compile _ _MAIN_LIGHT_SHADOWS
				#pragma multi_compile _ _MAIN_LIGHT_SHADOWS_CASCADE
				#pragma multi_compile _ _SHADOWS_SOFT
				#pragma multi_compile _ _MIXED_LIGHTING_SUBTRACTIVE
				#pragma multi_compile _ DIRLIGHTMAP_COMBINED

				#pragma vertex MainVS
				#pragma fragment PS_Lighting
				//#pragma enable_d3d11_debug_symbols
				ENDHLSL
			}

		// integrated in-scattering and transmittance.
		Pass {
				Cull Off
				HLSLPROGRAM
				#include "VolumetricFogInc.hlsl"
				#pragma target 3.0
				#pragma vertex MainVS
				#pragma fragment PS_Integrated
				//#pragma enable_d3d11_debug_symbols
				ENDHLSL
			}
	}
}