[SOLVED] Transparency for my tree!

Hey guys,

Oooh, I am pulling my ruddy hair out again! I followed the wiki on adding transparency to my textures. But still the leaves come out with a white frame. I'm sure the background is transparent, so now I don't know what to do!

Here's the code snippet:

    private void addTrees() {
        Node rootNodeTransparent = new Node("Transparent");

        BlendState tpState = DisplaySystem.getDisplaySystem().getRenderer().createBlendState();

        // convenience method that loads a JME tree 0,10,0 with scale x5. Adds it to the rootNodeTransparent Node
        loadSceneObject(rootNodeTransparent, new File("/Blender Work/trees/tree2/tree2-jme.xml"), new Vector3f(0f, 10f, 0f), 5f);

        /* We activate two-sided transparency (?) */
        ZBufferState zstate = DisplaySystem.getDisplaySystem().getRenderer().createZBufferState();


But it's still no good  :? Images below... Please can somebody put me out of my misery!? Do I have something switched on that maybe I shouldn't I've been tinkering for hours now, and still can't spot it!

This post is rather recent take a look:


Erm… Thanks SomethingNew.

I did look at this thread (I always search beforehand). My code is near-on identical to it, which frustrates me somewhat. I changed the TestFunction to GreaterThanOrEqualTo, but that doesn't make any difference either.

I'm using GIMP's alpha background. I wonder if I need to look to see what that is?

Ho hum!



Thank goodness for SceneMonitor is all I can say. I must have tried every ruddy setting under the sun. It turns out that the “applyMode” specified on the texture itself was “Decal”, whereas it should be “Replace”. I exported using hottbj exporter, and I can’t (yet) find the setting in Blender that makes this adjustment. So I make the adjustment to the XML myself and it’s all good:


               <com.jme.image.Texture2D apply=“Replace” wrapS=“Repeat” wrapT=“Repeat”>

                 <textureKey class=“com.jme.util.TextureKey” file=“t1_c.png” protocol=“file”/>



I guess “Replace” is the default property for textures which is why others aren’t experiencing my woes.

I just wish I understood half of what these settings actually mean!  :roll:

[EDIT] In Blender, it’s the “Map To” pull-down list that maps to the “applyMode” setting in JME. Blaine did mention that this should be “Multiply”, which maps to “Combine” in JME (the default Blender “Mix” setting is the one that maps to “Decal”). Combine is a little dark for my tastes, so it looks like it’s a manual fix right now.