TextRenderer strangeness

I’m having some strange problems with TextRendering still. Now I’ve added a debug mode where I can render grid coordinates into my scene:

http://www.whitehexagon.com/debug-grid.png

I was expecting white… sometimes there are even more colours being picked up from somewhere.

Rectangle2D textBounds = renderer.getBounds("(99,99)");
        float textWidth = (float) textBounds.getWidth();

        renderer.begin3DRendering();
        for(int x=0; x<PP_LENGTH;x++){
            for(int y=0; y<PP_WIDTH;y++){
                String message = "("+x+","+y+")";
                
                float effectX = (tileLength * x);     
                float effectY = (tileWidth * y);
                renderer.setColor(1f, 1f, 1f, 1f);
                renderer.draw3D(message, 
                        effectX, 
                        effectY, 
                        1f, 
                        BOX_WIDTH / textWidth);
            }
        }
        renderer.end3DRendering();

I’m also seeing a second problem now where sometimes various text renderers are just not displaying, unless a certain piece of geometry is also being rendered. I suspect the OpenGL state is being corrupted somewhere, but is there any utility methods to do a state comparison between various parts of my rendering loop? Or any sugestion on how to track down this type of issue? The object that ‘allows’ the textRenderers to display is using the following code: (in this case the model is not textured)

    public void render(final GL gl) {
        if (hasTexture.get()) {
            gl.glTexEnvf(GL.GL_TEXTURE_ENV, GL.GL_TEXTURE_ENV_MODE, GL.GL_DECAL);
            gl.glEnableClientState(GL.GL_TEXTURE_COORD_ARRAY);
            gl.glBindTexture(GL.GL_TEXTURE_2D, tmo.textureID);
            gl.glTexCoordPointer(2, GL.GL_FLOAT, 0, textureFB);
        } else {
            gl.glDisable(GL.GL_TEXTURE_2D);
        }
        
        gl.glVertexPointer  (3, GL.GL_FLOAT, 0, vertexFB);
        gl.glNormalPointer  (   GL.GL_FLOAT, 0, normalFB);
        gl.glColorPointer   (3, GL.GL_FLOAT, 0, colorFB);
        gl.glDrawArrays(GL.GL_TRIANGLES, 0, vertextCount);
        
        if (hasTexture.get()) {
            gl.glTexEnvf( GL.GL_TEXTURE_ENV, GL.GL_TEXTURE_ENV_MODE, GL.GL_BLEND);
            gl.glDisableClientState(GL.GL_TEXTURE_COORD_ARRAY);
        } else {
            gl.glEnable(GL.GL_TEXTURE_2D);
        }
        
    }

Try to use the DebugGL class. It should find the OpenGL corruption if any.

Nothing back from debugGL :frowning:

I read a few mentions of an older version of text renderer. Do I need to build that myself from somewhere? or is it in the latest builds under a different name?

Do as it is already done in TUER. I only copied the source code of the previous version in another class, there is no need to rebuild JOGL, only change the references to TextRenderer.

@ gouessej - Thanks for the tip/help! Now the colours are working fine :slight_smile: Only the code where I’m using a custom RenderDelegate fails, but I’m not using that for the next release so I don’t mind. Just happy to have finally got to the bottom of this one. Shame the latest version is so buggy because it was running much much faster than this one from what I can tell so far.
Cheers
Peter