Jump to content
  • Advertisement
Sign in to follow this  
Mattlab

Goodway to do falling snow?

This topic is 4818 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

Anyone know of a good way to do falling snow so that it looks really really nice and blends well with textures and the sky? Code and textures and examples or documents or just ideas and help would be greatly appreciated!

Share this post


Link to post
Share on other sites
Advertisement
Looks nice!

I suppose you've already looked into point sprites? I'm using them all over my game for every possible particle effect you can imagine. You can produce some really amazing results with point sprites in a relatively short period of time... I am mostly using them in my game for explosion and smoke effects, but I can imagine how easy it would be to whip up a nice-looking snow emitter in an hour or two if I wanted.

http://www.codesampler.com has some nice tutorials all-around, but also a good one or two on pointsprites.

-dbh

Share this post


Link to post
Share on other sites
http://www.codesampler.com/dx9src/dx9src_7.htm#dx9_particle_system

^^^ That's the specific one I was thinking of.

-dbh

Share this post


Link to post
Share on other sites
if you want to make it look like the falling snow lies on the ground and stuff, you could also use a pixel shader. You could use something like a tileable noise texture (Perlin noise for example) and multiply it´s value with the height component of the point´s normal. The normal being normalized the height component of a normal pointing straight up will be 1.0f (or something close to that). You could furthermore use a factor you set to determine how long it has been snowing, so the snow coverage increases over time. The result of this should be used as alpha value, color should be white for snow. The normal of the point has to be clamped to [0,1] to be usable for that.


float4 result;
float ny = min(1.f, in.normal.y);
ny = max(0.f, ny);
result.a = ny * tex2D(noiseSampler, in.texCoords) * timeFactor;
result.rgb = 1.0f;
return result;


It´s been a while since I´ve done something in HLSL last, but this could work.
As for the falling snow itself, I don´t have any clues, except I guess that older games could have used a screen-filling quad with some animated texture for weather effects, but no guarantee on that one.

Good luck!

Share this post


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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!