More work on skyplane.
1,362
0
Advertisement
I have done more work on my sky plane in Dark Age.Previously I was drawing a sky plane in one pass and combining two textures for clouds and adding a color based on the height of the vertex.This was working nice until I decided to add a sun billboard in.Because the actual sky and clouds are drawn in one pass I couldn't find a way to draw the sun behind the clouds and in front of the sky so I split the sky rendering into two passes.This really simplified the shaders too.
First the sky plane is drawn without any textures just to give the gradient color based on the time of day.After that the sun billboard is drawn and the clouds are drawn over that so that they can occlude the sun.
In order to make the sky gradient brighter around the sun I calculated two rays one of them is the ray that comes from the light position to the camera and the other one is the ray that comes from a vertex of the sky plane to the camera.By comparing these two rays I changed the color of the sky plane.I used the same technique to make a fake lighting for clouds,so clouds that are facing the sun are brighter and clouds that are in front of the sun are darker.
Finally I made the clouds darker based on the density of clouds the clouds don't look as good as they do in a less dense situation.I haven't found a solution for it so I left it as it is.
Here are a couple of screen shots from the world editor and the game showing the new sky and sun:
Cloud density = 0.0f

Cloud density = 1.0f

Cloud density = 2.0f (dont ask why density is between 0.0f- 2.0f :))

Sunset

Moved sun to the other side of the map see how clouds became white.

One more showing clouds changing color based on position.

Well that's it.It's time to work on gameplay again :).There is no end to graphics, they can be always improved so I really have to stop working on it and focus on the game itself.
First the sky plane is drawn without any textures just to give the gradient color based on the time of day.After that the sun billboard is drawn and the clouds are drawn over that so that they can occlude the sun.
In order to make the sky gradient brighter around the sun I calculated two rays one of them is the ray that comes from the light position to the camera and the other one is the ray that comes from a vertex of the sky plane to the camera.By comparing these two rays I changed the color of the sky plane.I used the same technique to make a fake lighting for clouds,so clouds that are facing the sun are brighter and clouds that are in front of the sun are darker.
Finally I made the clouds darker based on the density of clouds the clouds don't look as good as they do in a less dense situation.I haven't found a solution for it so I left it as it is.
Here are a couple of screen shots from the world editor and the game showing the new sky and sun:
Cloud density = 0.0f

Cloud density = 1.0f

Cloud density = 2.0f (dont ask why density is between 0.0f- 2.0f :))

Sunset

Moved sun to the other side of the map see how clouds became white.

One more showing clouds changing color based on position.

Well that's it.It's time to work on gameplay again :).There is no end to graphics, they can be always improved so I really have to stop working on it and focus on the game itself.
Advertisement
Advertisement
Advertisement
Discussion