IndexedTriangleStripArray

Just been fiddling with a JOGL testcase that uses glLockArraysEXT and glDrawElements for a geometry discretized by indexed triangle strips. On a AMD 3000+, 6600GT 128MB, 2x512 MB PDP XBLK rig I get about 40FPS with the CPU at stock 1.8GHz and 50FPS with the CPU oc-ed to 2.2GHz. Based on the corresponding numbers using Java 3D (though it actually picks up glMultiDrawElementsEXT in my gfx config), something appears awry…may be with my jogl code ! Would like someone to check it out if possible, please. I’m looking at per-frame performance and not at the initial cost of setting up the buffers etc.

The geometry consists of nk = 101 square planes in the k-/z-dir. Each square plane is discretized by square cells with ni = 51 vertices in the i-/x-dir and nj = 51 vertices in the j-/y-dir. The strips are oriented along the i-dir, i.e., each j = constant row is a strip. There are (51 - 1) x 101 strips; each strip has 2 x ni = 102 vertices comprising 100 tris. Hope I got these right…!

The JOGL version that I used is one of the recent jsr231 daily builds I believe…! The files Main.java, ITSAEventHandler.java, and ITSA.java are below:

Main.java



/*
 * Test Case P7: IndexedTriangleStripArray
 * Geometry: C9/split
 * Date: Jan 05, '06
 * Author: N. Vaidya
 * Notes:
 *      JOGL uses glLockArraysEXT and glDrawElements
 *      Java 3D equivalent is GeomPerf.java, ITSAVisual.java
 *      Java 3D uses glMultidDrawElementsEXT, glLockArraysEXT
 * 
 */

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;

import javax.media.opengl.*;
import com.sun.opengl.utils.*;


public class Main {

    public static void main( String[] args ) {

        GLCanvas canvas = new GLCanvas();
        canvas.addGLEventListener( new ITSAEventHandler() );
        final Animator animator = new Animator( canvas );
        // animator.setRunAsFastAsPossible( true );

        JFrame frame = new JFrame( "ITSA" );
        frame.add( canvas );
        frame.addWindowListener( new WindowAdapter() {
            public void windowClosing( WindowEvent e ) {
              // Run this on another thread than the AWT event queue to
              // make sure the call to Animator.stop() completes before
              // exiting
              new Thread( new Runnable() {
                  public void run() {
                    animator.stop();
                    System.exit(0);
                  }
                }).start();
            }
          });
        frame.pack();
        frame.setSize( 400, 400 );
        frame.setVisible( true );
        animator.start();
    }
}

ITSAEventHandler.java




import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;

import java.nio.*;
import java.util.*;

import javax.media.opengl.*;
import com.sun.opengl.utils.*;


public class ITSAEventHandler implements GLEventListener {

    private GeomBuffers  geomBufs;

    public ITSAEventHandler() {
        ITSA geom = new ITSA();
        geomBufs = new GeomBuffers( geom );
    }
    
    public void init( GLAutoDrawable drawable ) {

        // Use debug pipeline
        // drawable.setGL( new DebugGL( drawable.getGL() ) );

        GL gl = drawable.getGL();

        System.err.println( "INIT GL IS: " + gl.getClass().getName() );

        gl.setSwapInterval(0);

        gl.glEnable( GL.GL_DEPTH_TEST );
        gl.glShadeModel( GL.GL_SMOOTH );

        float pos[] = { 0.0f, 0.0f, 10.0f, 0.0f };
        float yellow[] = { 1.0f, 1.0f, 0.0f, 1.0f };
        float white[] = { 1.0f, 1.0f, 1.0f, 1.0f };
        float gray[] = { 0.3f, 0.3f, 0.3f, 1.0f };
        float shininess[] = { 64.f };

        gl.glLightfv( GL.GL_LIGHT0, GL.GL_POSITION, pos, 0 );
        gl.glLightfv( GL.GL_LIGHT0, GL.GL_DIFFUSE, gray, 0 );
        gl.glLightfv( GL.GL_LIGHT0, GL.GL_AMBIENT, gray, 0 );
        gl.glLightfv( GL.GL_LIGHT0, GL.GL_SPECULAR, gray, 0 );
        gl.glEnable( GL.GL_LIGHTING );
        gl.glEnable( GL.GL_LIGHT0 );

        gl.glPolygonMode( GL.GL_FRONT_AND_BACK, GL.GL_FILL );

        gl.glMaterialfv( GL.GL_FRONT_AND_BACK, 
                         GL.GL_AMBIENT_AND_DIFFUSE, white, 0 );
        gl.glMaterialfv( GL.GL_FRONT_AND_BACK, 
                         GL.GL_SPECULAR, gray, 0 );
        gl.glMaterialfv( GL.GL_FRONT_AND_BACK, 
                         GL.GL_SHININESS, shininess, 0 );
        gl.glColorMaterial( GL.GL_FRONT_AND_BACK,
                            GL.GL_AMBIENT_AND_DIFFUSE );
        gl.glEnable( GL.GL_COLOR_MATERIAL );
    }
      

    public void reshape( 
                         GLAutoDrawable drawable,  
                         int            x, 
                         int            y, 
                         int            width, 
                         int            height 
                       ) {

        GL gl = drawable.getGL();

        System.err.println( "GL_VENDOR: " + 
                                gl.glGetString( GL.GL_VENDOR ) );
        System.err.println( "GL_RENDERER: " + 
                                gl.glGetString( GL.GL_RENDERER ) );
        System.err.println( "GL_VERSION: " + 
                                gl.glGetString( GL.GL_VERSION ) );

        float h = (float)height / (float)width;

        gl.glMatrixMode( GL.GL_PROJECTION );
        gl.glLoadIdentity();
        gl.glFrustum( -1.0f, 1.0f, -h, h, 5.0f, 60.0f );
        gl.glMatrixMode( GL.GL_MODELVIEW );
        gl.glLoadIdentity();
        gl.glTranslatef( 0.0f, 0.0f, -10.0f );
    }
    

    public void display( GLAutoDrawable drawable ) {

        GL gl = drawable.getGL();
        if ( ( drawable instanceof GLJPanel ) &&
            !( (GLJPanel) drawable ).isOpaque() &&
            ( (GLJPanel) drawable ).shouldPreserveColorBufferIfTranslucent() ) {
          gl.glClear( GL.GL_DEPTH_BUFFER_BIT );
        } else {
          gl.glClear( GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT );
        }

        renderGeometry( gl );
    }
    

    public void displayChanged( 
                                GLAutoDrawable drawable, 
                                boolean        modeChanged, 
                                boolean        deviceChanged 
                              ) {
    }
    

    private void renderGeometry( GL gl ) {

        gl.glEnableClientState( gl.GL_COLOR_ARRAY );
        gl.glEnableClientState( gl.GL_NORMAL_ARRAY );
        gl.glEnableClientState( gl.GL_VERTEX_ARRAY );

        gl.glVertexPointer( 3, gl.GL_FLOAT, 0, geomBufs.vcoordBuf );
        gl.glNormalPointer( gl.GL_FLOAT, 0, geomBufs.vnormalBuf );
        gl.glColorPointer( 3, gl.GL_FLOAT, 0, geomBufs.vcolorBuf );

        // for a weeny boost !?!
        gl.glLockArraysEXT( 0, geomBufs.vertexKnt );
        int[] stripIC = geomBufs.stripIC;
        IntBuffer vidBuf = geomBufs.vidBuf;
        int offset = 0;
        for ( int i = 0, imax = stripIC.length; i < imax; i++ ) {
            gl.glDrawElements( gl.GL_TRIANGLE_STRIP,  
                               stripIC[i], 
                               gl.GL_UNSIGNED_INT, 
                               vidBuf );
            offset += stripIC[i];
            vidBuf.position( offset );
        }
        gl.glUnlockArraysEXT();

        gl.glDisableClientState( gl.GL_COLOR_ARRAY );
        gl.glDisableClientState( gl.GL_NORMAL_ARRAY );
        gl.glDisableClientState( gl.GL_VERTEX_ARRAY );

    }

    private class GeomBuffers {

        int vertexKnt;
        FloatBuffer vcoordBuf;
        FloatBuffer vnormalBuf;
        FloatBuffer vcolorBuf;
        IntBuffer vidBuf;
        int[] stripIC;

        GeomBuffers( ITSA geom ) {

            vertexKnt = geom.vertexKnt;

            vcoordBuf = BufferUtils.newFloatBuffer( geom.vcoords.length );
            vcoordBuf.put( geom.vcoords );
            vcoordBuf.rewind();

            vcolorBuf = BufferUtils.newFloatBuffer( geom.vcolors.length );
            vcolorBuf.put( geom.vcolors );
            vcolorBuf.rewind();

            vnormalBuf = BufferUtils.newFloatBuffer( geom.vnormals.length );
            vnormalBuf.put( geom.vnormals );
            vnormalBuf.rewind();

            vidBuf = BufferUtils.newIntBuffer( geom.vids.length );
            vidBuf.put( geom.vids );
            vidBuf.rewind();

            stripIC = geom.stripIC;
        }
    }
}

ITSA.java




import java.nio.*;
import java.util.*;

public class ITSA {

    int vertexKnt;
    float[] vcoords;
    float[] vcolors;
    float[] vnormals;
    float[] vtcoords;
    int[] vids;
    int[] stripIC;

    ITSA() {

        int ni = 51;
        int nj = 51;
        int nk = 101;
        int ninj = ni * nj;

        int nic = ni - 1;
        int njc = nj - 1;
        int nkc = nk == 1 ? 1 : nk - 1;
        int nicnjc = nic * njc;

        int nVerts = ninj * nk;
        int nQuads = nicnjc * nk;
        int nTrias = 2 * nQuads;

        float rni = 1.f / ( ni - 1.f );
        float rnj = 1.f / ( nj - 1.f );
        float rnk;
        if ( nk == 1 ) {
            rnk = 0.f;
        } else {
            rnk = 1.f / ( nk - 1.f );
        }

        vertexKnt = nVerts;
        vcoords = new float[3 * nVerts];
        vcolors = new float[3 * nVerts];
        vnormals = new float[3 * nVerts];
        vtcoords = new float[2 * nVerts];
        vids = new int[2 * ni * njc * nk];

        int nvknt = 0;
        for ( int k = 0; k < nk; k++ ) {
            for ( int j = 0; j < nj; j++ ) {
                for ( int i = 0; i < ni; i++ ) {
                    vcoords[nvknt++] = -0.5f + i * rni;
                    vcoords[nvknt++] = -0.5f + j * rnj;
                    vcoords[nvknt++] = -0.5f + k * rnk;
                }
            }
        }

        stripIC = new int[njc * nk];
        Arrays.fill( stripIC, 2 * ni );

        int knt = 0;
        for ( int k = 0; k < nk; k++ ) {
            int kvoff = k * ninj;
            for ( int j = 0; j < nj - 1; j++ ) {
                int jvoff = j * ni;
                for ( int i = 0; i < ni; i++ ) {
                    int nv = i + jvoff + kvoff;
                    vids[knt++] = nv + ni;
                    vids[knt++] = nv;
                }
            }
        }

        for ( int n = 0, n3 = 0; n < nVerts; n++ ) {
            vcolors[n3++] = 1.0f;
            vcolors[n3++] = 0.0f;
            vcolors[n3++] = 0.5f;
        }

        for ( int n = 0, n3 = 0; n < nVerts; n++ ) {
            vnormals[n3++] = 0.0f;
            vnormals[n3++] = 0.0f;
            vnormals[n3++] = 1.0f;
        }
    }
}

OK ! in the ITSAEventHandler.java file above, it appears that the position of the index buffer needs to be reset to zero before the loop of glDrawElements. The (apparent) error due to this doesn’t show up for the parameters used in ITSA.java above, but it does result in an EA violation when I change the number of planes to 1, i.e., nk = 1.

Now, even with the fix above, with the CPU at stock speed of 1.8GHz, I get the following numbers:
jogl: ~40 FPS
Java 3D: ~80 FPS.

So, possibly I could still be missing something >:( !. I’m using Fraps to get the FPS, BTW. The test were performed with the Vsync off. System config same as in my first post.

The Java 3D equivalent of the jogl testcase above is the following files: GeomPerf.java, ITSAVisual.java, and ITSA.java.

GeomPerf.java:



// author: N. Vaidya

import java.awt.*;
import javax.swing.*;

import java.util.*;

import javax.media.j3d.*;
import javax.vecmath.*;

import com.sun.j3d.utils.universe.*;
import com.sun.j3d.utils.behaviors.vp.*;

public class GeomPerf {

    private TransformGroup         socketTG;
    private Canvas3D               canvas3D;
    private BoundingSphere         bounds;
      

    public GeomPerf() {

        bounds = new BoundingSphere( new Point3d(), Double.POSITIVE_INFINITY );
        setupSceneGraph();
        createGUI();
    }


    private BranchGroup createSceneGraph() {

        // Create the root of the branch graph
        BranchGroup rootBG = new BranchGroup();
        rootBG.setCapability( TransformGroup.ALLOW_CHILDREN_WRITE );
        rootBG.setCapability( TransformGroup.ALLOW_CHILDREN_READ );
        rootBG.setCapability( Group.ALLOW_CHILDREN_EXTEND );
        
        // Create a Transformgroup to scale all objects so they
        // appear in the scene.
        TransformGroup scaleTG = new TransformGroup();
        Transform3D t3d = new Transform3D();
        t3d.setScale( 0.5 );
        scaleTG.setTransform( t3d );
        scaleTG.setCapability( TransformGroup.ALLOW_CHILDREN_WRITE );
        scaleTG.setCapability( TransformGroup.ALLOW_CHILDREN_READ );
        scaleTG.setCapability( Group.ALLOW_CHILDREN_EXTEND );

        rootBG.addChild( scaleTG );
        scaleTG.addChild( ( new ITSAVisual() ).getPlugBG() );
        // rootBG.addChild( ( new ITSAVisual() ).getPlugBG() );

        FrameReporter fr = new FrameReporter();
        fr.setSchedulingBounds( bounds );
        rootBG.addChild( fr );
        
        return rootBG;
    }


    private void setupSceneGraph() {
        
        GraphicsConfiguration config =
                          SimpleUniverse.getPreferredConfiguration();
        
        canvas3D = new Canvas3D( config );
        SimpleUniverse u = new SimpleUniverse( canvas3D ); 
        ViewingPlatform viewingPlatform = u.getViewingPlatform();
        PlatformGeometry pg = new PlatformGeometry();
        
        // Set up the ambient light
        Color3f ambientColor = new Color3f( 0.3f, 0.3f, 0.3f );
        AmbientLight ambientLightNode = new AmbientLight( ambientColor );
        ambientLightNode.setInfluencingBounds( bounds );
        pg.addChild( ambientLightNode );
        
        // Set up the directional lights
        Color3f lightColor = new Color3f( 0.3f, 0.3f, 0.3f );
        Vector3f lightDirection  = new Vector3f( 0.0f, 0.0f, -1.0f );
        DirectionalLight light
            = new DirectionalLight( lightColor, lightDirection );
        light.setInfluencingBounds( bounds );
        pg.addChild( light );
        
        viewingPlatform.setPlatformGeometry( pg );
        
        // This will move the ViewPlatform back a bit so the
        // objects in the scene can be viewed.
        viewingPlatform.setNominalViewingTransform();
        
        OrbitBehavior orbit = 
                   new OrbitBehavior( canvas3D, 
                                      OrbitBehavior.REVERSE_ALL );
        orbit.setSchedulingBounds( bounds );
        viewingPlatform.setViewPlatformBehavior( orbit );	    
        
        u.addBranchGraph( createSceneGraph() );
    }


    private void createGUI() {

        JFrame mainFrame = new JFrame();
        canvas3D.setSize( 400, 400 );

        JPanel cp = new JPanel();
        cp.setLayout( new BorderLayout() );
        cp.add( canvas3D, BorderLayout.CENTER );

        mainFrame.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
        mainFrame.getContentPane().add( cp );
        mainFrame.pack();
        mainFrame.setVisible( true );
    }
      
    public void frameChanged( int frameCount ) {

        // noOp
    }


    private class FrameReporter extends Behavior {
    
        private int                       frameCount;            
        private WakeupCriterion           wc;
     
        public void initialize() {
     
            frameCount = 0;
            wc = new WakeupOnElapsedFrames(0);
            wakeupOn( wc );
        }
     
     
        public void processStimulus( Enumeration criteria ) {
     
            frameChanged( frameCount++ );
            wakeupOn( wc );
        }
    }


    public static void main( String[] args ) {

        new GeomPerf();
    }
}

ITSAVisual.java



import java.awt.image.*;
import java.util.*;

import javax.media.j3d.*;
import javax.vecmath.*;


public class ITSAVisual {
      
    private  BranchGroup    m_plugBG;
      

    public ITSAVisual( 
                     ) {

        createSubGraph();
    }


    public BranchGroup getPlugBG () {
        return m_plugBG ;
    }


    public void detachSelf() {

        if ( m_plugBG != null ) {
            if ( m_plugBG.isLive() ) m_plugBG.detach();
            m_plugBG = null;
        }
    }


    private void createSubGraph() {

        m_plugBG  = new BranchGroup();
        m_plugBG.setCapability( Group.ALLOW_CHILDREN_READ );
        m_plugBG.setCapability( Group.ALLOW_CHILDREN_WRITE );
        m_plugBG.setCapability( BranchGroup.ALLOW_DETACH );
        m_plugBG.setUserData( this );

        Shape3D shape = new Shape3D();
        shape.setPickable( false );
        shape.setAppearance( createAppearance() );
        shape.setGeometry( createByRefGeometry() );

        m_plugBG.addChild( shape );
    }


    private Appearance createAppearance() {

        Appearance app = new Appearance();

        ColoringAttributes ca = new ColoringAttributes();
        Color3f color = new Color3f( 1.f, 1.f, 1.f );
        ca.setColor( color );
        PolygonAttributes pa = new PolygonAttributes();
        pa.setPolygonMode( PolygonAttributes.POLYGON_FILL );
        pa.setCullFace( PolygonAttributes.CULL_NONE );
        Material mat = new Material();
        mat.setLightingEnable( true );
        mat.setAmbientColor( color );
        mat.setDiffuseColor( color );
        mat.setSpecularColor( new Color3f( 0.3f, 0.3f, 0.3f ) );
        mat.setShininess( 64 );
        mat.setColorTarget( Material.AMBIENT_AND_DIFFUSE );
        app.setPolygonAttributes( pa );
        app.setColoringAttributes( ca );
        app.setMaterial( mat );
        return app;
    }


    private IndexedTriangleStripArray createByRefGeometry(
                                                    ) {

        ITSA geom = new ITSA();
        int vertexKnt = geom.vertexKnt;
        float[] vcoords = geom.vcoords;
        float[] vcolors = geom.vcolors;
        float[] vnormals = geom.vnormals;
        int[] vids = geom.vids;
        int[] stripIC = geom.stripIC;

        IndexedTriangleStripArray  ga = 
           new IndexedTriangleStripArray( 
                            vertexKnt,
                            IndexedTriangleStripArray.COORDINATES |
                            IndexedTriangleStripArray.COLOR_3 |
                            IndexedTriangleStripArray.NORMALS |
                            IndexedTriangleStripArray.USE_COORD_INDEX_ONLY |
                            IndexedTriangleStripArray.BY_REFERENCE,
                            vids.length,
                            stripIC
                                   );
        ga.setCoordRefFloat( vcoords );
        ga.setColorRefFloat( vcolors );
        ga.setNormalRefFloat( vnormals );
        ga.setCoordinateIndices( 0, vids );

        ga.setCapability( GeometryArray.ALLOW_REF_DATA_READ );
        ga.setCapability( GeometryArray.ALLOW_REF_DATA_WRITE );

        return ga;
    }
}

ITSA.java:
This is exactly the same as the one posted as part of the jogl testcase bundle earlier.

Why are you enabling and disabling the client-side state every frame? If you stop doing this what happens to the performance?

Have you looked at the VertexArrayRange demo in the jogl-demos workspace? That is a good example of how to draw dynamic geometry with JOGL with high performance (though it does rely on the NV_vertex_array_range extension, which isn’t recommended anymore…)

Ken,

Can this function checkElementVBODisabled(), which is invoked in the glDrawElements wrapper, turn out to be a time sucker ? May be a chance to speed-up things effectively by 50%, or, may be I have it all wrong :)!

OK ! Attached is a netbeans profiler report for call tree times. This report is for the parameters in ITSA.java specified as follows: ni = 512, nj = 12, nk = 50, i.e., for numVertices = ni * nj * nk = 307,200. Topologically, the config can be likened to a bunch of 50 tubes, with 11 strips per tube, and 512 vertices per strip. Thus, the number of strips = (12 - 1) x 50 = 550 and, consequently, requires that many number of glDrawElements calls.

The profiler snapshot was taken after sufficient warm-up and by resetting the counter to time 25 calls to display() and, thus, 25 x 550 = 13,750 calls to glDrawElements. I see nearly 30% of time being spent in checkElementVBODisabled() and specifically a big chunk in HashMap.

– Vaidya


http://img367.imageshack.us/img367/7550/g51212507ze.th.gif

It’s possible; do you have a self-contained test case for this? Alternatively, can you set up a build of the JOGL source tree locally? If you comment out the body of that method in make/gl-impl-CustomJavaCode.java, rebuild, and find that your application is significantly faster, please file a bug using the JOGL Issue Tracker.

Ken
It’s even worse when used with VBO’s.
In a simple test case using drawelements the time spent rendering one frame went from 23 ms to 5 ms when using drawarrays instead and just incrementing the start param my self.
/Johan

I’m sorry, but do you have a test case clearly illustrating the problem?

OK ! got myself a new build by commenting out the contents of “private void checkElementVBODisabled” in make / gl-impl-CustomJavaCode.java.

Tested the original and modded builds against demos/vertexArrayRange/VertexArrayRange.java since it does seem to make glDrawElement calls. The results are:

  1. with -slow flag:
    50 FPS (original) and 56 FPS (modded)

  2. w/o any flag
    70 FPS (original) and 83 FPS (modded)

So, the modification w.r.t that testcase does seem to make an impact. However, I can’t help but wonder if the comparisons are with regard to the fixed cost of checkElementVBODisabled against the variable cost (and which in many cases could be possibly higher) of glDrawElements calls.

And as for my own testcase, the modification seems to have no impact when the application is launched from a console. While profiling, however, there does seem to be a fairly significant difference in FPS.

The testcase consists of the first 3 files posted here with a few modifications noted later. I’ll post the testcase as an issue if it is worth investigating.

Thanks

– Vaidya

Thanks for investigating this further. I can not reproduce your findings with the VertexArrayRange demo. On my machine I get a speedup from some 46 FPS to 49 FPS with checkElementVBODisabled commented out. That’s a 6% speedup compared to an 18% speedup you saw with that demo. Since that demo is more or less an extreme test case anyway and uses an obsolete extension I’m not too concerned about it.

It sounds to me like your profiler is skewing the time spent in small methods.

At this point if you want to file a low-priority issue about the cost of the various VBO/PBO checking routines please feel free and we’ll try to tune them further. Please include all of your findings to date and a pointer to this thread. Thanks.

A plausible explanation is the speed of the gfx card. I’m using a 6600GT pcie. My guess, possibly not well researched, is that the faster the card, the more amplified will be the differences, as we are evaluating fixed CPU cost against rendering cost. Anyways, the snapshots of the numbers that I quoted earlier for vertexArrayRange demo are attached.

And my profiler is Netbeans :slight_smile: !
Probably again the same rationale ? The profiler is more CPU intensive than GPU intensive and, consequently, amplifies the non-rendering overhead. Attached are 2 profiler snapshots of my own testcase. The original version of jogl indicates an FPS of 217 *1000 / 7180 = 30, while the modified version with the checkElementVBODisabled call removed seems to give an FPS of 309 * 1000 / 8052 = 38. But as I mentioned earlier, the FPS is expectedly higher BUT virtually identical when I launch my testcase from the console.

I guess the reason why it may be worthwhile to look into this is because the differences seem to manifest themselves even in nominal FPS ranges of 40 - 90. So, I’ll go ahead and make myself a jogl observer :slight_smile: and file an issue ! And I haven’t still figured why there is a speed diff between jogl and Java3D.


http://img286.imageshack.us/img286/5334/jogloriginalslow4xj.th.gif


http://img67.imageshack.us/img67/3408/joglmoddedslow9nx.th.gif


http://img235.imageshack.us/img235/5079/jogloriginalnonslow1bg.th.gif


http://img67.imageshack.us/img67/3504/joglmoddednonslow2ju.th.gif


http://img281.imageshack.us/img281/6436/g5121250jogloriginal6fc.th.gif


http://img150.imageshack.us/img150/4229/g5121250joglmodded8jo.th.gif

is there been a solution for this problem? My profiler says that the glGetIntegerv1() function in checkElementVBODisabled() needs 34% of the time spend in my displaymethod .

[edit]
i have made some tests, it seems, that this bottleneck only occures, when using big indexbuffers.
indexbuffer with ~500000 indices the call consumes 34% of the time.
where indexbuffer with ~3000 indices the call consumes 9% of the time.
[\edit]

i have a intel mac with a ATI X1900 and i am using the jogl-jsr231-1.0.0 build from 14. sep. 2006.

kind regards,
funsheep

I’m not convinced that this profile information is accurate. If you want to see whether that routine really makes a difference, please check out the gluegen and jogl projects and build JOGL from the sources. (cvs -d :pserver:guest@cvs.dev.java.net:/cvs co jogl gluegen). You can edit make/gl-impl-CustomJavaCode.java to comment out the bodies of the methods like checkElementVBODisabled. I suspect you will find that after doing so your frame rate does not increase. Please post your findings.