Jump to content
  • Advertisement
Sign in to follow this  
benwalker

OpenGL Shader extruded shadow volumes...

This topic is 4840 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

Hi All. Okay, so this is my first post - go easy on me. I'm in the process of writing a game at home in C# using managed DirectX9. For those of you still reading after that sentence, I'll explain the problem. As I start increasing the complexity of the (anim8or) models within the game (from say simple objects to models with large possibilities for self shadowing, pipe-work etc), my simple Shadow Volume code ('borrowed' from the Summer 2003 SDK) started causing numerous performance issues. As it was, I could only use the method with the player controlled object, let alone any AI players... so I've since tried using a vertex shaded method instead. As a quick warning before anyone suggests shadow *mapping* using > PS_1_1 - my card (Laptop mobile nV-GF4, 64Mb) has no support for a lot of things, and only just supports vertex shaders - which is handy since this is what I've been using to do the extrusions. Some article reading and coding later, the method seems to work fine. However (as suggested) all works well provided I use spheres and tori. Cubes and anything with an edge will create huge holes in the shadow and consequently things don't work at all (which isn't good when you want to shadow rocket launchers and the like). I understand that there is something to do with degenerate quads being generated to hold normal data correctly, however having spent the past two days trying to go through the DX SDK (Aug 05) C++ sample and implementing a similar method has had no result... My buffers won't unlock, my meshes won't draw and the whole thing just ends up more frustrating than anything else. Has anyone got any suggestions (other than give up now / use OpenGL, C++ etc) on how I can fix some of these problems, or pointers (pref C#) that does the same of similar? thanks benwalker [Edited by - mittens on August 20, 2005 8:20:34 PM]

Share this post


Link to post
Share on other sites
Advertisement
hi

he is a link to a article on how to do shadow volume extraction in the shader

http://www.gamedev.net/columns/hardcore/cgshadow/

there is a new extension available which allows you to do 2 stencil operations at once in conjunction with vertex instancing *featured by direct 3d* this might be what you are looking for but i doubt that it will work with your graphics card i had trouble to implement 4 layers terrain with a pixel shader in ps1.1 due to the instruction limit

otherwise per object shadow maps are also a nice solution and some prefer it


p.s.: use scissor testing to reduce the number of pixel operations

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!