• Advertisement
Sign in to follow this  

Turning the ground white from snow

This topic is 1803 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi everyone,

 

In my game I want to turn the ground white from snow.  So it starts off as a normal grass texture then it starts snowing and the ground turns white.  Then the snow stops falling and the ground goes back to the rnomal grass texture again.

 

Any ideas?

Share this post


Link to post
Share on other sites
Advertisement

Hold the RAW pixel data of the texture in two arrays. Use array two, to display the texture. Array one will be const, that way you can't change it.

 

Now, when you initialize, load the texture into array one and two.

 

When it starts to snow, add values to random pixels over time in array two so it will slowly start turning white.

 

When it is done snowing, revert the pixels back over time to the original texture using data from array one.

Share this post


Link to post
Share on other sites

I would use some kind of noise to filter and lerp between the snow and the grass. The flexibility comes with being able to switch between noise functions for adding and removing snow. That way you can have a snow melting effect that is more convincing, and not just look like snow buildup in reverse.

Share this post


Link to post
Share on other sites
Noise function, or texture. Add to that a coverage map, which is more or less something like a very low resolution shadow map from above.


That way, you don't have snow under structures (say, a roof, tent, park bench) where people wouldn't expect to see snow, and you can even have footsteps or wheel tracks if you invest only a little more work.


If you're really serious about doing hardcore snow, you can not only change the color, but also extrude vertices upwards. This was described in Shader X4 some years ago, and looks quite cool even without modern bric-a-brac like tesselation (though that would probably add even more realism).

Share this post


Link to post
Share on other sites

If you want this to look really amazing, layer a texture over the ground as snow begins to fall. 

 

This texture can be dynamically generated, or prebaked. (Just depends on what quality and performance you want)

 

As the snow begins to fall, I strongly feel that a glow effect might make it look pretty amazing. 

 

I like the idea of the noise function, but I think it might be better if the snow overlay is generated based off the terrain that it falls on, ie: it clusters on the sides of hills, spreads out on hill tops, etc, etc

Edited by LouisCastricato

Share this post


Link to post
Share on other sites

If you want this to look really amazing, layer a texture over the ground as snow begins to fall. 

 

This texture can be dynamically generated, or prebaked. (Just depends on what quality and performance you want)

 

As the snow begins to fall, I strongly feel that a glow effect might make it look pretty amazing. 

 

I like the idea of the noise function, but I think it might be better if the snow overlay is generated based off the terrain that it falls on, ie: it clusters on the sides of hills, spreads out on hill tops, etc, etc

 

That's a good addition as well. Mtnphil has written an article about how he does snow cover on the terrain.

 

Because snow usually does not stay on steep cliffs and sides, the snow texture is only applied in surfaces where the normals predominantly point upwards. It also gives a quick explanation on noise functions and textures created with one to apply the snow cover.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement