Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (494)
Games in Android Showcase (114)
games submitted by our members
Games in WIP (563)
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 2608 times)
0 Members and 1 Guest are viewing this topic.
Bornter
Guest
« Posted 2003-07-05 05: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 08:37:00 »

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

Gravity Sucks !!!
Offline princec

JGO Kernel


Medals: 378
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #2 - Posted 2003-07-05 09: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!
Legends of Yore - The Casual Retro Roguelike
Bornter
Guest
« Reply #3 - Posted 2003-07-05 09: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 09: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.

 

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

The first screenshot will be displayed as a thumbnail.

Dwinin (19 views)
2014-09-12 09:08:26

Norakomi (54 views)
2014-09-10 13:57:51

TehJavaDev (63 views)
2014-09-10 06:39:09

Tekkerue (31 views)
2014-09-09 02:24:56

mitcheeb (53 views)
2014-09-08 06:06:29

BurntPizza (37 views)
2014-09-07 01:13:42

Longarmx (23 views)
2014-09-07 01:12:14

Longarmx (27 views)
2014-09-07 01:11:22

Longarmx (26 views)
2014-09-07 01:10:19

mitcheeb (34 views)
2014-09-04 23:08:59
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
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!