• Advertisement

Archived

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

materials

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

I was wondering if there was some sort of special alpha blending states I have to set in order to be able to control the transparency with materials. I was able to control the alpha using vertex color but if never seems to work with materials. Im using these basic alpha blending settings. Device->SetRenderState(D3DRS_ALPHABLENDENABLE, TRUE); Device->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_SRCALPHA); Device->SetRenderStat(D3DRS_DESTBLEND,D3DBLEND_INVSRCALPHA); thanx for anything. gamedev.net rocks..as well as d3d.

Share this post


Link to post
Share on other sites
Advertisement
I believe you also have to use SetTextureStageState() to specify the alpha operation for stage 0. Try this...

SetTextureStageState(0,D3DTSS_ALPHAOP,D3DTOP_SELECT1);
SetTextureStageState(0,D3DTSS_ALPHAARG1,D3DTA_DIFFUSE);

This basically tells D3D to select the alpha value from the first argument, which you set as the diffuse color.

If it still doesnt want to read the color/alpha from the material instead of the vertex, you may have to use SetRenderState() to set the D3DRS_DIFFUSEMATERIALSOURCE or D3DRS_COLORVERTEX values. Look into them in the docs.


-Brian

Share this post


Link to post
Share on other sites
Thanks alot works great..I finally figured out how these friggin texturestagestates work.

Share this post


Link to post
Share on other sites

  • Advertisement