From d47bd5d6e701b3f746ac880f6121c218f733eb4d Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Tue, 27 Jan 2026 21:00:20 +0100 Subject: [PATCH] Fix small lights and small particles rasterization into Volumetric Fog --- Source/Shaders/VolumetricFog.shader | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/Source/Shaders/VolumetricFog.shader b/Source/Shaders/VolumetricFog.shader index 7813cdecf..80a0cf5d7 100644 --- a/Source/Shaders/VolumetricFog.shader +++ b/Source/Shaders/VolumetricFog.shader @@ -120,19 +120,12 @@ Quad_VS2GS VS_WriteToSlice(float2 TexCoord : TEXCOORD0, uint LayerIndex : SV_Ins float depth = (slice / SliceToDepth.x) * SliceToDepth.y; float depthOffset = abs(depth - ViewSpaceBoundingSphere.z); - if (depthOffset < ViewSpaceBoundingSphere.w) - { - float radius = sqrt(ViewSpaceBoundingSphere.w * ViewSpaceBoundingSphere.w - depthOffset * depthOffset); - float3 positionVS = float3(ViewSpaceBoundingSphere.xy + (TexCoord * 2 - 1) * radius, depth); - output.Vertex.Position = mul(float4(positionVS, 1), ViewToVolumeClip); + float radius = sqrt(ViewSpaceBoundingSphere.w * ViewSpaceBoundingSphere.w - depthOffset * depthOffset); + float3 positionVS = float3(ViewSpaceBoundingSphere.xy + (TexCoord * 2 - 1) * radius, depth); + output.Vertex.Position = mul(float4(positionVS, 1), ViewToVolumeClip); #if VULKAN - output.Vertex.Position.y *= -1; + output.Vertex.Position.y *= -1; #endif - } - else - { - output.Vertex.Position = float4(0, 0, 0, 0); - } output.Vertex.TexCoord = TexCoord; output.LayerIndex = slice;