Set scene environment and intensity based on background mode
This commit is contained in:
@@ -345,11 +345,16 @@ export class ViewportHost {
|
||||
this.sunLight.position.set(world.sunLight.direction.x, world.sunLight.direction.y, world.sunLight.direction.z).normalize().multiplyScalar(18);
|
||||
|
||||
if (world.background.mode === "image") {
|
||||
this.scene.background = this.loadedImageAssets[world.background.assetId]?.texture ?? null;
|
||||
const texture = this.loadedImageAssets[world.background.assetId]?.texture ?? null;
|
||||
this.scene.background = texture;
|
||||
this.scene.environment = texture;
|
||||
this.scene.environmentIntensity = world.background.environmentIntensity;
|
||||
return;
|
||||
}
|
||||
|
||||
this.scene.background = null;
|
||||
this.scene.environment = null;
|
||||
this.scene.environmentIntensity = 1;
|
||||
}
|
||||
|
||||
private rebuildLocalLights(document: SceneDocument) {
|
||||
|
||||
Reference in New Issue
Block a user