Archived

This topic is now archived and is closed to further replies.

Shadow volumes: make using vertex shader or cpu?

This topic is 5089 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Something I''ve noticed in a couple shadowing demos, for example, a multiple shadowing demo posted on Gamedev awhile back and in the DX9 SDK, is that they both develop the new vertices for the shadow volume using (I think) the CPU. Wouldn''t it be more efficient however to build the volume using a vertex shader and thereby eliminate the latency between the video card and the CPU?

Share this post


Link to post
Share on other sites
http://www.flipcode.com/articles/article_shadowvextrude.shtml

There's been a few implementations doing so. Usually they just calculate a few things on the GPU and the rest is done on the CPU

http://www.paulsprojects.net/opengl/shadvol/shadvol.html

That shows a working implementation calculating volume extrusion on the GPU when available using an OpenGL ARB vertex program.

Hopefully those links help you out, I can't wait until shadow volumes are fully on the GPU in realtime. That should be fun

~Graham

----
while (your_engine >= my_engine)
my_engine++;

[edited by - gwihlidal on January 5, 2004 9:42:07 PM]

Share this post


Link to post
Share on other sites
this depends on the cpu and the gpu usage of your engine.if the cpu is idle then you can make it on the cpu.if you are having heavy AI and physics then you can do it on the gpu to save the cpu.the problem with the cpu expansion is copying of the data each frame to the hardware,while the problem with expanding the shader on the gpu is the no. of vertex shader instructions performed by the card and the polycount of the model should be doubled.you can also see the shadow shader sample of ati (Directx ).they calculate the silhoute and expand the shadow volume using a vertex shader.

Share this post


Link to post
Share on other sites