优化:避免环境光过大

pull/1682/head
ChenX 3 years ago
parent 262d320e1d
commit 9e9ae86fd5

@ -66,7 +66,10 @@ export class LightDataCom extends React.Component<ILightComponentProps, {}> {
if (k === "IndirectLightingIntensity")
app.Database.HemisphereLight.IndirectLightingIntensity = val;
else
{
app.Database.HemisphereLight.Intensity = val;
app.Database.AmbientLight.Intensity = Math.min(app.Database.SunLight.Intensity, 55 - (app.Database.HemisphereLight.Intensity * 4)) / 20;
}
if (userConfig.synchronousEnable)
app.WebSocket.Send(JSON.stringify(Entitys2Data([app.Database.HemisphereLight])));

@ -150,7 +150,7 @@ export default class SunLightGui extends Component
commandMachine.CommandStart(KEY);
}
app.Database.SunLight.Intensity = val;
app.Database.AmbientLight.Intensity = Math.min(3, val / 20);
app.Database.AmbientLight.Intensity = Math.min(app.Database.SunLight.Intensity, 55 - (app.Database.HemisphereLight.Intensity * 4)) / 20;
this.store.sunLightIntensity = val;
this.SyncSunLight();
};

Loading…
Cancel
Save