Skip to main content
GameDev.net gamedev.net
🔒 Locked

Snow on terrain?

Started by kill Jun 19, 2002 at 2:56 PM 26 replies 10.3k views
Original Post
kill
kill
quote:
Original post by bishop_pass I''ve seen some pretty lame snow on mountains in computer graphics. Even the cover of the newest Bryce package doesn''t place the snow very effectively. So let''s talk about snow. The accumulation of snow is based on several factors, including: The steepness of the slope, the coldness of the environment, exposure to sunlight, most recent snowfall, and exposure to wind. The steepness of the slope: This is obvious, and snow will not adhere to slopes beyond a certain angle. Although ice might. The coldness of the environment: The colder the environment, the longer snow will remain after winter has passed. Latitude, altitude and proximity to tropical ocean currents play a major role in the coldness of the environment. Exposure to sunlight: In the northern hemisphere, north faces of mountains will retain snow longer than south faces. This is because during winter and spring, the south faces are continually exposed to the sun and thus have greater melt rates. Also, couloirs and chutes which have limited sun exposure will retain snow longer than their counterparts: ridges and aretes. In addition, couloirs will receive the snow that cascades down from the walls of the couloir. Exposure to wind: Summits, ridges and aretes are highly exposed to wind. Fresh snow is immediately wisked off these airy formations. Edited by - bishop_pass on 6/30/00 1:39:20 PM
bishop_pass
bishop_pass
Interesting.

I believe a simple mathematical model would be a good start. It would be fast and based on real world observations.

Something along the lines of this:

S = L * A * N * F * C * (1.0 - R) - M where

S = snow coverage
L = latitude (greater towards pole) (normalized to 1.0)
A = altitude (normalized to 1.0)
N = ''north face'' factor = dot (triangle normal, P)
P = normalized vector pointing towards pole
F = flatness = dot (triangle normal, ''up'' vector)
C = couloir factor (gullies)
R = ridge factor (aretes)
M = meltoff (represents how far past snow season we are)

If S is less than 0, S = 0.

A good working knowledge of terrain topology helps.
_______________________________
"To understand the horse you'll find that you're going to be working on yourself. The horse will give you the answers and he will question you to see if you are sure or not."
- Ray Hunt, in
kill
kill
Here''s an idea.

When we generate our terrain textures we usually base it on two parameters: height and slope. We set some restrictions on both and pick a required texture based on those restrictions. So how about making a base class with a function TEXTURE* GetTexture(...). Then for each material we derive a separate class that uses a specific algorithm to figure out if the material can be applied at a certain position on the terrain.

Now about CSnow I think you''ve mentioned most of the critical variables. With the exposure to the sun I think it would look a little weird if the faces lit by the sun had more snow then the ones unlit (although that''s how it might be in real life). I think a better idea would be to put more snow on the unlit faces.

Sometimes when the environment is warmer the snow will last longer on the cliffs because when it''s warm the snow is more moist and therefore snow particles stick to each other better. When it''s cold the snow is too dry and the particles don''t stick to each other so more of them fall from the cliffs down on the ground. It''s hard to figure out exactly how temperature effects the snow so you might wanna get a value ranging from 0 to 1, 0 being all snow is on the ground and 1 being all snow is stuck to the cliffs.

Did anyone actually implement something like this?
bishop_pass
bishop_pass
Calculating C:

Perform a one time raytrace from each cell in a global distribution out towards the sky. Shoot about 100 rays. The percentage of rays which are intercepted by other terrain features represent the amount of warm daylight received per day. You needn''t worry about factors such as winter or summer solar paths, as these are accounted for by the ''North Face'' factors and the latitude factors.

Calculating R:

In a similar manner, shoot rays horizontally and downwards, but factor in distance before the ray intercepts terrain. The more rays fired which do not intercept terrain right away are an indication of the wind exposure this piece of terrain encounters. Ridges and peaks are naturally the most exposed.
_______________________________
"To understand the horse you'll find that you're going to be working on yourself. The horse will give you the answers and he will question you to see if you are sure or not."
- Ray Hunt, in
Yann L
Yann L
This is very interesting. I've always played with the idea of a realistic way to create snow covered mountains, perhaps even with seasonal simulation. I never really came around implementing something, unfortunately.

bishop_pass: your equation looks like a promising start. There is one missing point though: wind. I guess typical wind strength, direction, concentration (perhaps due to topology) and temperature would have a large effect on snow cover, considering the fact how snowflakes are transported. Perhaps some kind of basic fluid dynamic system could be created.

Are there any good papers one could recommend about this topic ?

/ Yann

[edited by - Yann L on June 19, 2002 4:49:20 PM]
bishop_pass
bishop_pass
quote:
Original post by Yann L
There is one missing point though: wind. I guess typical wind strength, direction, concentration (perhaps due to topology) and temperature would have a large effect on snow cover, considering the fact how snowflakes are transported. Perhaps some kind of basic fluid dynamic system could be created.

My equation does include the results of wind. Ridges and peaks are the most exposed. Wind takes the snow from these areas and the snow usually settles down into the couloirs. My C and R factors account for this in a simple way.

_______________________________
"To understand the horse you'll find that you're going to be working on yourself. The horse will give you the answers and he will question you to see if you are sure or not."
- Ray Hunt, in
Yann L
Yann L
quote:

My equation does include the results of wind. Ridges and peaks are the most exposed. Wind takes the snow from these areas and the snow usually settles down into the couloirs. My C and R factors account for this in a simple way.


Hmm, yes. But what about directional exposure ? Due to topological features (and wind direction), specific sides of a peak might be in wind-shadow, thus less exposed to snow (and perhaps lower temperatures). On the other hand, certain terrain features could canalize (sp?) wind (eg. narrow canyons), so that it might reach places that would otherwise be unexposed. I think a simple fluid dynamic solver using a voxel approximation of the terrain would be more accurate. Although I'm not sure how fast this would be.

/ Yann

[edited by - Yann L on June 19, 2002 5:02:42 PM]
bishop_pass
bishop_pass
quote:
Original post by Yann L
... considering the fact how snowflakes are transported. Perhaps some kind of basic fluid dynamic system could be created.

I continue to maintain that thinking in terms of snowflakes isn''t necessary. What is important is where the snow ends up due to topology and latitude (which intercepts wind and sunlight) and altutude, latitude and topology (which determines ambient temperatures).

Determine where the snow finally settles and then determine how long it''s going to stay there.

_______________________________
"To understand the horse you'll find that you're going to be working on yourself. The horse will give you the answers and he will question you to see if you are sure or not."
- Ray Hunt, in
bishop_pass
bishop_pass
quote:
Original post by Yann L
Due to topological features (and wind direction), specific sides of a peak might be in wind-shadow, thus less exposed to snow (and perhaps lower temperatures). On the other hand, certain terrain features could canalize (sp?) wind (eg. narrow canyons), so that it might reach places that would otherwise be unexposed. I think a simple fluid dynamic solver using a voxel approximation of the terrain would be more accurate. Although I''m not sure how fast this would be.

The raytracing preprocess handles some of that. But most importantly is how realistic the results look. I can speak from experience. Wind is almost always happening on the ridges and peaks because nothing blocks it. Wind is rarely happening in the canyons and unexposed faces (to any great significant degree).

From a visual perspective, to me one of the most important things is to get the snow off of the exposed ridges (if they are sharp enough) and get the snow into the chutes and gullies.

_______________________________
"To understand the horse you'll find that you're going to be working on yourself. The horse will give you the answers and he will question you to see if you are sure or not."
- Ray Hunt, in
bishop_pass
bishop_pass
Winter snow coverage shot.
_______________________________
"To understand the horse you'll find that you're going to be working on yourself. The horse will give you the answers and he will question you to see if you are sure or not."
- Ray Hunt, in
Yann L
Yann L
Interesting. Perhaps a fluid dynamic slover is actually a bit overkill. It would be interesting to use a satellite scanned DEM to recreate a virtual terrain from a known area, from which photographic shots at different seasons are available. And then test various snow distribution methods and compare the results with the real thing.

/ Yann
bishop_pass
bishop_pass
quote:
Original post by kill
With the exposure to the sun I think it would look a little weird if the faces lit by the sun had more snow then the ones unlit (although that''s how it might be in real life). I think a better idea would be to put more snow on the unlit faces.

That''s the general premise, but I think you''ve over simplified it too much.
quote:
Original post by kill
Sometimes when the environment is warmer the snow will last longer on the cliffs because when it''s warm the snow is more moist and therefore snow particles stick to each other better.

I would mostly disagree with this. In warmer environments (due to many of the factors I originally mentioned) snow goes through a daily melting and refreezing process (generally a day and night cycle). Each melting cycle sends a little bit more snow downward before it refreezes. Successive refreezing turns the snow into corn snow and eventually ice (if it lasts that long into the summer) which is usually only in steep gullies.
quote:
Original post by kill
When it''s cold the snow is too dry and the particles don''t stick to each other so more of them fall from the cliffs down on the ground.

Maybe, maybe not. I''m not going to speculate on this. I can''t say for sure.
_______________________________
"To understand the horse you'll find that you're going to be working on yourself. The horse will give you the answers and he will question you to see if you are sure or not."
- Ray Hunt, in
kill
kill
I wonder if there are any siggraph papers about this. I''ll look for some of them tonight.

A REALLY good simulation would be starting out the game without a snow cover then walking around, then in a couple of hours suddenly realizing that you''re knee deep in snow. In MMORPGs it would actually be a pretty good idea because the world is persistant and it''s nice to have dynamic snow when the season changes. Also you''d somehow have to simulate what happens to the snow as temperature changes...

See when we''re talking about natural phenomena like fire or water it''s hard to do a good simulation in realtime. With snow it''s different because the actual changes are very graduate (freezing of snow over night and melting during the day, as you said). You could have a system that calculates only a small part of the whole equation per frame and does it for many frames so you could update your data every minute and the user would never notice the difference. So a dynamic particle simulation would probably be feasible. On the other hand I think it''s complicating thing way too much. I''d still stick to the simpler side of things that could achieve good results.

I really don''t have time right now to work on snow because I have many other things to do. When I get done with all of them (shouldn''t be more then 2-3 weeks) I''ll probably write a simple simulation and post some screenshots here. I''ll stick to the simpler ideas and we''ll see what results I can get. If they''re satisfactory, great, if not we can think of fluid dynamics

By the way, can you guys point me to any books about fluid dynamics and navier-stokes equations and their uses in computer graphics? I couldn''t find any literature on this.
Stimpson
Stimpson
quote:
Are there any good papers one could recommend about this topic ?


I''m not sure if it''s already been mentioned, but "Computer Modelling of Fallen Snow" is quite a good paper on the subject. Warning: I have the postscript and its about 40Mb.

Stimp.
-----------------------------OpenMountains... an open source snowboarding game... One day... :)
Thr33d
Thr33d
A quick note, I saw an article link on vterrain.org about visibility algos... one was that of horizon level for each height element. They use this for lighting calculations, however, couldn''t you use this (exposure to sun/wind) for your snow melting/wisking calculations?

Anyway, you might even want to take melting and hardening snow, temperature, and other into account.

Just my 2 cents.

-Michael

ps. Article: http://www.dgp.toronto.edu/people/JamesStewart/terrains/

Btw, I''ve used a sunlight exposure type calc across the entire sky for snow amount... I should probably multiply by the height though... Would make it easier to have it look better, later.
bishop_pass
bishop_pass
I just want to point out that my thoughts on snow have generally been along the lines of a preprocess given a time of year, latitude, etc. to determine how the snow would look for that time of year. Realistically! Without a really complex algorithm. Think of it as a texture maker.

My algorithm, ideas, etc. with regard to snow have always been in the spirit of getting really good looking macroscopic snow coverage in mountainous terrain paying close attention to latitude, altitude, topology, time of year and exposure to wind.
_______________________________
"To understand the horse you'll find that you're going to be working on yourself. The horse will give you the answers and he will question you to see if you are sure or not."
- Ray Hunt, in
Mordoch Bob
Mordoch Bob
It should probably be real simple to adapt the general code for the lighting and procedural texturing of a terrain. The visibility portion is contained within the former (albeit in a simplified form), and the slope/altitude considerations are within the latter. I suppose I''ll give it a shot when I either complete or decide to give up on my 4E3 entry.

Incidentally, does anyone know where to find nice ridgy heightmaps to test the code on, and also what sites are the most reliable hosts for images?

------------------------------------------------
The wind shear alone from a pink golfball can take the head off a 90-pound midget from 300 yards.

-Six String Samurai
_______________The wind shear alone from a pink golfball can take the head off a 90-pound midget from 300 yards.-Six String Samurai
Yann L
Yann L
One question still remains: how do you graphically represent the snow ? Simply changing the terrain texture will look good from a distance, but it will be unrealistic near the viewer. Fallen snow has a volume, and one need to represent that. The "Computer Modelling of Fallen Snow" site (see Stimpson''s post) has a nice picture of what I mean: if you look at the trees and the cabin roof, there is a volumetric snow layer added. What would be an efficient method of rendering that in realtime ?

/ Yann

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.