[Fwd: [PyOpenGL-Users] glVertexArrayd slows performance]
Brought to you by:
mcfletch
From: Douglas T. <dt...@sk...> - 2006-02-05 02:15:41
|
Sorry, I should have mentioned that the positions are changing every frame. Thanks, Doug -------- Original Message -------- Subject: [PyOpenGL-Users] glVertexArrayd slows performance Date: Sat, 04 Feb 2006 16:46:50 -0800 From: Douglas Taylor <dt...@sk...> To: pyo...@li... Hi, I've been trying to improve a dot drawing routine and I tried the vertex array method but it slows performance by a factor of 2. My testing machine runs Mac OSX 10.3.9 and has PyOpenGL version 2.0.2.01 . I tried allocating the xyData array 2 ways and both have the same performance 1) xyData = RandomArray.uniform(0.0,1.0, (NUM_POINTS,2)) 2) xyData = Numeric.zeros( (NUM_POINTS,2), 'd') and the code looks as if use_vertex_array == False: glColor4f(1.0, 0.0, 0.0,1.0); glBegin(GL_POINTS); for i in range(NUM_POINTS): glVertex3f(xstart[i],ystart[i],zstart[i]); glEnd() else: # Pass a pointer to the start of the point-coordinate array: glColor4f(0.0, 1.0, 0.0,1.0); xyData[:,0] = xstart xyData[:,1] = ystart glVertexPointerd(xyData); glEnableClientState(GL_VERTEX_ARRAY); glDrawArrays(GL_POINTS, 0, len(xstart)); glDisableClientState(GL_VERTEX_ARRAY); By timing parts of the code it spends most of it's time in glVertexPointerd(xyData); the call to glDrawArrays(GL_POINTS, 0, len(xstart)); is quite fast. Am I doing something wrong here? Any help would be greatly appreciated. Thanks, Doug Taylor ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642 _______________________________________________ PyOpenGL Homepage http://pyopengl.sourceforge.net _______________________________________________ PyOpenGL-Users mailing list PyO...@li... https://lists.sourceforge.net/lists/listinfo/pyopengl-users |