Clean Log & Warnings

In order to see my own output i’ve been cleaning up the log in my program



{

// this static block in your main class will clean all the Node attache info’s

Logger.getLogger("com.jme3.scene.Node").setLevel(Level.WARNING);

}



but I am left with some warnings of which I don’t know what to do with:



(1) WARNING: Normal and tangent are parallel for vertex 0. (11 times)
(2) WARNING: Binormal is flipped for vertex 16. (4 times)
(3) WARNING: Uniform m_VertexColor is not declared in shader.


After some searching I could only find a comment on (3) stating that it's ok but not what it meant.

So, any expert help on these warnings please?
- What do they mean?
- Should I worry about them (at any time)?
- Can I drop the logging and forget?

Thanks :)

You can try:



setLevel(Level.SEVERE);



That should clean pretty much everything except a crash from Node.

@madjack is correct, the level that you set is the minimum level that will be output so go to the net level higher. (This functionality is the same for both java.util.logging and Log4J if anyone uses the latter)

(1) WARNING: Normal and tangent are parallel for vertex 0. (11 times)

and

(2) WARNING: Binormal is flipped for vertex 16. (4 times)

This means that normal and tangent are not good on one or several of your models

This can cause some faces to be black when they shouldn’t with the lighting material.

To avoid that you can use the TangentBinormalGenerator.generate(yourMesh) on your models, but it’s a quite long process.

The best way should be to convert your mesh.xml files to .j3o with JMP. (right click on your mesh.xml file / Advanced JME binary convert, check the create tangents check box and hit import)

The you just have to load the j3o file in your code.



(3) WARNING: Uniform m_VertexColor is not declared in shader.

this line can be ignored.

This is an abusive warning, and we will remove it.

1 Like

Thanks guys. I know how to deal with Loggers (yes I want the logging if it’s important, just not the spam if it’s not - no problem there), just want to know what the warnings warn about.


(1) WARNING: Normal and tangent are parallel for vertex 0. (11 times)
and
(2) WARNING: Binormal is flipped for vertex 16. (4 times)
This means that normal and tangent are not good on one or several of your models
This can cause some faces to be black when they shouldn’t with the lighting material.
To avoid that you can use the TangentBinormalGenerator.generate(yourMesh) on your models, but it’s a quite long process.
The best way should be to convert your mesh.xml files to .j3o with JMP. (right click on your mesh.xml file / Advanced JME binary convert, check the create tangents check box and hit import)
The you just have to load the j3o file in your code.


This is strange. I use only standard Boxes (in fact just one with about 200 translated copies - the original is TangentBinormalGenerated) and one sphere. That's it. No hand made meshes or other models, just the default shapes (so nothing to import or convert).

Ok, to illustrate the warnings with just the standard Box shape (with TangentBinormalGenerator), here is my test code:

Code:
import com.jme3.app.SimpleApplication; import com.jme3.material.Material; import com.jme3.math.Vector3f; import com.jme3.scene.Geometry; import com.jme3.scene.Node; import com.jme3.scene.Spatial; import com.jme3.scene.shape.Box; import com.jme3.system.AppSettings; import com.jme3.util.TangentBinormalGenerator; import java.util.logging.Level; import java.util.logging.Logger;

/**
*

  • @author Durandal
    */
    public class SpeedTest extends SimpleApplication{
    {
    Logger.getLogger(“com.jme3.scene.Node”).setLevel(Level.WARNING);
    }

    public static void main(String[] args) {
    SpeedTest app = new SpeedTest();
    AppSettings settings = new AppSettings(true);
    settings.setTitle(“Farms & Castles”);
    settings.setRenderer(AppSettings.LWJGL_OPENGL3);
    settings.setWidth(1024);
    settings.setHeight(768);
    app.setShowSettings(false);
    app.setSettings(settings);
    app.start();
    }

    public SpeedTest() {
    }

    Box boxMesh;
    Material mat;

    public Spatial getSpatial(Vector3f location){
    // build a cube and cache it
    if(boxMesh == null){
    boxMesh = new Box(0.5f,0.5f,0.5f);
    TangentBinormalGenerator.generate(boxMesh); // magic line or shadows fail
    boxMesh.setStatic();
    }
    if(mat==null){
    mat = new Material(assetManager, “Common/MatDefs/Misc/SimpleTextured.j3md”);
    mat.setTexture(“m_ColorMap”, assetManager.loadTexture(“Textures/Terrain/Pond/Pond.png”));
    }
    Geometry geom = new Geometry("Box " + location.toString(), boxMesh);
    geom.setMaterial(mat);
    geom.setLocalTranslation(location);
    return geom;
    }

    @Override
    public void simpleInitApp() {

     // 128 x 128 x 2 = 150k cubes
     Node map = new Node();
     for(int y=0; y<2; y++){
         for(int x=0; x<128; x++){
             for(int z=0; z<128; z++){
                 map.attachChild(getSpatial(new Vector3f(x,y,z)));
             }
         }
     }
     rootNode.attachChild(map);
    
     // cam positioning
     cam.setLocation(new Vector3f(-5,3f,-5));
     cam.lookAt(new Vector3f(128,1,128), new Vector3f(0,1,0));
    

    }

}


Should it generate the warnings (1 and 2), or is a bug in jme3?
Perhaps it's a bug in my test or I am handling somehting wrong. If so could you point it out?

btw: this test leaves me at approx 7 fps for 150k cubes, which is a lot less than the 40 fps than bgilb is getting in his 150,000 cubes post. Is that because he's running jme2, because he's creating the meshes himself, his hardware is 6x as fast as mine (I can't imagine - dual Ati4800), or ... ?

He’s using geometry batching, you’re not using it.

Momoko_Fan said:
He's using geometry batching, you're not using it.

Thanks, after some reading about it i think that should make a ton of difference, yes.
Is there some build in functionality for that in jme3?