• 9
• 11
• 9
• 20
• 12

# [DirectX] Alpha blending + light

This topic is 3447 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hi, That's my first post in this forum :) I've got a problem. I'm experimenting with some basic blending. Now I'm doing a semi-transparent cube. I've done it and it's perfectly working, but now there is another threat - I cant add light to it. When I set
d3dDevice->SetRenderState( D3DRS_LIGHTNING, TRUE );
and turning a light on, no light appear and semitransparency dissapear. I cannot find it anywhere on the Internet... Please help me!

##### Share on other sites
Are you setting a material up (IDirect3DDevice9::SetMaterial())? Do your vertices have normals? Any output from the Debug Runtimes? Have you added normals to your vertex declaration, or FVF code?

##### Share on other sites
Yes, I have set everything. Lights are working properly without alpha blending, but with semitransparency it doesn't work ;(

##### Share on other sites
Quote:
 Original post by ScorpideYes, I have set everything. Lights are working properly without alpha blending, but with semitransparency it doesn't work ;(
Can we see your code? If it's quite large, is it possible to reduce it down to a small test case?