Jump to content
  • Advertisement
Sign in to follow this  
sipickles

Flickering Shadow

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

Hello, Sorry to ask again, but I am still baffled by why my shadow flickers heavily. I have copied the shadow generation code from a variety of sources and it all produces the same results. My shadow appear projected correctly, but flickers violently. There are no other objects being rendered, so no z fighting, even so I have tried disabling z-writing and testing...no difference. I made the program switch to a red texture before drawing the shadowed mesh. The result is the shadow now flickers between red and black. I have checked and there are no other setTexture calls being made, so where is the black coming from! :) I am not presently using any stencil buffer, since I am trying to simplify the problem, is this incorrect? Has anyone else seen such a thing? My format D3DFMTD24_S8, with autodepthstencil thingy enabled Please help if you can, many thanks Simon

Share this post


Link to post
Share on other sites
Advertisement
I have seen the occasional odd result like this, but it was usually down to running on crappy old hardware [smile]

Three things to look into:

1. Debug runtimes - they use various colour combinations to indicate (lack of) buffer clears and usage of default values and render states. You might be lucky and get a debug message printed out telling you it doesn't like something...

2. Try running through the REFRAST and see if you get the same results. Depending on how recent your hardware is, you could well be seeing some odd results. Before stencil shadowing became "cool" some hardware/drivers tended to have quite flakey support [wink]

3. If possible, try running it on some different hardware. Although #2 above should eliminate the need to do this.


Sorry I can't be any more specific!
Jack

Share this post


Link to post
Share on other sites
You haven't got lighting enabled when you render your shadow? That can cause things to appear black when it isn't set up correctly.

Share this post


Link to post
Share on other sites
yes - if you don't know how you fixed it now, you won't know how to fix it when it happens again - all "miraculously vanishing bugs" come back and bite you on the arse eventually

Share this post


Link to post
Share on other sites
Okay, I think it must be a hardware issue.

WHen I render a shadow in hardware, I can do it with alpha blending off, and lighting off.

If I try to blend the shadow it flickers.

After switching to REF device, blending is great, 2fps isn't so great!

I knew the FX5200 was lame, but thats something else! I've used it successfully for alpha blending before.... very strange.



Si

Share this post


Link to post
Share on other sites
I have an FX5200, havn't had such problems yet (I thought I had some today, but I fixed it eventually).

I would, however, recommend testing this on another card, this might have something to do with uninitialized textures. They usually flicker, for some reason or another. I seriously doubt this is a hardware issue.

[EDIT] I'm not sure why, but when rendering in the REF rasterizer, it somehow clears out uninitialized textures, so the artifacts disappear. I'd recommend you recheck your code again, before giving up and calling it quits.

Share this post


Link to post
Share on other sites
Are you rendering planar stencil shadows? I had the same problem with planar shadows on some nVidia hardware. I solved it with rendering shadows only to stencil and then rendering big alpha-blended quad over the screen (only on areas where stencil test passed). I hope it helps.


Sorry for my english.

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!