!2831 修复:右侧栏场景光源配置切换无效问题

pull/2431/MERGE
林三 3 months ago
parent ae6a92b0aa
commit 6952dcd173

@ -265,7 +265,7 @@ export const DefaultRectAreaLightOption: RectAreaLightOption = {
Object.freeze(DefaultRectAreaLightOption); Object.freeze(DefaultRectAreaLightOption);
export const DefaultRightPlaneLightOption: RightPlaneLightOption = { export const DefaultRightPlaneLightOption: RightPlaneLightOption = {
version: 2, version: 3,
ShowHemiLight: true, ShowHemiLight: true,
ShowSunLight: true, ShowSunLight: true,
SkyLightColor: "#FFFFFF", SkyLightColor: "#FFFFFF",
@ -277,6 +277,7 @@ export const DefaultRightPlaneLightOption: RightPlaneLightOption = {
SunLightTemperature: 6500, SunLightTemperature: 6500,
SunLightElevationDeg: 60, SunLightElevationDeg: 60,
SunLightRotateDeg: 300, SunLightRotateDeg: 300,
SunLightSourceAngle: 0.5,
ShowExposure: true, ShowExposure: true,
AutoExposure: false, AutoExposure: false,
ExposureCompensation: 0, ExposureCompensation: 0,

@ -38,6 +38,7 @@ export interface RightPlaneLightOption
SunLightTemperature: number; SunLightTemperature: number;
SunLightElevationDeg: number; SunLightElevationDeg: number;
SunLightRotateDeg: number; SunLightRotateDeg: number;
SunLightSourceAngle: number;
ShowExposure: boolean; ShowExposure: boolean;
AutoExposure: boolean; AutoExposure: boolean;
ExposureCompensation: number; ExposureCompensation: number;

@ -602,6 +602,7 @@ export class RightPlaneLightStore implements IConfigStore
this.m_Option.SunLightTemperature = sunLightStore.sunLightColorTemperature; this.m_Option.SunLightTemperature = sunLightStore.sunLightColorTemperature;
this.m_Option.SunLightElevationDeg = sunLightStore.sunLightElevationDeg; this.m_Option.SunLightElevationDeg = sunLightStore.sunLightElevationDeg;
this.m_Option.SunLightRotateDeg = sunLightStore.sunLightRotateDeg; this.m_Option.SunLightRotateDeg = sunLightStore.sunLightRotateDeg;
this.m_Option.SunLightSourceAngle = sunLightStore.sunLightSourceAngle;
this.m_Option.ShowExposure = lightStore.ShowExposure; this.m_Option.ShowExposure = lightStore.ShowExposure;
this.m_Option.AutoExposure = lightStore.hemisphereLightData.AutoExposure; this.m_Option.AutoExposure = lightStore.hemisphereLightData.AutoExposure;
this.m_Option.ExposureCompensation = parseInt(lightStore.hemisphereLightData.ExposureCompensation); this.m_Option.ExposureCompensation = parseInt(lightStore.hemisphereLightData.ExposureCompensation);
@ -642,6 +643,15 @@ export class RightPlaneLightStore implements IConfigStore
lightStore.sunLightData.time = cof.option.SunTime as ETime; lightStore.sunLightData.time = cof.option.SunTime as ETime;
} }
if (this.m_Option.version < 3)
{
this.m_Option.version = 3;
sunLightStore.sunLightSourceAngle = DefaultRightPlaneLightOption.SunLightSourceAngle;
}
else
sunLightStore.sunLightSourceAngle = cof.option.SunLightSourceAngle;
let sunLight = app.Database.SunLight; let sunLight = app.Database.SunLight;
let skyLight = app.Database.HemisphereLight; let skyLight = app.Database.HemisphereLight;
let pos: Vector3; let pos: Vector3;
@ -661,7 +671,7 @@ export class RightPlaneLightStore implements IConfigStore
sunLight.IndirectLightingIntensity = cof.option.SunLightIndirectLightingIntensity; sunLight.IndirectLightingIntensity = cof.option.SunLightIndirectLightingIntensity;
sunLight.Color = new Color(cof.option.SunLightColor); sunLight.Color = new Color(cof.option.SunLightColor);
sunLight.Temperature = cof.option.SunLightTemperature; sunLight.Temperature = cof.option.SunLightTemperature;
sunLight.LightSourceAngle = sunLightStore.sunLightSourceAngle;
sunLight.SunPosition = pos; sunLight.SunPosition = pos;
CalcSunShadowCameraExtents(app.Database.SunLight, false); CalcSunShadowCameraExtents(app.Database.SunLight, false);

Loading…
Cancel
Save