PDA

View Full Version : Cg for large static meshes


Castorios
01-23-2006, 04:17 PM
Only recently have I been investigating the Cg capabilities and I was wondering if anyone could help me clarify if Cg could help out in my situation:
I am currently working on a large training simulation using Performer. We have a database of 3D models that, as time goes on, will get much larger. As the new models are inserted into the simulation, the frame rate naturally goes down.
Could Cg add a boost in performance by directly loading these models into the graphics board memory, or is this already done with the Performer infrastructure. Is Cg only useful to special effects?

Thanks for any input.

mummey
01-23-2006, 08:45 PM
Only recently have I been investigating the Cg capabilities and I was wondering if anyone could help me clarify if Cg could help out in my situation:
I am currently working on a large training simulation using Performer. We have a database of 3D models that, as time goes on, will get much larger. As the new models are inserted into the simulation, the frame rate naturally goes down.
Could Cg add a boost in performance by directly loading these models into the graphics board memory, or is this already done with the Performer infrastructure. Is Cg only useful to special effects?

Thanks for any input.

You seem to need a different OpenGL extension. There are vertex array extensions to OpenGL that allow meshes to be loaded directly into video card memory. Look up "vertex array" and "vertex buffer object" for more information.

stew
01-24-2006, 12:06 AM
Cg (and also HLSL and GLSL) are more about doing fancy things to the vertices and fragment while they are being rendered. In your case, there still might be some speed to gain, depending on what you do to your vertices prior to rendering. For example, you can use vertex shaders to apply procedural transformations to your vertices using the GPU instead of the CPU.

Otherwise, if it's just the large polycount that's your main bottleneck, you could have a look at game programming resources and methods like octrees, progressive meshes, occlusion culling etc to reduce the number of polygons that you send to OpenGL. Depending on how strictly you're tied to the actual meshes, normal maps could be a way to reduce the polycount at the expense of texture memory (that would be using Cg again).

playmesumch00ns
01-24-2006, 10:36 AM
If you're just drawing the same large static meshes every frame, the best method to use is vertex buffer objects.

The performance difference between VBO's and display lists is minimal, although the performance of each can vary depending on the number of vertices passed, but I *think* that the drivers should just read from the memory you specify with VBO's, whereas GL will buffer display lists in main memory as well as on the card.

CGTalk Moderation
01-24-2006, 10:36 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.