Xojo Conferences
XDCMay2019MiamiUSA

Maximum optimization (Real Studio games Mailinglist archive)

Back to the thread list
Previous thread: REALbasicGL
Next thread: How to draw 3D lines and Circles into Rb3dspace?


[ANN] Preview of RBD 2.4   -   Marc Zeedar
  Maximum optimization   -   cap'n bishop
   Re: Maximum optimization   -   Asher Dunn

Maximum optimization
Date: 28.03.05 05:00 (Sun, 27 Mar 2005 20:00:33 -0800 (PST))
From: cap'n bishop
I'm using OpenGL and I want to attain a maximum of optimization when
retrieving data while rendering. My question is this: would it be
faster to store geometric information in an array of primitives (for
instance, a two dimentional array for a height map), or to store it in
a memoryblock (but have to treat it as a two dimentional array).

Would these be the same though?

For cleaner code, what if I were to create memoryblock subclasses with
accessors (for each type of data, like verticies) and stored those in
an array, how would that compare? This would probably be best since
then the data could be sent to OpenGL by just passing the memoryblock.

Overall I'm trying to find the fastest but simplest means to handle
this, since the data will have to be handled rapidly and frequently
(every frame); and I'm to understand that simply storing data in
properties of a class isn't the fastest means.

There was an article in RBDeveloper about similar techniques that would
simulate data structures (found in other languages but not RB) with
class extentions in a module, but I'd rather not use this method
because I think it tends to look dirty in the code (and either pollutes
namespace, or involves funky naming) and I don't like the idea of a
global method being able to alter ANY memoryblock.

Thanks


__________________________________
Do you Yahoo!?
Yahoo! Small Business - Try our new resources site!
http://smallbusiness.yahoo.com/resources/
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Re: Maximum optimization
Date: 28.03.05 05:17 (Sun, 27 Mar 2005 23:17:16 -0500)
From: Asher Dunn

On Mar 27, 2005, at 11:00 PM, cap'n bishop wrote:

> I'm using OpenGL and I want to attain a maximum of optimization when
> retrieving data while rendering. My question is this: would it be
> faster to store geometric information in an array of primitives (for
> instance, a two dimentional array for a height map), or to store it in
> a memoryblock (but have to treat it as a two dimentional array).
> Would these be the same though?

Those would be approximately the same performance wise, but if you're
passing arrays to OpenGL you have to use memoryblocks.

> For cleaner code, what if I were to create memoryblock subclasses with
> accessors (for each type of data, like verticies) and stored those in
> an array, how would that compare? This would probably be best since
> then the data could be sent to OpenGL by just passing the memoryblock.

If you want speed, DO NOT use accessors.

> Overall I'm trying to find the fastest but simplest means to handle
> this, since the data will have to be handled rapidly and frequently
> (every frame); and I'm to understand that simply storing data in
> properties of a class isn't the fastest means.

If you're using vertex arrays, definitely use a memoryBlock (you don't
have a choice). But if you're calling glVertex***, RB arrays are
probably better.

Asher Dunn
--------------------------------------------------------
President and Head Developer of Fireye Software
<http://www.fireyesoftware.com/>
AIM and Yahoo: fireye7517

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>