Sign in to follow this  
stimorold3dx

D3DXMatrixShadow (transparent problem)

Recommended Posts

stimorold3dx    122
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
ankhd    2304
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

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