public void ResizeVBuffer ( HDCamera camera , int screenWidth , int screenHeight )
{
if ( preset = = VolumetricLightingPreset . Off ) return ;
var visualEnvironment = VolumeManager . instance . stack . GetComponent < VisualEnvironment > ( ) ;
if ( visualEnvironment = = null | | visualEnvironment . fogType ! = FogType . Volumetric ) return ;
long viewID = camera . GetViewID ( ) ;
public void PushGlobalParams ( HDCamera camera , CommandBuffer cmd )
{
if ( preset = = VolumetricLightingPreset . Off ) return ;
var visualEnvironment = VolumeManager . instance . stack . GetComponent < VisualEnvironment > ( ) ;
if ( visualEnvironment = = null | | visualEnvironment . fogType ! = FogType . Volumetric ) return ;
// Modify the near plane.
// Warning: it can screw up the reprojection. However, we have to do it in order for clustered lighting to work correctly.
DensityVolumeList densityVolumes = new DensityVolumeList ( ) ;
if ( preset = = VolumetricLightingPreset . Off ) return densityVolumes ;
if ( visualEnvironment . fogType ! = FogType . Volumetric ) return densityVolumes ;
if ( visualEnvironment = = null | | visualEnvironment . fogType ! = FogType . Volumetric ) return densityVolumes ;
using ( new ProfilingSample ( cmd , "Prepare Visible Density Volume List" ) )
{
public void VolumeVoxelizationPass ( DensityVolumeList densityVolumes , HDCamera camera , CommandBuffer cmd , FrameSettings settings )
{
if ( preset = = VolumetricLightingPreset . Off ) return ;
var visualEnvironment = VolumeManager . instance . stack . GetComponent < VisualEnvironment > ( ) ;
if ( visualEnvironment = = null | | visualEnvironment . fogType ! = FogType . Volumetric ) return ;
using ( new ProfilingSample ( cmd , "Volume Voxelization" ) )
{
{
// Clear the render target instead of running the shader.
// Note: the clear must take the global fog into account!
// Use the workaround by running the full shader with 0 density.
// Use the workaround by running the full shader with 0 density
}
VBuffer vBuffer = FindVBuffer ( camera . GetViewID ( ) ) ;
public void VolumetricLightingPass ( HDCamera camera , CommandBuffer cmd , FrameSettings settings )
{
if ( preset = = VolumetricLightingPreset . Off ) return ;
var visualEnvironment = VolumeManager . instance . stack . GetComponent < VisualEnvironment > ( ) ;
if ( visualEnvironment = = null | | visualEnvironment . fogType ! = FogType . Volumetric ) return ;
var visualEnvironment = VolumeManager . instance . stack . GetComponent < VisualEnvironment > ( ) ;
if ( visualEnvironment . fogType ! = FogType . Volumetric )
{
// Clear the render target instead of running the shader.
// CoreUtils.SetRenderTarget(cmd, vBuffer.GetDensityBuffer(), ClearFlag.Color, CoreUtils.clearColorAllBlack);
// return;
// Clearing 3D textures does not seem to work!
// Use the workaround by running the full shader with 0 density.
}
VBuffer vBuffer = FindVBuffer ( camera . GetViewID ( ) ) ;
Debug . Assert ( vBuffer ! = null ) ;