Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 15 additions & 10 deletions Assets/Gothic-Core/Scripts/Services/World/SkyService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -144,21 +144,26 @@ private void UpdateStateTexAndFog()
Logger.LogError(e.ToString(), LogCat.Mesh);
return;
}

var fogColor = new Vector3(colorValues[0], colorValues[1], colorValues[2]);

foreach (var state in _stateList)
{
// all states that contain day sky layer dawn, evening and day 0 to 3
if (state.Time < 0.35 || state.Time > 0.65)
if (!(state.Time < 0.35) || !(state.Time > 0.65)) // set new textures only for day states

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is time really a value from 0...1? I thought it's an int from 0...23 or so? Can you please check? 0.65 is tough to read instead of e.g. 8am.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And yes, it was there before, but maybe you find a nicer solution now. 😁

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i want to handle this in a slightly bigger refactor, i don't like it either, this is just a quick fix for the modding weekend

{
continue;
}

state.Layer[0].TEXName = "SKYDAY_LAYER0_A" + day % 2 + ".TGA";

if (!(state.Time < 0.3) || !(state.Time > 0.7))
{
state.Layer[0].TEXName = "SKYDAY_LAYER0_A" + day % 2 + ".TGA";
// day states that contain sky cloud layer day 0 to 3
if (state.Time < 0.3 || state.Time > 0.7)
{
state.Layer[1].TEXName = "SKYDAY_LAYER1_A" + day % 2 + ".TGA";
state.FogColor = new Vector3(colorValues[0], colorValues[1], colorValues[2]);
state.DomeColor0 = new Vector3(colorValues[0], colorValues[1], colorValues[2]);
}
continue;
}

state.Layer[1].TEXName = "SKYDAY_LAYER1_A" + day % 2 + ".TGA";
state.FogColor = fogColor;
state.DomeColor0 = fogColor;
}
}

Expand Down