Bypass unnecessary sky calculations if it's not active

This commit is contained in:
Lwmte 2025-03-13 09:44:18 +01:00
parent 7babcb33a8
commit e7003e1ad5

View file

@ -2866,18 +2866,20 @@ namespace TEN::Renderer
for (int layer = 0; layer < 2; layer++)
{
if (Vector3(Weather.SkyColor(layer)) == Vector3::Zero)
continue;
for (int i = 0; i < 2; i++)
{
auto weather = TEN::Effects::Environment::Weather;
auto translation = Matrix::CreateTranslation(
renderView.Camera.WorldPosition.x + weather.SkyPosition(layer) - i * SKY_SIZE,
renderView.Camera.WorldPosition.x + Weather.SkyPosition(layer) - i * SKY_SIZE,
renderView.Camera.WorldPosition.y - 1536.0f,
renderView.Camera.WorldPosition.z);
auto world = rotation * translation;
_stStatic.World = (rotation * translation);
_stStatic.Color = weather.SkyColor(layer);
_stStatic.Color = Weather.SkyColor(layer);
_stStatic.ApplyFogBulbs = layer == 0 ? 1 : 0;
_cbStatic.UpdateData(_stStatic, _context.Get());