Weird light problem with OBJ model

So I took some time and modeled icospheres for my project (very much a pain to texture), everything looks GREAT expect that if the models are added to a ACLOD lighting is normal.  However, when the models are just added to a node the diffuse lighting becomes very white and ugly (almost like a cross between smooth and flat lighting) even with just a straight down directional light.  Does anyone have any information as to what might be the issue, all my other models display fine.  I thought that maybe the ACLOD class changed the render state somehow but I can't seem to find anything there…

I finally got a chance to create some screen shots.  To me it looks like the diffuse light is all screwed up, but there is only the ONE directional light that is lighting everything else also.  I really am at a lose for whats going on here.





Model added to CLOD mesh. (lighting is correct)





Model added to Node. (lighting is NOT correct)





Wireframe model (just to show mesh detail)



TriMesh added to Node:

   
private Spatial buildBall( String ballName, int tableNumber, int ballNumber, int quality ) {
       
        Node ballNode = new Node();
       
        if ( ballCloner[ quality ] == null ) {
            final TriMesh sphere;
           
           
            String path = Utils.getModelPath( Utils.ModelType.TABLE_MODEL );
           
            if ( quality == 0 && ballNumber != -1 ) {
                sphere = (TriMesh) Utils.loadModel( getClass().getResource( path + "highResBall.obj" ) );
            } else if ( quality == 1 ||  ballNumber == -1  ) {
                sphere = (TriMesh) Utils.loadModel( getClass().getResource( path + "medResBall.obj" ) );
            } else if ( quality == 2 ) {
                sphere = (TriMesh) Utils.loadModel( getClass().getResource( path + "lowResBall.obj" ) );               
            } else {
                sphere = new Sphere( ballName, 4, 4, Globals.ballSize );
            }
           
           
            ballNode.attachChild( sphere );
            ballNode.setCullMode( SceneElement.CULL_DYNAMIC );
            ballNode.setModelBound( new BoundingSphere() );
            ballNode.updateModelBound();
            ballNode.updateRenderState();
           
            ballCloner[ quality ] = new CloneImportExport();
            ballCloner[ quality ].saveClone( ballNode );
           
        } else {
            ballNode = (Node) ballCloner[ quality ].loadClone();
        }
       
   

        ballNode.setName( ballName );
        Utils.color( ballNode, ColorRGBA.white, 128 );
       
        return ballNode;
    }





TriMesh added to ACLOD:


    private Spatial buildBall( String ballName, int tableNumber, int ballNumber, int quality ) {
       
        AreaClodMesh clodMesh = null;
       
        if ( ballCloner[ quality ] == null ) {
            final TriMesh sphere;
           
           
            String path = Utils.getModelPath( Utils.ModelType.TABLE_MODEL );
           
            if ( quality == 0 && ballNumber != -1 ) {
                sphere = (TriMesh) Utils.loadModel( getClass().getResource( path + "highResBall.obj" ) );
            } else if ( quality == 1 ||  ballNumber == -1  ) {
                sphere = (TriMesh) Utils.loadModel( getClass().getResource( path + "medResBall.obj" ) );
            } else if ( quality == 2 ) {
                sphere = (TriMesh) Utils.loadModel( getClass().getResource( path + "lowResBall.obj" ) );
            } else {
                sphere = new Sphere( ballName, 4, 4, Globals.ballSize );
            }
           
           
            clodMesh = new AreaClodMesh( ballName, sphere, null );


            clodMesh.setDistanceTolerance( 0.001f );
            clodMesh.setCullMode( SceneElement.CULL_DYNAMIC );
            clodMesh.setModelBound( new BoundingSphere() );
            clodMesh.updateModelBound();
           
           
            ballCloner[ quality ] = new CloneImportExport();
            ballCloner[ quality ].saveClone( clodMesh );
           
        } else {
            clodMesh = (AreaClodMesh) ballCloner[ quality ].loadClone();
        }
       
       
       
       
        Utils.color( clodMesh, ColorRGBA.white, 128 );
       
        return clodMesh;
    }


Could see your renderer function?

A few issues are possible:

  1. The sphere's normals are messed up
  2. You are not setting a correct material state for the node based loading, or not updating it correctly. Looking at the screenshots, it seems as if the node based sphere has the diffuse lighting scale much higher than the one used for ACLOD (you can still see a faint stair-step effect on ACLOD). Make sure the ACLOD and node setup code is identical except for the parent class.



    If you still can’t find the issue, you can try using SceneGraphDump on both scenes and see if any discrepancies exist between the render states.

Yes, the setup is EXACTLY the same.



But the normals very well may be screwed up (they are models) and if the ACLOD 'renormalizes' everything it would fix the issue, thanks for the suggestion.  I will check right now.