[Solved] Transparent textures and objects

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.

from pandac.PandaModules import TransparencyAttrib
...
model.setTransparency(TransparencyAttrib.MAlpha)

panda3d.org/manual/index.php … te_Changes

Thank you very much. It really works.

Indeed it does! …but I’m wondering if someone can explain this to me:

  1. I have a model, much like the scenario here, and setting the Alpha gives the expected transparency.

  2. I have another model… that just works without doing anything, I get transparency.

Um… why? :slight_smile:

Cheers,
Gary

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

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