PDA

View Full Version : problems with transparent textures



mithun_daa
06-11-2004, 06:57 AM
im tryin to drape a texture of contours onto my terrain. and im settin the alpha (opacity) to 0 when the R,G & B values are 0. just before binding, the values are right, but when its draped it doesnt show as transparent. could anyone tell me what could be goin on. heres some code : (VB6)

blnIsOpenglList = glIsList(intI * 100000001 + intK * 101 + intJ)

'if so then render it
If glIsList(intI * 100000001 + intK * 101 + intJ) Then

'set the depth function to always so that the image is above everything
glDepthFunc cfAlways

glPolygonMode faceFrontAndBack, pgmFILL
glColorMaterial faceFront, cmmAmbientAndDiffuse

'enable 2D texture and color material property
glEnable glcColorMaterial
glEnable glcTexture2D
glTexEnvf tetTextureEnv, tenTextureEnvMode, tepDecal
glBindTexture glTexture2D, TEX_DRAPE_IMAGES + 101 * intI + intJ

'call the DL
glCallList (intI * 100000001 + intK * 101 + intJ)

'disable 2D texture and color material property
glDisable glcTexture2D
glDisable glcColorMaterial

glDepthFunc (cfLess)

End If

thank u

Aeluned
06-11-2004, 07:16 AM
did you enable blending?

ZbuffeR
06-11-2004, 07:26 AM
And what do you set for the glBlendFunc ?

mithun_daa
06-11-2004, 07:32 AM
Originally posted by Aeluned:
did you enable blending?YES.

mithun_daa
06-11-2004, 12:13 PM
Originally posted by mithun_daa:

Originally posted by Aeluned:
did you enable blending?YES.kkkk i fixed it. thanx guyz