Mask Object In Panda3D

I spend many time to mask my tree but lose

tree.setTransparency(TransparencyAttrib.MAlpha)
lowPassFilter = AlphaTestAttrib.make(RenderAttrib.MUnused,0.5)
tree.setAttrib(lowPassFilter)
tree.setAttrib(DepthTestAttrib.make(RenderAttrib.MLessEqual))

Can I mask texture in panda3D
upload.hunsa.com/img.php?image=0 … titled.jpg

Thank You

What texture format are you using for your tree? Are you sure that it has an alpha channel? Panda will automatically mask out the parts where alpha = 0 when you enable transparency; you don’t need to fiddle with AlphaTestAttrib or DepthTestAttrib.

David

My texture format is .bmp file
I think it has not alpha channel but How to try or it is impossible

thx :slight_smile:

Correct, .bmp format does not support alpha, at least not with Panda’s bmp reader. Save your texture in .png or .tiff format to keep the alpha.

David

Or you could use a separate grey scale map for transparency and put it in your modelling software

Oh Ok
thx for all ^^