Common texture errors?

Hey Guys,



My loader is coming along. I'm getting geometry (may not be right but at least its there)



I dont appear to be getting textures yet though.  I used the code here as an example:



http://www.jmonkeyengine.com/jmeforum/index.php?action=post;board=2.0



my code looks like this:



TextureState tstate = new LWJGLTextureState();
            BufferedImage bi = null;
            bi = img.getImage();
            Texture t =
                    TextureManager.loadTexture(bi,
                    Texture.MM_LINEAR,
                    Texture.FM_LINEAR,true);
            tstate.setTexture(t);
            trimesh.setRenderState(tstate);



img is a stcucture of my own.  Its relaitvely certain that its creating a correct buffered image.


What are some common things I should check tjhat coudlcause geometry to come up without its textures visible?

Thanks

JK

The most common cause that I've seen when writing importers is that the UV coordinates (texture coordinates) are not actually set properly. That is, the texture is being applied, but the texture coordinates do not allow it to be shown.



Second, common cause is that the texture file is not found (you should see a warning in the output if this is the case).



Third, the TextureState is not being built or attached to the model.



Forth, updateRenderState() not being called.



(Hopefully, one of those caught your problem).



P.S. You have mipmapping turned off in that texture loading code, so your textures are going to look pretty ugly when they do appear.

Thanks



I wasnt' calling updateRenderState so ill add that.



Turns out after i cleaned up some extraneous polys that i am getting textures.



But using SimpleGame its all very dark.



I assume theres a way to turn up the light.  ll go poke at that before I ask any more.



JK

SimpleGame has only one point light… you could add more if you want in simpleInitGame:


        PointLight light = new PointLight();
        light.setDiffuse( new ColorRGBA( 1.0f, 1.0f, 1.0f, 1.0f ) );
        light.setAmbient( new ColorRGBA( 0.5f, 0.5f, 0.5f, 1.0f ) );
        light.setLocation( new Vector3f( 0, 100, 0 ) );
        light.setEnabled( true );

        /** Attach the light to a lightState and the lightState to rootNode. */
        lightState.attach( light );
        rootNode.updateRenderState();