Simple vertex attrib feedback example

VSG extension Demonstates how to use the SoVertexAttribFeedback to perform GPU computation and record the result in SoGLBufferObject objects.

The SoVertexAttribFeedback node allows to record the content of the varyings in a geometry shader into SoGLBufferObject. In this demo we use a geometry shader to tesselate some triangles by outputing for each triangle a set of three new triangles. Then the generated content is used in a SoBufferedShape and added to the viewer's scene graph.

The node SoVertexAttribFeedback, by default, disables the rasterizer because we want to record the triangles but it is possible to enable it.

This demo uses vertex attrib feedback (known as transform feedback in OpenGL) to generate the vertives position and color on the GPU and then uses a SoBufferedShape to render the resulting data. The positions and the colors are packed in a single SoGLBufferObject unsing the INTERLEAVED buffer mode. The stide fields in the SoBufferedShape are set in order to use the packed buffer object.



SoVertexAttribFeedback, SoBufferedShape, SoBBox, SoGLBufferObject, SoShaderProgram, SoVertexShader, SoFragmentShader, SoGeometryShader


Open Inventor Toolkit reference manual, generated on 1 Nov 2022
Copyright © Thermo Fisher Scientific All rights reserved.