Shadow cast

Member
Posts: 157
Joined: 2002.12
Post: #1
Hope you guys had a great 4th July weekend!

I've implemented shadow cast based on texture projection, and virtual screens or PBuffers, but I'm not happy at all with the approach because is too expensive!

Any pointers on how to get good shadow cast would be great.

I don't mean to do shadow cast for all the objects in the scene only characters, vehicles, etc.

thanks
Quote this message in a reply
Moderator
Posts: 916
Joined: 2002.10
Post: #2
could you post a screenshot?
Quote this message in a reply
tod_baudais
Unregistered
 
Post: #3
Wow, I just implemented this yesterday and today!

So far, yes it's a hog. I've set up some additional clipping planes to clip anything outside of the light frustum because my algorithm requires drawing all of the geometry of the scene once per projected shadow Sad

One optimization I thought of was to draw four shadows at a time with multitexturing, but then I have to get rid of the clipping planes.

Looking forward to hearing what other people have to say.

Tod.
Quote this message in a reply
Member
Posts: 157
Joined: 2002.12
Post: #4
Is too early, but as soon I have enough stuff working I'll post a demo!
Quote this message in a reply
Member
Posts: 157
Joined: 2002.12
Post: #5
seems like we were doing the exact same thing except that I did not play with multitexture.
One thing I did with the PBuffer is that I disable writting the RGB and kept alpha on, that may help performance.
One bad thing is that I have a PBuffer per shadow. Ouch that's gotta hurt!
Quote this message in a reply
tod_baudais
Unregistered
 
Post: #6
PBuffer huh? I've have a hell of a time getting those to work. Would I be able to bother you about them later? I'm rendering all of my shadows to the back buffer before the frame and calling glCopyTexSubImage. I'd rather not have to do that. If you are feeling particularily helpful, would you mind looking at http://homepage.mac.com/tod_baudais/ in the downloads section there is a main.cpp file that has some very minimal PBuffer stuff that doesn't work and I'm not sure why. Any hints would be appreciated.

I'm thinking that I might also try squishing combining nearby objects into one texture and save a pass or a few. I dunno how it'll look, but it might speed up instances where a character is carrying something, etc.

I'm gonna try the disabling RBG thing.

Tod.
Quote this message in a reply
Member
Posts: 157
Joined: 2002.12
Post: #7
The code I have working is a modification of a sample code at the ADC site.
download at:
http://developer.apple.com/samplecode/Ca...hared.html
Quote this message in a reply
tod_baudais
Unregistered
 
Post: #8
I just posted working pbuffer code to my site for anybody that is interested.

http://homepage.mac.com/tod_baudais/
main.cpp in the downloads section

Tod.
Quote this message in a reply
Member
Posts: 110
Joined: 2002.07
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  2d shadow blending problems tesil 1 5,686 Mar 17, 2011 10:12 AM
Last Post: Skorche
  Replacing edges with degenerate quads (for shadow volumes) Coyote 9 7,686 Jan 15, 2010 07:08 PM
Last Post: Coyote
  Shadow Mapping - Self-Shadowing Z-Fighting Artifacts Bachus 16 21,356 Feb 11, 2009 12:24 PM
Last Post: arekkusu
  GPU shadow volume extrusion with GLSL TomorrowPlusX 12 12,970 Jan 24, 2007 03:21 PM
Last Post: JoNo21
  Help! shadow map bug in NVIDIA! dfmoore 13 6,618 Nov 1, 2005 07:26 PM
Last Post: OneSadCookie