PDA

View Full Version : transparency color



Nova
01-14-2003, 07:10 PM
Is there a way to set one color to be entirely transparent? My problem is that I'm making a 2d games by texturing sprites over polygons but there are there white corners around the sprites that aren't entirely rectangular.

nexusone
01-15-2003, 05:45 AM
Look at using the Alpha channel to mask areas that are to be transparent.


nehe.gamedev.net tutor 33 he uses them to create 2D sprites targets in a game.


Originally posted by Nova:
Is there a way to set one color to be entirely transparent? My problem is that I'm making a 2d games by texturing sprites over polygons but there are there white corners around the sprites that aren't entirely rectangular.

HamsterofDeath
01-15-2003, 12:42 PM
found another (very simple) solution :
glblend on
glcolor4f 1,1,1,1
glblendfunc src_alpha,one_minus_src_alpha -> complete opaque everywhere exept where the texture is black

-> only works when lighting is disabled, so you have to calculate the brightness yourself and set it with glcolor3f(r,g,b) if u need