Struggling with alpha map on master

With this:

    matToast=new Material(app.getAssetManager(),"Common/MatDefs/Light/Lighting.j3md");
    matToast.setBoolean("UseAlpha",true);
    matToast.getAdditionalRenderState().setBlendMode(BlendMode.Alpha);

I get this:

java.lang.IllegalArgumentException: Material parameter is not defined: UseAlpha
at com.jme3.material.Material.checkSetParam(Material.java:459)
at com.jme3.material.Material.setParam(Material.java:475)

Also tried with Unshaded.j3md and:

matToast.setTexture(“AlphaMap”…

Alphamap is not defined in Unshaded…
Am I missing something?

Hi,

What are you trying to do exactly ?

What is that UseAlpha boolean ? It doesn’t seem to be included in Terrain.j3md nor in TerrainLighting.j3md.

As for the alpha maps : AlphaMap + AlphaMap_1 + AlphaMap_2 are defined in TerrainLighting ; not in Terrain.
For terrain you should look at Tex1 + Tex2 + Tex3.

Please see by yourself Terrain.j3md and TerrainLighting.j3md that are in Common.Matdefs.Terrain from jME3-terrain.jar.

This is not a Terrain, it just a Material that I want to apply to a quad. I want to make a transparent textured quad.

Have a look at the following commit from @nehon where UseAlpha was removed.

1 Like

Tu quoque, @nehon!

Carrément…

use the alpha channel of your texture to store alpha, it’s more efficient in many ways.
Don’t forget to put the quad in the transparent bucket, and/or user the alphaDiscardThreshold if it’s partially transparent (as in there are completely transparent areas in the texture).

1 Like