Sign in to follow this  

Problem with Reflections and Alpha Blending

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

Hey everyone, sorry to be asking questions straight out of the traps, but i am a bit stumped at the moment. Aaaanyway I'm writing a small program all it does is display the Dwarf.x mesh that comes with DirectX. The dwarf is displayed infront of a mirror and cast a shadow on the floor. Next i decided to add rotation to the Dwarf, and this is where the problem starts, somehow i've managed to set the alpha blending in such a way that when the dwarf rotates, he becomes transparent on his 'front' [that is to say, his chest area] This might help clear things up When the program starts, everthing is grand Then, we rotate the dwarf by 180Degrees So, anyway, i reckon this is down to how i have my alphablending set [because if i turn it off, i don't have this problem, but then the reflection doesn't look right] So, i've set up alpha blending like this
Device->SetRenderState(D3DRS_ALPHABLENDENABLE, true);
Device->SetRenderState(D3DRS_SRCBLEND,  D3DBLEND_ZERO);
Device->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_ONE);
And like i said earlier if i disable it, i don't get that problem, so if anyone can help, it'd be great. Thanks in advance HerrCron ps: i know that the reflection is a little too far away, and the shadow or floor aren't reflected, but i know how to fix that, this is doing my head in. Cheers

Share this post


Link to post
Share on other sites
Can you explain how you draw the mirror? It's not clear to me how you're using alpha blending.

I think that's also why Jack gave the response he gave. That's because one standard way to draw a mirror is to reflect the transformations and draw the objects again, and that doesn't involve alpha blending.

Share this post


Link to post
Share on other sites
Yeah, this is actually all a mistake on my end. For some reason i got the notion into my head that i HAD to make the reflection slightly transparent, for *some* reason that escapes me now in the cold light of day.

Thanks jollyjeffers and ET3D for all the help, i promise to think things through before i post a problem again.

Now, where is the D'oh emoticon.....

Share this post


Link to post
Share on other sites

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