Adjust celestial body intensity and god rays input based on horizon visibility
This commit is contained in:
@@ -101,6 +101,7 @@ import {
|
||||
} from "../rendering/world-shader-sky";
|
||||
import {
|
||||
resolveWorldCelestialBodiesState,
|
||||
resolveWorldCelestialHorizonVisibility,
|
||||
resolveWorldEnvironmentState,
|
||||
WorldBackgroundRenderer
|
||||
} from "../rendering/world-background-renderer";
|
||||
@@ -2908,21 +2909,47 @@ export class RuntimeHost {
|
||||
shaderSkyState.celestial.sunVisible
|
||||
? {
|
||||
colorHex: shaderSkyState.celestial.sunColorHex,
|
||||
intensity: shaderSkyState.celestial.sunIntensity,
|
||||
intensity:
|
||||
shaderSkyState.celestial.sunIntensity *
|
||||
resolveWorldCelestialHorizonVisibility(
|
||||
shaderSkyState.celestial.sunDirection.y,
|
||||
shaderSkyState.sky.horizonHeight
|
||||
),
|
||||
direction: shaderSkyState.celestial.sunDirection
|
||||
}
|
||||
: null,
|
||||
shaderSkyState.celestial.moonVisible
|
||||
? {
|
||||
colorHex: shaderSkyState.celestial.moonColorHex,
|
||||
intensity: shaderSkyState.celestial.moonIntensity,
|
||||
intensity:
|
||||
shaderSkyState.celestial.moonIntensity *
|
||||
resolveWorldCelestialHorizonVisibility(
|
||||
shaderSkyState.celestial.moonDirection.y,
|
||||
shaderSkyState.sky.horizonHeight
|
||||
),
|
||||
direction: shaderSkyState.celestial.moonDirection
|
||||
}
|
||||
: null
|
||||
)
|
||||
: resolveDominantScreenSpaceGodRaysLightInput(
|
||||
celestialBodiesState.sun,
|
||||
celestialBodiesState.moon
|
||||
celestialBodiesState.sun === null
|
||||
? null
|
||||
: {
|
||||
colorHex: celestialBodiesState.sun.colorHex,
|
||||
direction: celestialBodiesState.sun.direction,
|
||||
intensity:
|
||||
celestialBodiesState.sun.intensity *
|
||||
celestialBodiesState.sun.horizonVisibility
|
||||
},
|
||||
celestialBodiesState.moon === null
|
||||
? null
|
||||
: {
|
||||
colorHex: celestialBodiesState.moon.colorHex,
|
||||
direction: celestialBodiesState.moon.direction,
|
||||
intensity:
|
||||
celestialBodiesState.moon.intensity *
|
||||
celestialBodiesState.moon.horizonVisibility
|
||||
}
|
||||
);
|
||||
syncScreenSpaceGodRaysLightSource(
|
||||
this.godRaysLightSource,
|
||||
|
||||
Reference in New Issue
Block a user