Jump to content
  • Advertisement

Archived

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

Blaster

Shadow buffer (depth texture)

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

First, take a look at the artifacts I get with shadow buffering using a D24S8 depth stencil texture. This is the spot light rendering (looking down) when the depth texture is simply cleared. This is the same thing, but with the depth texture filled like it should. I have already implemented shadow buffers before with D3D8 and then converted to D3D9 and it worked fine (I had to remove the bitdepth scale, like the nvidia doc said). This time it is still with D3D9, but I get strange artifacts in a weird pattern not related to the content of the depth texture. Note that the artifacts change or dissappear when the light moves (but moving the camera has no impact). I looked at the color buffer used when rendering into the depth texture and it is correct. Edit: when I put an animated object in front of the light, the artifact pattern changes with the animation. The pattern looks like something is tiled. But the projected texture matrix must be valid, because I use the (almost) same one to project a light (spot shape) texture on top and it's mapped correctly. You might want to know I render everything with vertex and pixel shaders. I use the Cg compiler to compile Cg files to D3D9 shaders. I hope the shader precision doesn't cause any problem. I would really like to get this working and see something rendering with alphatest cast a nice complex shadow. ---------------- Blaster Computer game programmer and part time human being Strategy First - http://www.strategyfirst.com Blastersoft - http://www.blastersoft.com [edited by - Blaster on February 20, 2004 3:09:04 PM]

Share this post


Link to post
Share on other sites
Advertisement
Is this on nvidia hardware? I think there''s been an issue about shadow buffers with their recent drivers. I don''t remember, though.

Try a search on the archives of the DIRECTXDEV mailing list.

Muhammad Haggag

Share this post


Link to post
Share on other sites
I know the problems with strange issues on NVidia hardware shadow maps.

It can be the type of formats you are using, which depends on the graphics card and driver number.
When I use D3DFMT_X8R8G8B8 and D3DFMT_D24X8 to render the scene, I have to use it also to render the shadow depth map. Otherwise there can be problems on a GeForce 3 or a GeForce 4 using 53.xx drivers. A GeForce FX works fine.


Good Luck!

Share this post


Link to post
Share on other sites
I use D3DFMT_A8R8G8B8 and D3DFMT_D24S8 for everything and I do have very recent drivers (max 2 weeks).

----------------
Blaster
Computer game programmer and part time human being
Strategy First - http://www.strategyfirst.com
Blastersoft - http://www.blastersoft.com

Share this post


Link to post
Share on other sites

  • 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!