best practice for transfering data across to GPU

hey all. been working on an astronomical map using JOGL. i’m curious as to how people approach moving the data across to the GPU. more specifically, do you traverse your scenegraph and assemble your data as a collection, then optimize ( or do this as you go ), then hand over data to OpenGL renderer to munch on, OR, do you pass the GL object reference to whatever’s crawling your scenegraph to call a GL rendering method during traversal.

or maybe more simply, should i restrict all GL calls to my object that contains the GL reference? if so, what should i hand over to that object: vertex data, or a scene objects that have draw() methods, etc.? hope this makes sense.

http://www.java-gaming.org/forums/index.php?topic=6252.0

AWESOME! thank you very much cylab.

so, if i understood the thread as it relates to my questions:

  1. scenegraph sorting and management is important, but not the end of the world. my main goal here is to just look for what has changed only, sort them into appropriate buckets, do whatever optimization i can then…

  2. minimize calls across JNI. therefore, when i’m crawling my graph, i want to be preparing and packaging my renderables at that time so that i can present the vertex, color, texture data to GL in the minimum possible number of calls.

  3. don’t pass the GL object to the scenegraph crawler, instead queue up all of my data ( REFERENCES to primitives ) into a collection of state change buckets. hand this collection over to the GL object which will have a bunch of routines for interpreting these states as drawing commands.

does that make sense?

working with astronomical data, i often have to sort through 100K objects. but recently i’m working on a new way of graphing items on a sphere that is a little different than the traditional right ascension and declination. if anyone is interested:

here is a link to traditional astronomical coordinates on a sphere:

http://lyra.colorado.edu/sbo/astroinfo/coords/coordinates.html

and here is the newer, faster way ( to work with data relating to projection of the celestial sphere ):

http://skyserver.org/htm/