Java-Gaming.org
Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars!
Featured games (78)
games approved by the League of Dukes
Games in Showcase (408)
games submitted by our members
Games in WIP (293)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  glVertexPointer versus Ogl-Displaylist  (Read 2105 times)
0 Members and 1 Guest are viewing this topic.
Bornter
Guest
« Posted 2003-07-05 07:16:07 »

Hello,

what's is the better/faster method to draw several filled triangle based 3d-objects with OpenGL and Jogl in particular:
1) to use glVertexPointer and then glDrawElements (or such), so that OpenGL fetches the geometric data from the main memory
2) to use OpenGL-Displaylists? For example:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
// p1x, p1x, p1y
int idx = o.glGenLists(1);
glNewList(idx, GL_COMPILE);
glBegin(GL_TRIANGLES),
glVertex3f(p1x, p1y, p1z);
glVertex3f(p2x, p2y, p2z);
glVertex3f(p3y, p3y, p3z);
// and so on for all vertices
o.glEnd();
o.glEndList();

The OpenGL Redbook manual says in Chapter 7:
>>>
Although you're not guaranteed that your OpenGL implementation optimizes display lists for any particular uses, the execution of display lists isn't slower than executing the commands contained within them individually. There is some overhead, however, involved in jumping to a display list. If a particular list is small, this overhead could exceed any execution advantage.
<<<

When scanning some OpenGL forums there are pretty contrary statements on this topic.

Personally I'd clearly prefer the Displaylist method.
First, it looks cleaner to me: the OpenGL implementation may transfer and optimize all neccessary geometric data for the list to its hardware (=server), so it's away from the slow main memory/system (=client) which needn't care about it - aside one nice index number to adress/draw it later.
Second, as a programmer, a platform independant Java programmer in particular, I don't have to fiddle with "optimal" data structures in main memory, or to care about (silly!) pointers and that like. I give the geometric data from pretty handy (but not optimal) data structures to the display list once at the beginning and voila: fire and forget.

-ric
Offline Axiom

Junior Newbie




Java games rock!


« Reply #1 - Posted 2003-07-05 10:37:00 »

With dynamic data and Hardware T&L, glDrawElements may be
the preferred (/a competetive) choice.

Gravity Sucks !!!
Offline princec
« League of Dukes »

JGO Kernel


Medals: 196
Projects: 3


Eh? Who? What? ... Me?


« Reply #2 - Posted 2003-07-05 11:11:35 »

A few years ago display lists were the fastest thing there was. (Not only can they be used for drawing but they can encapsulate state setup too).

The fastest way to do drawing will be ARB_vertex_buffer_object but it isn't widely supported yet.

Also note that display lists are broken in a few drivers which is extremely irritating. I used to advise using them but it's probably no longer the case that they truly worthwhile.

Cas Smiley

Games published by our own members! Check 'em out!
Try the Free Demo of Titan Attacks
Bornter
Guest
« Reply #3 - Posted 2003-07-05 11:21:50 »

Quote
With dynamic data and Hardware T&L, glDrawElements may be
the preferred (/a competetive) choice.

Thanks.

I forgot to mention that I intend static object data. The objects consist of pure static geometric data which is put into the displaylist once (in the init method). During the display the objects are being moved via a translation/rotation and then their displaylist is being called.

Is DrawElements still faster then? But why? Isn't the transfer of geometric data for many objects from main to the video-RAM slower...? :-)
Bornter
Guest
« Reply #4 - Posted 2003-07-05 11:23:55 »

Quote

(..)
Also note that display lists are broken in a few drivers which is extremely irritating. I used to advise using them but it's probably no longer the case that they truly worthwhile.

Oh what a pity. Now that I learned to like them...

For the ARB_vertice_ stuff: I'll have to read some docs about them, I think... for example http://www.opengl.org/developers/documentation/OpenGL14.html
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars!
 
Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars and Titan!

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

The invasion has landed! On Mars! And you're there to beat 'em!
cubemaster21 (125 views)
2013-05-17 21:29:12

alaslipknot (133 views)
2013-05-16 21:24:48

gouessej (163 views)
2013-05-16 00:53:38

gouessej (155 views)
2013-05-16 00:17:58

theagentd (168 views)
2013-05-15 15:01:13

theagentd (153 views)
2013-05-15 15:00:54

StreetDoggy (197 views)
2013-05-14 15:56:26

kutucuk (221 views)
2013-05-12 17:10:36

kutucuk (220 views)
2013-05-12 15:36:09

UnluckyDevil (224 views)
2013-05-12 05:09:57
Complex number cookbook
by Roquen
2013-04-24 12:47:31

2D Dynamic Lighting
by Oskuro
2013-04-17 16:46:12

2D Dynamic Lighting
by Oskuro
2013-04-17 16:45:57

2D Dynamic Lighting
by Oskuro
2013-04-17 16:23:20

Noise (bandpassed white)
by Roquen
2013-04-05 17:36:01

Noise (bandpassed white)
by Roquen
2013-04-03 16:17:38

Java Data structures
by Roquen
2013-03-29 13:21:12

Topic Request
by kutucuk
2013-03-22 21:42:01
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!
Page created in 0.099 seconds with 27 queries.