Implement atmospheric scattering and distance fog for God Rays

This commit is contained in:
2026-04-28 04:53:10 +02:00
parent 7d38198830
commit a71eb49b6a
2 changed files with 65 additions and 2 deletions

View File

@@ -383,7 +383,19 @@ export function createAdvancedRenderingComposer(
if (godRaysEnabled && godRaysLightSource !== null) {
composer.addPass(
new ScreenSpaceGodRaysPass(camera, godRaysLightSource, godRaysParameters)
new ScreenSpaceGodRaysPass(
camera,
godRaysLightSource,
godRaysParameters,
distanceFogEnabled
? {
nearDistance: distanceFogParameters.nearDistance,
farDistance: distanceFogParameters.farDistance,
strength: distanceFogParameters.strength,
horizonStrength: distanceFogParameters.horizonStrength
}
: null
)
);
}