Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

303

opacity in d3d

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

how could i change blending state in d3d, so that 100 would be maximum opacity and 0 minumum opacity? just like in 3dstudio and photoshop...

Share this post


Link to post
Share on other sites
Advertisement
Try to change the A component of RGBA in your poly. If you don''t know what I am talking about then please tell me. I really don''t know how to help you since you did not tell me how your blending.

Share this post


Link to post
Share on other sites
so should i change alpha value of every pixel in texture? how i can do that and isn''t that slow? or did you even mean this..?

Share this post


Link to post
Share on other sites
No, you can assign alpha values to the vertices of the polygon.

Some render state you will want to check up on


D3DRENDERSTATE_ALPHABLENDENABLE // Set to enable
D3DRENDERSTATE_SRCBLEND // Set to SrcAlpha
D3DRENDERSTATE_DESTBLEND // Set to (1-SrcAlpha)
D3DRENDERSTATE_TEXTUREFACTOR // Set your alpha value here between 0 and 255


Also you''ll need to look at these texture state


D3DTSS_ALPHAOP // Set to D3DTOP_SELECTARG1
D3DTSS_ALPHAARG1 // Set to D3DTA_TFACTOR


After you have set these states to their correct values you can render your texture with opacity just like Photoshop.

Share this post


Link to post
Share on other sites

  • 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!