11-28-2003, 08:49 PM
Suppose that you have an Xmax, Ymax map of some object. Each point is (0 to 255). This represents height. 0 = lowest, 255 = highest.
Now, suppose there's a plane of light (or perhaps more...) that is adjacent to this map. The plane of light is at angle A1 to the map. The planes is tilted, like this:
...and that would be angle A2.
Now, given the height map, with Xmax and Ymax, angle A1, and angle A2, how would one go about creating a light map?
The light map would have the same range as the height map, except that 0 represents total darkness and 255 represents direct light coming from the plane.
Assume that there is some sort of refraction R (0 to 255) for all points on the map. (For extra smileys, assume there is an Xmax, Ymax refraction map)
The refraction value is multiplied by all points where light has hit (thus there are new rays from that point)
Refraction stops when the light of that particular point is at a threshold T (0 to 255).
:|
Now, suppose there's a plane of light (or perhaps more...) that is adjacent to this map. The plane of light is at angle A1 to the map. The planes is tilted, like this:
Code:
/
/_
...and that would be angle A2.
Now, given the height map, with Xmax and Ymax, angle A1, and angle A2, how would one go about creating a light map?
The light map would have the same range as the height map, except that 0 represents total darkness and 255 represents direct light coming from the plane.
Assume that there is some sort of refraction R (0 to 255) for all points on the map. (For extra smileys, assume there is an Xmax, Ymax refraction map)
The refraction value is multiplied by all points where light has hit (thus there are new rays from that point)
Refraction stops when the light of that particular point is at a threshold T (0 to 255).
:|
Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."
Visit www.neobasic.net to see rubbish in all its finest.
Visit www.neobasic.net to see rubbish in all its finest.