Hi all,

I want to use pseudo-instancing 
(http://developer.download.nvidia.com/SDK/9.5/Samples/DEMOS/OpenGL/src/glsl_pseudo_instancing/docs/glsl_pseudo_instancing.pdf)
 

in OpenSG. Basically, I would like to render thousands of identical 
meshes with different vertex attributes, let's say multitexture 
coordinates. A vertex shader is used to translate the texture 
coordinates into transformations and therefore influences the 
positioning of the different instances. I have implemented a memory 
consuming approach, where each instance is represented by a geometry 
core as a leaf in the scenegraph with corresponding texture coordinates. 
Unfortunately, the texture coordinates are duplicated for each vertex of 
the geometry core and, in addition, each vbo is transfered to the 
graphics hardware. Basically, just the texture coordinates and one 
instance of the geometry should be considered.   

In OpenGL, this implementation would look like this (ref. Nvidia's 
pseudo-instancing):
// Render the instances of the mesh
for(i=0; i<instances.size(); i++)
{
  // Send down the matrix and other parameters
  // pseudo-instancing passes per-instance data down
  // as texture coordinates
  glMultiTexCoord4fv(GL_TEXTURE1, instances[i].mWorld[0]);
  glMultiTexCoord4fv(GL_TEXTURE2, instances[i].mWorld[1]);
  glMultiTexCoord4fv(GL_TEXTURE3, instances[i].mWorld[2]);
  // Set the color for the instance
  glColor4fv(gInstances[i].mColor);
  // Render the instance
  mesh->render();
}
 
Has anybody faced that problem before and implemented a node core, which 
is able to handle these features? I would imagine that some multifields 
for texture coordinates and a field for handling the geometry, let say a 
GeometryPtr, are needed. Can anybody help me realizing this node core?
 
 
Thanks a lot!
 Daniel

------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to