Jump to content
  • Advertisement

Archived

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

uncutno

alpha blending

This topic is 5676 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 do i set the renderstates in d3d8, so that when i draw a billboard or any mesh, it uses both alpha from the texture, and from the vertexes... I tried everything.. (aperently, this is not true) and i cant get it to work.. so i repeat myselfe: i have a texture with alpha values! (no color values) then i have 2 triangles, with color and alpha values for all vertexes... how do i get d3d8 to use both alpha sorces? :-) First game is right around the corner... just need to get the eye candy up and running! :-)

Share this post


Link to post
Share on other sites
Advertisement
Hi-

Have you tried the following (or something like it?):

d3ddevice.SetTextureStageState 0, D3DTSS_ALPHAOP, D3DTOP_MODULATE

If you set this flag, changing the vertex colors will affect the alpha value of the entire billboard. This effect will be in addition to any alpha information stored in the texture, so you can decrease the vertex color values to, say, fade a billboard.

What I do for billboards is to put two versions of the billboard in my vertex buffer -- the first has the diffuse color values set to &HFFFFFFFF and the second has the diffuse color values decreased. When I want to fade a billboard, I render it using the second versions of my vertices:




Here one flipboard is in front of another -- both have textures with alpha components



Now the first flipboard is behind the other, and the other has faded.




I first stumbled across this tip in this tutorial:

http://www.gamedev.net/reference/programming/features/2ddx8/page4.asp

But if you do a google search on D3DTSS_ALPHAOP etc... you'll find more info.

Hope this helps

-BM


[edited by - bmoberly on December 3, 2002 12:33:42 AM]

[edited by - bmoberly on December 3, 2002 12:37:48 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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!