Advertisement Jump to content


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


I *think* I'm going mad.

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

Bluddy alpha-blending again. Ok, I want to be able to control the translucency level of a polygon (and it''s texture) by specifying an alpha value in the diffuse colour component in each vertex. I''m halfway there; I can get it to blend smoothly from solid to 50/50. It''s like the alpha stops at 128 or something (it doesn''t :p). When I remove the poly''s texture, I can gain full alpha control with the bare polys. So what difference does the texture make? Texture is 16-Bit (R5G6B5) BackBuffer/Primary is 16-Bit (R5G6B5) Material diffuse shares the Material ambient settings (1,1,1,1) Light (directional) is bright white (255,255,255,255) Here''s a portion of the main loop (I''m still playing so ignore the ton of state changes per cycle :p)

  lpDevice->Clear(0, NULL, D3DCLEAR_TARGET, 

  lpDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, TRUE);


  hr = lpDevice->SetTexture(0,TextureList[0]);
  lpDevice->DrawPrimitive(D3DPT_TRIANGLELIST, 0, 
  lpDevice->Present(NULL, NULL, NULL, NULL);

Anyone know anything I should know? I''d appreciate any help as this is *really* slowing me down! Cheers,

Share this post

Link to post
Share on other sites
Sounds like you may be modulating the alpha value between the Vertex Alpha and the Texture Alpha.

Now if a texture has no alpha(as yours doesnt) i 'THINK' d3d treats it as having an alpha value of 255 so this would mean that even with Vertex Alpha set to zero it would still only be 50% transparent.

Try setting your texture stage like this before you render



Hope that helps

Edited by - gazza on January 11, 2001 10:58:21 PM

Share this post

Link to post
Share on other sites

Oh God. Oh God.


Thank you so much! That was driving me nuts! I can't thank you enough - now I can get on with what I was doing about 2 weeks ago. Thanks again! =)

Edited by - CGI Joe on January 12, 2001 3:06:11 AM

Share this post

Link to post
Share on other sites
WOW ! Guess it worked

Actually thats what I keep telling my girlfriend but she''s having none of it

Anyway, glad I could help

Gary Simmons

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!