3D Models alpha channel not working properly, jmonkey version 3.1

Hi,
I was wondering if it s normal that all the alpha from my model seem to not work properly anymore.
It seem the useAlpha setting inside the lighting material was remove and I can’t find a way to make my tree leaves show properly.

I did some test, and this is the material that show the best result. But not something I would show to public,
you can see through the trees if there is an alpha model in front depending on the distance from the object.
Even the leaves from the tree it self would do the same render bug and hide some part of the model.

this is the material configuration, if you see a mistake let me know.

Material My Material : Common/MatDefs/Light/Lighting.j3md {
     MaterialParameters {
        DiffuseMap : Repeat Models/Environment/Trees/PineTree2/MegaTextureMapA.png
        UseInstancing : false
        VertexLighting : true
        AlphaDiscardThreshold : 0.4
        Shininess : 0.1
     }
    AdditionalRenderState {
      Blend Alpha
      DepthWrite On
      DepthTest On
      AlphaTestFalloff 1.0
    }
}

is the node in the transparent bucket?
Also only set the leaves to it, not the non transparent parts.

Note: that setting hasn’t done anything since even before version 3.0 was released. So removing it should not have caused any issues.

Search for “transparent sorting” or “alpha sorting”, etc. and you’ll see similar posts every 4 days or so.

I wanted to merge the whole model together so it would use less memory and cpu time to travel the tree node and also use a single material to draw.
So I supose it has to be made with 2 nodes and 2 material?

And I was wondering why did boolean(useAlpha, true); removed?

I would use 2 nodes/materials for this.

Because it didn’t do anything. Set it true. Nothing happened. Set it to false. Nothing happened. It was not used for one single thing.

What did you think it would do?

To use alpha… have alpha in the texture or have alpha in the diffuse colors or have alpha in the vertex colors… or all three… then make sure it’s in the transparent bucket and blend mode is alpha. For those last two, no amount of material parameter is going to set those for you. For the first, you’d have needed that anyway.

…but the bottom line is that useAlpha was removed because it didn’t do anything.

I didnt test anything on 3.1 yet, but if this functionality was removed just with this talk “what do you think it do” ( that I already seen before in my posts), then its an important functionality that dont work anymore :

if(lamp) newcolor.a=1; else newcolor.a=0;

And yes, for lighting materials, its doing a lot in 3.0, and I am using it a lot in my games…
Sad to know it was removed for apparently no reason, first reason not to go to 3.1.

I would recommend you to pass to 3.1 I got a boost in my game fps of 20-30, it was running at 40-60 and now it reach 80-100

In 3.0 (and before that), useAlpha didn’t do anything. It was a hold over from a very long time ago.

That’s why it was removed. In your entire time here, useAlpha has never done anything.

This is the equivalent of no blend mode and alphaDiscardThreshold of 1 I guess? I don’t know what “lamp” is here. Of did you actually want to render the 0 alpha pixels and fill the z-buffer?

In this particular case I was using glow, and when we put 0 on alpha (glow color) it disable completely the glow, with 1 it enables it. It may be an special function of my video card, we already discuss this in another thread, and you guys told me that it suppose to do nothing, but its doing, and it gets nice effects…
When using glow this way, you get different effects when using blend additive, alpha, etc.
But, I didnt use the 3.1 yet, I just hope I misunderstood what was removed…

The “useAlpha” material parameter didn’t do anything in 3.0. It was an unused parameter. I don’t know how many different ways to say that.

Here… take a look at the 3.0 source. It’s easy because google code is forever frozen as 3.0.

UseAlpha is only mentioned in the .j3md:
https://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/core-data/Common/MatDefs/Light/Lighting.j3md

It is not once mentioned in the actual shader source:
https://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/core-data/Common/MatDefs/Light/Lighting.vert
https://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/core-data/Common/MatDefs/Light/Lighting.frag

It’s not even used in the shaders used in the glow pass:
https://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/core-data/Common/MatDefs/Misc/Unshaded.vert
https://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/core-data/Common/MatDefs/Light/Glow.frag

So maybe you are talking about something else… because “UseAlpha” never did anything in your entire time using the engine.

I did plenty of test in the last hours and the Alpha bug is still there, Something as change and i can tell, all the alpha model overlaps and hide part of other model, I didn’t had this problem on jmonkey 3.0.

Probably you were relying on alphaTest and now you must use alphaDiscardThreshold.

alphaTest was removed because it is deprecated in OpenGL.

Even if it is deprecated, why did it got removed? it s still working fine by me! I had better result then using the alphaDiscardThreshold which show my sky arround the leaves and you can see through other leaves.

What i am talking about

If you get a different result then the values are not comparable. You must have had a different alphaFalloff set than whatever alphaDiscardThreshold you are using.

…else you were just getting lucky with sorting.

Otherwise, they are functionally no different.

I ve never use the alphaFalloff and it was working fine

Material My Material : Common/MatDefs/Light/Lighting.j3md {
     MaterialParameters {
        HighQuality : true
        VTangent : false
        UseAlpha : false
        VertexLighting : false
        DiffuseMap : Repeat Models/Environment/Pine/Branches0014_1_S.png
        Minnaert : false
        SteepParallax : false
        UseVertexColor : false
        UseMaterialColors : false
        PackedNormalParallax : false
        EnvMapAsSphereMap : false
        SeparateTexCoord : false
        LowQuality : false
        HardwareShadows : false
        WardIso : false
        ShadowMapSize : 0.0
     }
    AdditionalRenderState {
      DepthWrite On
      AlphaTestFalloff 0.0
      Blend Off
      Wireframe Off
      FaceCull Back
      DepthTest On
      ColorWrite On
    }
}

I found out when I set my leaves to opaque everything work perfectly

Do you mean putting them in the opaque bucket?

…that makes no sense that it would work better unless you have some other stuff in the wrong bucket.

Can you show a picture of what’s happening?