I'm having troubles rendering transparent depth map shadows on particle sprites. I'm using the shader from Miguel Perez Senent's meteor tutorial.
I think I have everything set up correctly, but I end up with rendering artifacts that don't appear when I use raytraced shadows.
I've attached an image illustrating the problem and a scene file.
Any help would be appreciated.
Thanks!
~Mike D.
H9 Deep Shadows on vex shaded sprites
7966 7 1- frogspasm_deux
- Member
- 77 posts
- Joined: July 2006
- Offline
- MiguelPerez
- Member
- 41 posts
- Joined: March 2006
- Offline
- frogspasm_deux
- Member
- 77 posts
- Joined: July 2006
- Offline
- MiguelPerez
- Member
- 41 posts
- Joined: March 2006
- Offline
- jason_iversen
- Member
- 12448 posts
- Joined: July 2005
- Offline
Perhaps you're under-sampling your DSM?
If you play with a combination of increasing your shadowmap resolution, fiddling with your shadow bias and increasing your shadow softness do you get better results?
If you play with a combination of increasing your shadowmap resolution, fiddling with your shadow bias and increasing your shadow softness do you get better results?
Jason Iversen, Technology Supervisor & FX Pipeline/R+D Lead @ Weta FX
also, http://www.odforce.net [www.odforce.net]
also, http://www.odforce.net [www.odforce.net]
- frogspasm_deux
- Member
- 77 posts
- Joined: July 2006
- Offline
Thanks Jason!
That seems to be having the right effect. Putting the shadow bias at .5 and cranking the shadow softness to 10 got rid of most of the artifacts. The shadow map resolution surprisingly didn't seem to have much of an effect.
I'll start messing around with some of the other quality attributes and see what I can come up with.
~Mike D.
That seems to be having the right effect. Putting the shadow bias at .5 and cranking the shadow softness to 10 got rid of most of the artifacts. The shadow map resolution surprisingly didn't seem to have much of an effect.
I'll start messing around with some of the other quality attributes and see what I can come up with.
~Mike D.
- andrewc
- Member
- 1002 posts
- Joined: July 2005
- Offline
I'm pretty sure that this is an expected artifact when rendering shadow maps for sprites. If the sprites are always rendered facing the camera or light, then the shadow map will be generated with different geometry than the final render - leading to a shadow map that shadows only half of each sprite. Increasing the shadow bias by the sprite size should eliminate this artifact, but may produce images that are brighter than they should be.
Andrew
Andrew
- frame13
- Member
- 12 posts
- Joined: Jan. 2006
- Offline
Just a note on what I've found so far with this.
Andrew, thanks for the insight there. It's nice to have a rough formula for figuring these things out.
Keeping that in mind, I'd suggest keeping the sprite size as small as possible and increasing the number particles so you can keep the shadow bias lower. Too much shadow bias and your shadows become really inaccurate.
Balancing the bias with softness as Jason mentioned then gets pretty nice results.
The last trick is to duplicate your lights and offset them a bit. Lower the intensity of both so they don't over-light the scene and you'll get automatic blurring of the shadows as the renderer multiplies the offset shadow values together.
This gives you a little more room to lower the shadow bias and softness and still get good results quickly.
I can't express how happy this makes me. I may actually finish my thesis now!!
Andrew, thanks for the insight there. It's nice to have a rough formula for figuring these things out.
Keeping that in mind, I'd suggest keeping the sprite size as small as possible and increasing the number particles so you can keep the shadow bias lower. Too much shadow bias and your shadows become really inaccurate.
Balancing the bias with softness as Jason mentioned then gets pretty nice results.
The last trick is to duplicate your lights and offset them a bit. Lower the intensity of both so they don't over-light the scene and you'll get automatic blurring of the shadows as the renderer multiplies the offset shadow values together.
This gives you a little more room to lower the shadow bias and softness and still get good results quickly.
I can't express how happy this makes me. I may actually finish my thesis now!!
-
- Quick Links