Hi Zhidkov,

On Wed, Apr 22, 2009 at 10:37 AM, Zhidkov Evgueny <osgfo...@tevs.eu> wrote:
> Hi all!
>
> Due to some circumstances I'm now working under OSG. And looking on Geometry 
> node, I realized, that I don't know, how to do some basic things, which I 
> used to have:
>
> 1) Interleaved arrays.
> Say, I have vertex representation structure of 2 floats as vertex, 4 bytes as 
> color and 4 bytes as some factors. Vertex size is 16 bytes. How can I specify 
> my vertex array in such a interleaved order? As I found, OSG arrays simply 
> lay one after another in VBO memory, and I can't specify interleaved arrays.
> Is there any way to have interleaved vertex data representation to use 
> alignment features and GPU cache more effectively?

Modern graphics cards don't require interleaved arrays for good
performance.  Interleaved arrays were more relevant to CPU based T&L
processing as they made better use of the cache found on a CPU.

The OSG doesn't support interleaved arrays as they just complicate
setup and management for no gain in performance on modern systems.


> 2) Static VBO memory w/o system memory footprint.
> Say, I have some binary file with mesh representation, and I don't want to 
> have all this vertex soup in RAM. I want to load it directly to VBO and 
> forget about it. As I understood, that is impossible because of OSG base 
> paradigm, that drawing context may be attached or changed any time, so OSG 
> always get this arrays in system memory, loading to VBO on first 
> compilation/change event. So, memory consumption is twice (or sometimes even 
> 3 times) greater, than it could be.
> So, is it possible to "forget" about system memory source after loading data 
> to VBO?

It is possible, this is what is done for osg::Texture's - you can get
them to automatically unref data when download to the GPU.

In the case of vertex arrays you can do this manually if you wish, but
you'd loose all capability to do intersection testing etc.

As for the 3x memroy consumption, this is incorrect, you'll only get
2x memory consumption in main memory as the driver and application
memory will keep a copy of the data, while the GPU memory will only
copy from driver memory when required so this third copy is only
transient and doesn't even effect main memory.

For most user applications there is no need to try to be clever about
deleting the applications geometry data, even very large scale models
typically have few problems,

Robert.
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to