Sign in to follow this  

D3DXMatrixShadow (transparent problem)

This topic is 3800 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 guys! Sorry for my english i'm from Ukraine. In my game i use shadow whith d3dxmatrixshadow function. Shadow draw good! But i have 1 problem: my shadow is 30% transparent with textures (textures whith alpachannel) - it's whery good! But when my shadow from different objects has intersect his alpha has been added and shadow is 60%!!! Plese, help me to delete this bug. Thank you!

Share this post


Link to post
Share on other sites
Hello, I think you may need to look into using the stencil buffer to prevent double blending.
Set the stencil buffer test to only accept pixels the first time they are rendered. That is, as we render the shadows pixels to the back buffer, we mark the corresponding stencil buffers entries. Then, if we attempt to write a pixel to an area that has already been rendered to(marked in the stencil buffer), the stencil test will fail.In this way, we prevent writing overlapping pixels and therefore avoid double blending artifacts.
Have a good day.

Share this post


Link to post
Share on other sites

This topic is 3800 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this