mirror of
https://github.com/TombEngine/TombEngine.git
synced 2025-04-28 15:57:59 +03:00
Bypass unnecessary sky calculations if it's not active
This commit is contained in:
parent
7babcb33a8
commit
e7003e1ad5
1 changed files with 5 additions and 3 deletions
|
@ -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());
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue