opacity in d3d

Started by
2 comments, last by 303 24 years, 1 month ago
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...
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.
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..?
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 enableD3DRENDERSTATE_SRCBLEND         // Set to SrcAlphaD3DRENDERSTATE_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.

This topic is closed to new replies.

Advertisement