How cristianqiu/unity-urp-volumetric-light works
This Unity URP package renders configurable volumetric fog as a renderer feature and volume effect. The main workflow is: configure a scene volume and lights, let the renderer feature validate and enqueue its pass for eligible cameras, then render fog using camera depth and lighting before blur and composition. The render pass excerpt confirms depth downsampling, fog rendering, and blur; the README documents broader lighting, shadow, cookie, APV, projection, and render-mode support. Some shader and light-data wiring is not visible in the excerpts, so those links are limited to documented behavior.
Main entry points: VolumetricFogRenderPass.cs Fog render pass · VolumetricFog.shader Fog shading · VolumetricFogRendererFeature.cs Renderer feature · VolumetricFogVolumeComponent.cs Fog volume settings
Components 16
Scene setup
- Fog volume settings
Runtime/VolumetricFogVolumeComponent.cs - Additional light settings
Runtime/VolumetricAdditionalLight.cs
URP integration
- Renderer feature
Runtime/VolumetricFogRendererFeature.cs
Fog rendering
- Fog render pass
Runtime/VolumetricFogRenderPass.cs
Shader stages
- Depth downsample
Shaders/DownsampleDepth.shader - Fog shading
Shaders/VolumetricFog.shader - Fog lighting functions
Shaders/VolumetricFog.hlsl - Depth-aware blur
Shaders/DepthAwareGaussianBlur.hlsl - Upsample composition
Shaders/DepthAwareUpsample.hlsl - Volumetric shadows
Shaders/VolumetricShadows.hlsl - Depth and projection utilities
Shaders/ProjectionUtils.hlsl
Other components
- Scene author
- URP renderer
- Camera inputs
- Scene lights
- Camera fog result
Connections 18
- Scene author → Fog volume settings: configures
- Scene author → Additional light settings: adds to lights
- Scene author → Renderer feature: adds to renderer
- URP renderer → Renderer feature: requests passes
- Renderer feature → Fog volume settings: checks active settings
- Renderer feature → Fog render pass: enqueues
- Fog render pass → Camera inputs: reads depth and camera data
- Fog render pass → Scene lights: reads visible lighting
- Fog render pass → Fog volume settings: reads fog parameters
- Scene lights → Additional light settings: uses per-light settings
- Fog render pass → Depth downsample: runs depth downsample
- Fog render pass → Fog shading: runs fog passes
- Fog shading → Fog lighting functions: uses lighting functions
- Fog shading → Volumetric shadows: supports shadowing
- Fog shading → Depth and projection utilities: uses projection helpers
- Fog render pass → Depth-aware blur: blurs fog texture
- Fog render pass → Upsample composition: composes at camera resolution
- Upsample composition → Camera fog result: writes fog composition