Jump to content
  • Advertisement

Archived

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

PSioNiC

Setting a General Alpha Value

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

Is there a way to make every vertex that passes through the vertex pipeline have a certain alpha value, without using a vertex shader ? My final goal is to have every mesh on the screen being 50% transparent Is there a render state or some function that I can call to do this or am i going to have to iterate through the vertex buffer and set each vertex''s alpha value to the same thing ( ??? )

Share this post


Link to post
Share on other sites
Advertisement
Could you multitexture, setting your render states to use the texture, a 1x1 texture with your alpha value, and ignore the vertex colors?

I don''t know if this is the answer, just an off the cuff suggestion...

Share this post


Link to post
Share on other sites
G''day!

Try setting your ALPHAARG1 to D3DTA_TFACTOR with ALPHAOP as SELECTARG1 (or if you already have some transparency, set OP to MODULATE and set ARG2 to whatever you want).

Then SetRenderState(D3DRS_TEXTUREFACTOR,D3DCOLOR_ARGB(alpha,0,0,0)

That should work.


Stay Casual,

Ken
Drunken Hyena

Share this post


Link to post
Share on other sites
You can also set per-vertex alpha in the diffuse component of the vertex's lighting. You then need to set D3DRS_ALPHAOP to D3DTOP_MODULATE, D3DRS_ALPHAARG1 to D3DTA_TEXTURE and D3DRS_ALPHAARG2 to D3DTA_DIFFUSE if you have a texturea alpha, otherwise set D3DRS_ALPHAOP to D3DTOP_SELECTARG1 and D3DRS_ALPHAARG1 to D3DTA_DIFFUSE.


Edited by - furby100 on June 29, 2001 9:27:24 AM

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!