PDA

View Full Version : transparency: RGBA or BLENDING ?



SebastianB
07-08-2002, 12:35 AM
hi!

i want to do sth with transparent textures. it has to be sth fast, for it should be part of a simple game engine:

what i want to achieve is a texture representing a branch with leafs. when mapping it onto some vertices, i want every pixel to be transparent thats not part of the branch or one of the leafs.

is the better (comfortable and fast) way to do this with TWO textures and use one as a mask, or to use ONE texture with RGBA-values??

http://www.opengl.org/discussion_boards/ubb/smile.gif)
seb

Robbo
07-08-2002, 12:48 AM
Use alpha-test - RGBA texture with the alpha bits set to zero for the transparent pixels.

SebastianB
07-08-2002, 01:16 AM
damn, i feared you would say that, for i havent found a good tutorial on this yet. (neither on gametutorials.com nor from NeHe)

do you know a good one?

Robbo
07-08-2002, 01:29 AM
Erm - do a google for file formats that support alpha channel - I think DirectX SDK comes with one (which you can use for generating textures for OPenGL anyway).

Actually getting alpha test up and running is a piece of cake.

SebastianB
07-08-2002, 02:04 AM
ah, ok, i think i found a suitable example. thank you http://www.opengl.org/discussion_boards/ubb/smile.gif