Bishops Snow function

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

Recommended Posts

Hi, I try to understand bishop_pass snow distribution function. He stated:
Quote:
 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. 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.
So, I really only understand a fraction of this. latitude. What does normalise to 1.0 mean? To me latitude is a value in degrees (or radians), so how can I normalise this? (I only know normalising a vector) same goes for altitude. Not sure what is meant by normalising. :-/ "Perform a one time raytrace from each cell in a global distribution out towards the sky." HÄ? No clue what he means by cell (which cell?) global distribution toward sky? It´s maybe my english skills, but I don´t understand this. Does he mean choosing random directions toward the sky hemisphere? And last but not least, "factor in distance". What does that mean? (now that´s really due to my english knowledge) Thanks in advance for any clarifications, help, code snippets, whatever helps me. :) Katachi

Share on other sites
Quote:
 latitude. What does normalise to 1.0 mean? To me latitude is a value in degrees (or radians), so how can I normalise this? (I only know normalising a vector)same goes for altitude. Not sure what is meant by normalising. :-/

What you want here is for 1.0 to represent the poles (i.e. where snow is most likely to be) and 0 to represent the equator (i.e. where there is no chance of snow). You already know that latitude has the range [0, 90], where 0 degrees is the equator and 90 degrees is the north/south pole, so just do normalized_latitude = latitude / 90, which gives you a range [0, 1.0]

Quote:
 Perform a one time raytrace from each cell in a global distribution out towards the sky.

What you want here is to figure out for each cell* how much sun light is getting to it, the more sunlight that reaches this area, the less snow there will be. Ideally you want to shoot rays towards the sun, but if you don't have a directional sun then I think you can just shoot rays straight up to the sky. Out of a 100 rays, if 99 hit something (to keep it simple something = terrain) before reaching the sun/sky, then there is only 1% sunlight reaching this location.

*(A cell is whatever you want it to be I guess, a pixel, a 4x4 group of pixels, a 64x64 group of pixels...)

Quote:
 ...factor in distance...

I think what you want to do is from each cell shoot a ray along the wind direction vector until it hits something. If the ray hits something at a very close distance, then not a lot of wind will be hitting the current cell (the nearby object will block most of the wind), if the ray doesn't hit something or hits something very far away, a lot more wind will be hitting the current cell. I'm not quite sure about this one however, I have no idea how exposure to wind affects snow distribution.

I've tried to keep the English simple to help you understand, hopefully it helps.

Share on other sites
Quote:
 Original post by Katachilatitude. What does normalise to 1.0 mean? To me latitude is a value in degrees (or radians), so how can I normalise this? (I only know normalising a vector)same goes for altitude. Not sure what is meant by normalising. :-/

I guess outRider cleared that one up.

Quote:
 Original post by Katachi"Perform a one time raytrace from each cell in a global distribution out towards the sky."HÄ? No clue what he means by cell (which cell?) global distribution toward sky? It´s maybe my english skills, but I don´t understand this. Does he mean choosing random directions toward the sky hemisphere?

I´d do the same guess as outRider about the cells: I´d say a cell is just a unit you can choose however you want. The smaller you choose a cell, the better the resolution of your snow coverage calculation will be. I assume, that the whole function is only calculated for one of these cells, which would also give you values for latitude and altitude to use.
As stated about the calculation of C, one ray probably won´t be enough. This is because you want to know how much sunlight reaches that cell per day, not just for the current sun position. So shoot some rays randomly upwards towards the sky and see how many of them hit 'nothing', these are the directions from where sunlight might reach your cell. I don´t think one ray per cell will be enough to get a good result.

Quote:
 Original post by KatachiAnd last but not least, "factor in distance". What does that mean? (now that´s really due to my english knowledge)

I guess you would first have to define at which distance you´re saying that cell is fully exposed to wind (in order to be able to scale the result to the [0,1] range). After having that 'maximum distance', you shoot some rays similar to the calculation of C, but downwards. If a ray hits something you take the distance, divide it by your maximum distance and finally clamp it to [0,1]. After you did that for some amount of rays you can average the results and get a resulting wind exposure in the range of [0,1].

Just in case you´re not getting a word in some article or anything like that:
Try dict.leo.org , quite helpful. No offense intended.

Everything I said is just a guess and might be totally wrong, but at least it makes sense to me. If you got problems understanding my post, send me a PM, I saw you´re from Germany, perhaps I can help you.

Good luck!

Share on other sites
This is an interesting algorithm, and i see no reason why we cant simplify and automate it a bit for 3d hardware.

You could do all the calculations in hardware in a few steps at the start of your level.

My first thought is to do a shadow map calculation from the sun at a few positions and then use a weighted average to generate a "snow shadow" map. This map could be inversed and then added to a slope map using a shader...

The slopemap would be generated by rendering the terrain from directly above, using a shader, doing a dot product from a normalized vector facing down.

You then combine all these maps into one greyscale blend map. You then render your final terrain as normal, and then linearly interpolate the tiled snow texture and normal map onto the rest of the color source in your final shader.

The calculation steps could be updated if needed, but for most applications, realtime snow deposition/melting are not required.

May i will try this in my engine.. if I get any results I can post them here :)

Share on other sites
Hi!

thanks all of you for your comments and help. I see much clearer now and I guess I could understand everything you have written. Now I can give it a try. If I still have issues I´ll come back to bug you even more. :D

All the Best
Katachi

Share on other sites
Just to be sure, normalising altitude to 1.0 I do by simply calculating the maximum height of my terrain and then check my current altitude agianst the max height to get a normalised altitude?

Share on other sites
yeah, either you just divide by the maximum height in your terrain, or by a height value you choose that should have 100% snow coverage, given that the other factors allow it. So this value can be bigger than your maximum height value or smaller, I guess I´d just experiment with that until I get pleasing results.
Just be sure that you clamp to [0,1] after the division.

Share on other sites
Thanks matches81 :)

• What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

• 9
• 13
• 9
• 9
• 15
• Forum Statistics

• Total Topics
634073
• Total Posts
3015343
×