2 World Shadows [Canopy Shadows]

Started by
30 comments, last by Guoshima 18 years ago
Quote:
well an easy solution to this, is storing a shadow color in red channel and depth into blue channel for example. Then you can use same texture as projected and shadow map. Don't know if it will be interesting though, but I am playing with these things right now ..

you don't need to store the shadow color as it's usually the same for the whole shadow map. When you project that texture onto the rest of your scene you'd simply look if the projected pixel is not black, if that's true then that point is in shadow. That's not many calculations more than usual canopy shadows and you could use the shadow map for selfshadowing.

Another option for selfshadowing(not physically correct though) would be Ambient Occlusion. That can easily be done in realtime. You just have to render the mesh from several directions into a depth map and then check for every pixel on the surface if it's on those depth maps. In most cases that can be precomputed and stored in a texture(as trees usually don't change that much).

regards,
m4gnus
"There are 10 types of people in the world... those who understand binary and those who don't."
Advertisement
Alan Wake uses as far as I know Cascaded Shadow maps .. I believe I saw the transition are when I looked at it last time.
Canopy Shadows: these are simple projected textures that do not work with a time of day feature ....
In other words, if your game has a time of day feature you can not use them ... if you are not satisfied with a pretty strange shadow in extreme lighting conditions.
So games that have a time of day feature need dynamic shadow maps .... this is for example Crysis ...
Quote:
noticed Bethesda does the same in Oblivion for their tree-shadows, by the way.
...
Epic uses the same technique in their Unreal-engines


Both these engines use the same tree rendering technology (SpeedTree). And yes, this system uses projective textures of pre-rendered shadow maps for the tree shadows. You can check out their nifty demos off thier site, one of the keys turns on the projective shadow mapping frustum and you can see how it works.
Just a note, there was also a clever method of doing tree shadows using voxelization at I3D this year:
Fast Scene Voxelization and Applications
Quote:
Alan Wake uses as far as I know Cascaded Shadow maps .. I believe I saw the transition are when I looked at it last time.
Canopy Shadows: these are simple projected textures that do not work with a time of day feature ....
In other words, if your game has a time of day feature you can not use them ... if you are not satisfied with a pretty strange shadow in extreme lighting conditions.
So games that have a time of day feature need dynamic shadow maps .... this is for example Crysis ...


I don't really see the problem with dynamic day night system. You can update your projected shadow maps every few frames / seconds, depending on the movement of the sun, and then they become dynamic. I create now, a few patches around the camera with a projected texture from the trees. These I use as static shadow maps. For a radius of 50m around the camera, I also have a dynamic map, which blends nicely to the static ones. So far this works fine, and shouldn't suffer from day to night I would say ..

Quote:
you don't need to store the shadow color as it's usually the same for the whole shadow map. When you project that texture onto the rest of your scene you'd simply look if the projected pixel is not black, if that's true then that point is in shadow. That's not many calculations more than usual canopy shadows and you could use the shadow map for selfshadowing.

Another option for selfshadowing(not physically correct though) would be Ambient Occlusion. That can easily be done in realtime. You just have to render the mesh from several directions into a depth map and then check for every pixel on the surface if it's on those depth maps. In most cases that can be precomputed and stored in a texture(as trees usually don't change that much).


I actually want to store a grey scaled color for my shadows, because it feels like it gives me a nicer shadow.

Farcry:


Mine (in progress :))

But I don't understand how you would use your black white comparison for self shadowing then. Could you give a little bit more explenation about this pls.

Thank and regards,
Kenzo

PS: gonna take a look at the fast scene voxelization now>
Quote:
In other words, if your game has a time of day feature you can not use them ... if you are not satisfied with a pretty strange shadow in extreme lighting conditions.
So games that have a time of day feature need dynamic shadow maps .... this is for example Crysis ...

may i ask why?
Canopy Shadows are dynamic. If you update like 5 trees' shadows per frame time of day shouldn't be a problem.

Edit:
Quote:
I actually want to store a grey scaled color for my shadows, because it feels like it gives me a nicer shadow.


yes but your shadow color doesn't change from shadow to shadow right? so it would be easier to set the shadow color once as a constant instead of storing per pixel shadow color in every texture.


regards,
m4gnus
"There are 10 types of people in the world... those who understand binary and those who don't."
nope the shadow color doesn't change, but when I have more overlap or my alpha is stronger the shadow color intensity increases in the rendered texture, so yes, my texture stores in the end different greyscales. I only need 1 channel for this, so 8 bit render target would have been nice, but I just read/found out that it isn't possible yet. If I have this channel I can just as well use it no, or what do you store then?

And I am not using a single shared projected texture for every original tree, because, first of all my trees are rotated, scaled and other stuff in the vertex shader to make them unique, and if I put a whole region into a single texture, and I don't have to worry about shadow overlapping and such.

Regards,
Kenzo
<<<
may i ask why?
Canopy Shadows are dynamic. If you update like 5 trees' shadows per frame time of day shouldn't be a problem.
<<<
Yes you may. Without self-shadowing it is hard to stretch them when it is 5:30pm for example. Can you stretch them let's say over 15 meters (propably 45 feet) if there is anything in-between that should receive this shadow.
Additionally self-shadowing the trees on themselves needs to be done as well ...


How is the I3D paper?

Quote:
Yes you may. Without self-shadowing it is hard to stretch them when it is 5:30pm for example. Can you stretch them let's say over 15 meters (propably 45 feet) if there is anything in-between that should receive this shadow.


oops you're right haven't thought about that.
"There are 10 types of people in the world... those who understand binary and those who don't."
well I simply use this projected texture on the object on which it should cast shadows, and compute the normal shadow mapping tex coords for it, and add it on top of it. Self shadowing on the tree itself doesn't seem possible, but an extra shadow map which only creates shadows from the leafs, should fix this I think ..

regards,
Kenzo

This topic is closed to new replies.

Advertisement