Jump to content
  • Advertisement
Sign in to follow this  
Ninja2008

opacity for a 3d Object

This topic is 3559 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 all.. I built a simple FPS game using Directx8..now I put a point light,it works,i changed the material,it works,but when changing the alphachannel value for some object..nothing happens,I just want to make a 3d object (mesh) to have opacity.. example: 'setting the D3DCOLORVALUE dim c as D3DCOLORVALUE c.A=20:c.r=50:c.g=40:c.b=100 dim mt as D3DMATERIAL8 mt.ambient=c mt.emissive=c mt.diffuse=c mt.power=10 d3ddevice.setmaterial mt . . . so, can someone tell me what to do..

Share this post


Link to post
Share on other sites
Advertisement
Did you enable alpha blending? You need to set D3DRS_ALPHABLENDENABLE=TRUE, D3DRS_SRCBLEND=D3DBLEND_SRCALPHA and D3DRS_DESTBLEND=D3DBLEND_INVSRCALPHA for "normal" alpha blending.

The exact values of those render states will depend on what language you're using.

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!