diff --git a/leenkx/Shaders/volumetric_light/volumetric_light.frag.glsl b/leenkx/Shaders/volumetric_light/volumetric_light.frag.glsl index 19beb25..bb342fc 100644 --- a/leenkx/Shaders/volumetric_light/volumetric_light.frag.glsl +++ b/leenkx/Shaders/volumetric_light/volumetric_light.frag.glsl @@ -11,6 +11,11 @@ #include "std/light_common.glsl" #endif +#ifdef _CPostprocess +uniform vec3 PPComp11; +uniform vec4 PPComp17; +#endif + uniform sampler2D gbufferD; uniform sampler2D snoise; @@ -87,7 +92,13 @@ out float fragColor; const float tScat = 0.08; const float tAbs = 0.0; const float tExt = tScat + tAbs; -const float stepLen = 1.0 / volumSteps; +#ifdef _CPostprocess + float stepLen = 1.0 / int(PPComp11.y); + float AirTurbidity = PPComp17.w; +#else + const float stepLen = 1.0 / volumSteps; + float AirTurbidity = volumAirTurbidity; +#endif const float lighting = 0.4; void rayStep(inout vec3 curPos, inout float curOpticalDepth, inout float scatteredLightAmount, float stepLenWorld, vec3 viewVecNorm) { @@ -162,5 +173,5 @@ void main() { rayStep(curPos, curOpticalDepth, scatteredLightAmount, stepLenWorld, viewVecNorm); } - fragColor = scatteredLightAmount * volumAirTurbidity; + fragColor = scatteredLightAmount * AirTurbidity; }