Static Shadowing Idea

Started by
4 comments, last by zedzeek 19 years ago
Okay, here's the theory for my static shadowing system. It revolves around a heightmap of sorts, (the same size as the terrain height map), except that each pixel shows how low a point can be before it's in shadow. It's kind of like a light map system; it started out having each pixel be either white or black; black meant it was in shadow. Then I realized for aircraft and flying stuff, they would be 50 feet in the air and pitch black, so there's a certain height where the sun can shine on it. A pixel shader tests if a pixel is in shadow based on the height/shadow map and shades it appropriately. This could easily be extended to include buildings as well. So what do you think? Is it feasible and practical? Thanks in advance for any feedback.
Advertisement
that doesn't seem to take the direction the light is shining in account at all

it also sounds somewhat like the techniques used to put shadows on parallax-mapped surfaces

iirc it is called horizon mapping

[see the last page for the results]
http://research.microsoft.com/~cohen/bs.pdf
It takes the light direction into account when it creates the height/shadow map. For every pixel in the height map, it figures out the height where light from the light direction can reach it. If a pixel is at or above that height, it's in light.
Scenery: 'Cup' (Side view)
(*) -- Sun     |             |     |             |     |             |     |             |     |_____________|

Height Map (Represented as the shadow volume)
      ##            ##      #####         ##########      ##########    ###############      #############################      #############################

Test
      ##     1      ##      #####         #####2####      ##########    ###############      #############################      ################3############

1 is not in shadow, 2 and 3 are.

Main flaw: Scenery: 'Blinds' (Side view)
           |          |                      |(*)        |          |                      |           |          |

Has the impossible height map
           |##        |                    ##|(*)        |##########|                    ##|           |##        |

This is impossible because at some points -- specifically directly behind the blinds, the shadow volume cannot simply be described as a height.

The technique works so long as all occluding objects are on the floor. (Or equivalently, all on the ceiling). I presume that your technique is intended for use in exterior scenes. It might be good for things like mountains, buildings and other things that don't float and don't usually move.

The problem will be integrating this map with other shadowing systems. If you have objects that aren't glued to the floor, or are mobile, using your technique won't be useful. You'd need to use alternative shadowing mechanisms. What you'll have to determine is whether or not combining several shadowing systems ends up being easier and significantly more efficient than using a single shadowing system.
CoV
I pondered having multiple height maps. That way, if a 3-story building has a window in each story, it would still work. But I don't think it's worth it. I'll use shadow mapping for more complex objects like blinds.
[edit:] Also, note the prefix "static". This is just for terrain and building shadows.

[Edited by - evanofsky on April 3, 2005 8:38:08 AM]
http://www.delphi3d.net/download/horizonmap.zip

This topic is closed to new replies.

Advertisement