PDA

View Full Version : forcing a texture to become transparent?



ilsvm
08-06-2003, 07:36 AM
Hi all,

Is it possible to force a texture already mapped on a polygon to become transparent by applying on top of it another texture with transparent regions?

Thanks for any help!

c0d3Junk3Y
08-06-2003, 08:03 AM
Check out http://nehe.gamedev.net Lesson38 might be what you're looking for. I know it is similar to what you are describing.

ilsvm
08-06-2003, 08:11 AM
I had a look at your suggestion, but #38 doensn't seem very relevant, or am I missing something?

Thanks for the help!

nexusone
08-06-2003, 10:47 AM
You use blending of textures and the alpha channel.

nehe lesson #32 is on alpha blending and testing which can be used to create a transparentcy maps.

Also look into blending, you can combine multiple textures to get diffrent effects.



Originally posted by ilsvm:
I had a look at your suggestion, but #38 doensn't seem very relevant, or am I missing something?

Thanks for the help!

ilsvm
08-07-2003, 01:05 AM
Blending does not help me unfortunately in this case, only alpha testing. The problem is that alpha testing happens BEFORE blending. Is it possible to emulate alpha testing after blending? My problem is that I want to make portions of an opaque texture transparent by modulating it with another texture that has transparent regions. Blending might give the corrensponding pixels in the framebuffer zero alpha, but I can't see that on screen.

nexusone
08-07-2003, 03:45 AM
Originally posted by ilsvm:
Blending does not help me unfortunately in this case, only alpha testing. The problem is that alpha testing happens BEFORE blending. Is it possible to emulate alpha testing after blending? My problem is that I want to make portions of an opaque texture transparent by modulating it with another texture that has transparent regions. Blending might give the corrensponding pixels in the framebuffer zero alpha, but I can't see that on screen.



You need to read up more on blending and the functions used to modulate the textures.

What you can do is combine the two textures first to get your transparentcy, then apply the resulting texture to the said object.

Also look at render to a texture, maybe will give you some ideas.