- Home /
Inconsistent lighting on water
I'm making a game which features water. I'm not using any standard assets, but am making everything by hand. So far, I've made a sea and a rotating moon and sun (with a skybox that changes colors to match).
I've noticed a strange trend with the lighting of my water. The game cycle starts at night, and there is no light shining on the water. During the day, the sun shines down and the brightness of the water increases. So far so good.
If I stop the game at mid-day and restart the game, the game will start with bright blue water at night, which will become brighter (too bright) by midday. If I stop the game at night and restart, the game will start with black water at night, which is so dark it can't even be seen, but it will brighten by midday to the expected brightness.
Honestly, I'm not overly concerned with how bright the water is, but I am concerned with making the brightness consistent. What might I change to do this?
Sorry that I'm sparse on hard data here - I'm not sure what might help (The sea material? The light object? The sea object? The script changing the sun's brightness through the cycle?), so I don't want to just flood the question with tons of irrelevant data.
You said you made everything by hand, does that include the shaders? If yes, it would help having the code. Otherwise, you could post the code that calculates the brightness of the water.