Hi Simon, Am 22.03.2011 16:58, schrieb Simon Kolciter: > Hi, > > I have a model the geometry of which is being modified in real time and > therefore, the PER_VERTEX normal vectors have to be updated as well. > > The modification of normals takes too much computing force, so I thought of > pushing the computation onto the GPU. > > My question: > > Is it possible to use GLSL for operations that are independent from the > actual rendering? I am looking for something like this (all in a C++ > function): > > 1. Push the list of vertices and primitive indices to the GPU. > 2. Call GLSL function. > 3. Pull the resulting list of normals from the GPU. > > Is it possible to do it this way? Or are there any other ways to use HW > acceleration for such operations using only OSG and GLSL?
You could use a geometry shader to calculate the normals on the GPU. The geometry shader basically "sees" the whole primitive and can can therefore perform the normal calculation of a deforming geometry. > Thank you! > > Cheers, > Simon Cheers, Peter -- Vorstand/Board of Management: Dr. Bernd Finkbeiner, Dr. Roland Niemeier, Dr. Arno Steitz, Dr. Ingrid Zech Vorsitzender des Aufsichtsrats/ Chairman of the Supervisory Board: Michel Lepert Sitz/Registered Office: Tuebingen Registergericht/Registration Court: Stuttgart Registernummer/Commercial Register No.: HRB 382196 _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

