frp
November 28, 2010, 12:52pm
1
I want to create plane (billboard) that textured with transparent png image. I tried, but it does not work.
Panda3d drawed white in places that had to be transparent.
What can I do?
If it is important, plane was created dynamically. It was not read from egg file.
PS. Sorry for my bad english.
enc
November 28, 2010, 5:01pm
2
from pandac.PandaModules import TransparencyAttrib
...
model.setTransparency(TransparencyAttrib.MAlpha)
panda3d.org/manual/index.php … te_Changes
frp
November 28, 2010, 7:07pm
3
Thank you very much. It really works.
Indeed it does! …but I’m wondering if someone can explain this to me:
I have a model, much like the scenario here, and setting the Alpha gives the expected transparency.
I have another model… that just works without doing anything, I get transparency.
Um… why?
Cheers,
Gary
heek
December 8, 2010, 10:40pm
5
darthrigg,
Maybe your egg is telling that to panda.
Maybe, something like:
<Scalar> alpha { dual }
I pondered something in the egg. But being new to the format, don’t see it here:
<CoordinateSystem> { Z-up }
<Comment> { "Egg laid by Chicken for Blender v1.0" }
<Texture> explosionRing.png {
"./explosion.png"
}
<Group> explosionRing {
<Transform> {
<Matrix4> {
1.000000 0.000000 0.000000 0.000000
0.000000 1.000000 0.000000 0.000000
0.000000 0.000000 1.000000 0.000000
0.007899 0.003239 -0.268257 1.000000
}
}
<VertexPool> explosionRing {
<Vertex> 0 {
0.708303 0.703643 0.016579
<UV> { 0.000000 0.000000 }
}
<Vertex> 1 {
-0.692505 0.703643 0.016579
<UV> { 1.000000 0.000000 }
}
<Vertex> 2 {
-0.692505 -0.697165 0.016579
<UV> { 1.000000 1.000000 }
}
<Vertex> 3 {
0.708303 -0.697165 0.016579
<UV> { 0.000000 1.000000 }
}
}
<Polygon> {
<TRef> { explosionRing.png }
<Normal> { 0.000000 0.000000 1.000000 }
<VertexRef> { 0 1 2 3 <Ref> { explosionRing } }
}
}
Regards,
Gary
drwr
December 10, 2010, 10:06pm
7
The egg loader checks the number of channels of your texture image; if it appears to include an alpha channel, it automatically enables transparency on the model.
In general, you only need to enable transparency explicitly when you enable transparency outside of an egg file.
David