diff --git a/src/document/migrate-scene-document.ts b/src/document/migrate-scene-document.ts index e14ad8d5..33330a48 100644 --- a/src/document/migrate-scene-document.ts +++ b/src/document/migrate-scene-document.ts @@ -191,6 +191,7 @@ import { SCENE_TRANSITION_ENTITIES_SCENE_DOCUMENT_VERSION, SCENE_TRANSITION_SEQUENCE_EFFECTS_SCENE_DOCUMENT_VERSION, SCHEDULER_CONTROL_EFFECTS_SCENE_DOCUMENT_VERSION, + SHADER_SKY_SCENE_DOCUMENT_VERSION, SPATIAL_AUDIO_SCENE_DOCUMENT_VERSION, STARTER_PBR_MATERIAL_LIBRARY_SCENE_DOCUMENT_VERSION, PROJECT_NAME_SCENE_DOCUMENT_VERSION, @@ -5153,6 +5154,8 @@ export function migrateSceneDocument(source: unknown): SceneDocument { source.version !== DAWN_DUSK_BACKGROUND_IMAGE_SCENE_DOCUMENT_VERSION && source.version !== WHITEBOX_BOX_LIGHT_VOLUME_SCENE_DOCUMENT_VERSION && source.version !== CELESTIAL_BODY_OVERLAY_SCENE_DOCUMENT_VERSION && + source.version !== SHADER_SKY_SCENE_DOCUMENT_VERSION && + source.version !== SCENE_DOCUMENT_VERSION && source.version !== FOLLOW_ACTOR_PATH_SMOOTH_SCENE_DOCUMENT_VERSION ) { throw new Error( diff --git a/src/document/scene-document-validation.ts b/src/document/scene-document-validation.ts index 84424374..698e12e2 100644 --- a/src/document/scene-document-validation.ts +++ b/src/document/scene-document-validation.ts @@ -352,12 +352,12 @@ function validateWorldShaderSkySettings( ); } - if (!isFiniteNumberInRange(settings.horizonHeight, -1, 1)) { + if (!isFiniteNumberInRange(settings.horizonHeight, -0.5, 0.5)) { diagnostics.push( createDiagnostic( "error", "invalid-world-shader-sky-horizon-height", - "World shader sky horizon height must stay between -1 and 1.", + "World shader sky horizon height must stay between -0.5 and 0.5.", `${path}.horizonHeight` ) ); diff --git a/src/document/scene-document.ts b/src/document/scene-document.ts index da8addba..319384b3 100644 --- a/src/document/scene-document.ts +++ b/src/document/scene-document.ts @@ -29,7 +29,8 @@ import { } from "../sequencer/project-sequences"; import type { Terrain } from "./terrains"; -export const SCENE_DOCUMENT_VERSION = 71 as const; +export const SCENE_DOCUMENT_VERSION = 72 as const; +export const SHADER_SKY_HORIZON_HEIGHT_SCENE_DOCUMENT_VERSION = 72 as const; export const SHADER_SKY_SCENE_DOCUMENT_VERSION = 71 as const; export const CELESTIAL_BODY_OVERLAY_SCENE_DOCUMENT_VERSION = 70 as const; export const WHITEBOX_BOX_LIGHT_VOLUME_SCENE_DOCUMENT_VERSION = 69 as const; diff --git a/src/rendering/world-background-renderer.ts b/src/rendering/world-background-renderer.ts index 0f73a9d1..82b93982 100644 --- a/src/rendering/world-background-renderer.ts +++ b/src/rendering/world-background-renderer.ts @@ -875,6 +875,7 @@ export class WorldBackgroundRenderer { private syncShaderSkyState(state: WorldShaderSkyRenderState | null) { if (state === null) { + this.shaderSkyMaterial.uniforms.uHorizonHeight.value = 0; this.shaderSkyMaterial.uniforms.uStarVisibility.value = 0; this.shaderSkyMaterial.uniforms.uSunVisible.value = 0; this.shaderSkyMaterial.uniforms.uMoonVisible.value = 0;