Jump to content
  • Advertisement


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


16bit surface with no alpha?

This topic is 5829 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''m using directx8.0.... I have a question regarding drawing primitives that have an alpha value, to a surface that has no alpha value (such as r5g6b5). What does the blending function use for the "destination alpha" when there is no alpha information in my destination? thanks, - duck17

Share this post

Link to post
Share on other sites
well it seems that you specify the vertex colors in a 32 bit argb format regardless of the primary surface format.. and directx converts it for you.... but anyways 1.0 sounds reasonable. I guess ill just have to assume that and see what happens. ;D


Share this post

Link to post
Share on other sites
Lesson 98451b for 3D hardware: Never assume defaults for non-obvious things...

Even if it IS documented anywhere (albeit obscurely - I don''t think I''ve ever noticed it), I would definately never trust all drivers/hardware to honour a "default" value for using destination alpha blends on a surface without umm destination alpha.

If one is what you want, explicitly specify ONE as the blend factor.

duck17: you didn''t make it too clear what you wanted - if it''s simply alpha blending stuff with what is already on the render surface then destination alpha never comes into it, the mode you''d use would be SRCALPHA:INVSRC ALPHA

i.e. The operation the hardware will peform with SRCALPHA:INVSRCALPHA is:

FINAL_red = (SRC_a * SRC_red) + ((1.0-SRC_a) * DEST_red)
FINAL_green = (SRC_a * SRC_green) + ((1.0-SRC_a) * DEST_green)
FINAL_blue = (SRC_a * SRC_blue) + ((1.0-SRC_a) * DEST_blue)

Where FINAL is the rendered result, SRC is what is being rendered in the current Draw*Primitive* call and DEST is what was rendered in previous Draw* calls (i.e. what is already in the frame buffer BEFORE this blend). Assuming all colour components are in the range of 0 to 1 (actually they''re 0-255 but the h/w behaves as if they''re 0-1)

The INV in INVSRCALPHA simply means "inverse", look at the operation performed, as the SRC alpha gets higher, the inverse gets lower and vice versa.


Simon O''Connor
Creative Asylum Ltd

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.

GameDev.net 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!