Feature: Integrate distance fog sky color source into runtime host
This commit is contained in:
@@ -89,7 +89,11 @@ import {
|
|||||||
resolveBoxVolumeRenderPaths,
|
resolveBoxVolumeRenderPaths,
|
||||||
type ResolvedBoxVolumeRenderPaths
|
type ResolvedBoxVolumeRenderPaths
|
||||||
} from "../rendering/advanced-rendering";
|
} from "../rendering/advanced-rendering";
|
||||||
import { applyAdvancedRenderingPerspectiveCameraFar } from "../rendering/distance-fog-pass";
|
import {
|
||||||
|
applyAdvancedRenderingPerspectiveCameraFar,
|
||||||
|
createDistanceFogSkyColorSource,
|
||||||
|
syncDistanceFogSkyColorSource
|
||||||
|
} from "../rendering/distance-fog-pass";
|
||||||
import {
|
import {
|
||||||
createScreenSpaceGodRaysLightSource,
|
createScreenSpaceGodRaysLightSource,
|
||||||
resolveDominantScreenSpaceGodRaysLightInput,
|
resolveDominantScreenSpaceGodRaysLightInput,
|
||||||
@@ -106,6 +110,7 @@ import {
|
|||||||
import {
|
import {
|
||||||
resolveWorldCelestialBodiesState,
|
resolveWorldCelestialBodiesState,
|
||||||
resolveWorldCelestialHorizonVisibility,
|
resolveWorldCelestialHorizonVisibility,
|
||||||
|
resolveWorldBackgroundSkyColorState,
|
||||||
resolveWorldEnvironmentState,
|
resolveWorldEnvironmentState,
|
||||||
WorldBackgroundRenderer
|
WorldBackgroundRenderer
|
||||||
} from "../rendering/world-background-renderer";
|
} from "../rendering/world-background-renderer";
|
||||||
@@ -672,6 +677,8 @@ export class RuntimeHost {
|
|||||||
private readonly sunLight = new DirectionalLight();
|
private readonly sunLight = new DirectionalLight();
|
||||||
private readonly moonLight = new DirectionalLight();
|
private readonly moonLight = new DirectionalLight();
|
||||||
private readonly godRaysLightSource = createScreenSpaceGodRaysLightSource();
|
private readonly godRaysLightSource = createScreenSpaceGodRaysLightSource();
|
||||||
|
private readonly distanceFogSkyColorSource =
|
||||||
|
createDistanceFogSkyColorSource();
|
||||||
private readonly localLightGroup = new Group();
|
private readonly localLightGroup = new Group();
|
||||||
private readonly lightVolumeGroup = new Group();
|
private readonly lightVolumeGroup = new Group();
|
||||||
private readonly brushGroup = new Group();
|
private readonly brushGroup = new Group();
|
||||||
@@ -2943,6 +2950,10 @@ export class RuntimeHost {
|
|||||||
celestialBodiesState,
|
celestialBodiesState,
|
||||||
shaderSkyState
|
shaderSkyState
|
||||||
);
|
);
|
||||||
|
syncDistanceFogSkyColorSource(
|
||||||
|
this.distanceFogSkyColorSource,
|
||||||
|
resolveWorldBackgroundSkyColorState(resolvedWorld.background, shaderSkyState)
|
||||||
|
);
|
||||||
const godRaysLightInput =
|
const godRaysLightInput =
|
||||||
shaderSkyState !== null
|
shaderSkyState !== null
|
||||||
? resolveDominantScreenSpaceGodRaysLightInput(
|
? resolveDominantScreenSpaceGodRaysLightInput(
|
||||||
@@ -3121,7 +3132,8 @@ export class RuntimeHost {
|
|||||||
this.camera,
|
this.camera,
|
||||||
settings,
|
settings,
|
||||||
this.worldBackgroundRenderer.scene,
|
this.worldBackgroundRenderer.scene,
|
||||||
this.godRaysLightSource
|
this.godRaysLightSource,
|
||||||
|
this.distanceFogSkyColorSource
|
||||||
);
|
);
|
||||||
this.currentAdvancedRenderingSettings =
|
this.currentAdvancedRenderingSettings =
|
||||||
cloneAdvancedRenderingSettings(settings);
|
cloneAdvancedRenderingSettings(settings);
|
||||||
|
|||||||
@@ -215,7 +215,11 @@ import {
|
|||||||
createAdvancedRenderingComposer,
|
createAdvancedRenderingComposer,
|
||||||
resolveBoxVolumeRenderPaths
|
resolveBoxVolumeRenderPaths
|
||||||
} from "../rendering/advanced-rendering";
|
} from "../rendering/advanced-rendering";
|
||||||
import { applyAdvancedRenderingPerspectiveCameraFar } from "../rendering/distance-fog-pass";
|
import {
|
||||||
|
applyAdvancedRenderingPerspectiveCameraFar,
|
||||||
|
createDistanceFogSkyColorSource,
|
||||||
|
syncDistanceFogSkyColorSource
|
||||||
|
} from "../rendering/distance-fog-pass";
|
||||||
import {
|
import {
|
||||||
createScreenSpaceGodRaysLightSource,
|
createScreenSpaceGodRaysLightSource,
|
||||||
resolveDominantScreenSpaceGodRaysLightInput,
|
resolveDominantScreenSpaceGodRaysLightInput,
|
||||||
@@ -236,6 +240,7 @@ import {
|
|||||||
import {
|
import {
|
||||||
resolveWorldCelestialBodiesState,
|
resolveWorldCelestialBodiesState,
|
||||||
resolveWorldCelestialHorizonVisibility,
|
resolveWorldCelestialHorizonVisibility,
|
||||||
|
resolveWorldBackgroundSkyColorState,
|
||||||
resolveWorldEnvironmentState,
|
resolveWorldEnvironmentState,
|
||||||
WorldBackgroundRenderer
|
WorldBackgroundRenderer
|
||||||
} from "../rendering/world-background-renderer";
|
} from "../rendering/world-background-renderer";
|
||||||
@@ -749,6 +754,8 @@ export class ViewportHost {
|
|||||||
private readonly sunLight = new DirectionalLight();
|
private readonly sunLight = new DirectionalLight();
|
||||||
private readonly moonLight = new DirectionalLight();
|
private readonly moonLight = new DirectionalLight();
|
||||||
private readonly godRaysLightSource = createScreenSpaceGodRaysLightSource();
|
private readonly godRaysLightSource = createScreenSpaceGodRaysLightSource();
|
||||||
|
private readonly distanceFogSkyColorSource =
|
||||||
|
createDistanceFogSkyColorSource();
|
||||||
private readonly localLightGroup = new Group();
|
private readonly localLightGroup = new Group();
|
||||||
private readonly lightVolumeGroup = new Group();
|
private readonly lightVolumeGroup = new Group();
|
||||||
private readonly brushGroup = new Group();
|
private readonly brushGroup = new Group();
|
||||||
@@ -2240,6 +2247,10 @@ export class ViewportHost {
|
|||||||
celestialBodiesState,
|
celestialBodiesState,
|
||||||
shaderSkyState
|
shaderSkyState
|
||||||
);
|
);
|
||||||
|
syncDistanceFogSkyColorSource(
|
||||||
|
this.distanceFogSkyColorSource,
|
||||||
|
resolveWorldBackgroundSkyColorState(displayedBackground, shaderSkyState)
|
||||||
|
);
|
||||||
const godRaysLightInput =
|
const godRaysLightInput =
|
||||||
shaderSkyState !== null
|
shaderSkyState !== null
|
||||||
? resolveDominantScreenSpaceGodRaysLightInput(
|
? resolveDominantScreenSpaceGodRaysLightInput(
|
||||||
@@ -2360,7 +2371,8 @@ export class ViewportHost {
|
|||||||
this.perspectiveCamera,
|
this.perspectiveCamera,
|
||||||
settings,
|
settings,
|
||||||
this.worldBackgroundRenderer.scene,
|
this.worldBackgroundRenderer.scene,
|
||||||
this.godRaysLightSource
|
this.godRaysLightSource,
|
||||||
|
this.distanceFogSkyColorSource
|
||||||
);
|
);
|
||||||
this.currentAdvancedRenderingSettings =
|
this.currentAdvancedRenderingSettings =
|
||||||
cloneAdvancedRenderingSettings(settings);
|
cloneAdvancedRenderingSettings(settings);
|
||||||
|
|||||||
Reference in New Issue
Block a user