public class SoVertexAttribFeedback extends SoSeparator
This node can only be used when an GLSL shader is enabled on the Open Inventor state. If the active shader contains a geometry shader the attributes are recorded from the varyings declared in it, otherwise it records the attributes from the vertex shader.
The function registerFeedback is used to specify the buffer object, which will receive the data, attached to a specified varying.
The scene graph which will be rendered during the traversal (can be any shape used as input of the geometry or vertex shader) is specified using the regular addChild function from the class SoSeparator
.
This node provides a mechanism for the following features:
SoGLBufferObject
can be automatically resized to be able to record all the data.
Limitations
File format/default:
VertexAttribFeedback {
disableFragmentProcessing | true |
autoResizeBuffers | false |
queryGeneratedPrimitivesCount | false |
buffersMode | SEPARATE |
primitiveType | TRIANGLES |
Action behavior:
SoGLRenderAction
Do the actual vertex attributes feedback operation.
See also:
Modifier and Type | Class and Description |
---|---|
static class |
SoVertexAttribFeedback.BufferModes
This enum is used by the field buffersMode to describe the data packing format in the buffer objects.
|
static class |
SoVertexAttribFeedback.PrimitiveTypes
This enum is used to setup the expected recorded primitive type from the shaders.
|
SoSeparator.Cachings, SoSeparator.FastEditings, SoSeparator.RenderUnitIds
SoNode.RenderModes
Inventor.ConstructorCommand
Modifier and Type | Field and Description |
---|---|
SoSFBool |
autoResizeBuffers
Set this field to true when the size of the recorded varyings is not known.
|
SoSFEnum<SoVertexAttribFeedback.BufferModes> |
buffersMode
The buffer mode used to record the primitives.
|
SoSFBool |
disableFragmentProcessing
Turn off the fragment rasterizer.
|
SoSFEnum<SoVertexAttribFeedback.PrimitiveTypes> |
primitiveType
The type of primitive recorded during traversal.
|
SoSFBool |
queryGeneratedPrimitivesCount
Read back the number of recorded primitives.
|
boundingBoxCaching, fastEditing, pickCulling, renderCaching, renderCulling, renderUnitId
boundingBoxIgnoring
VERBOSE_LEVEL, ZeroHandle
Constructor and Description |
---|
SoVertexAttribFeedback()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
int |
getGeneratedPrimitivesCount()
This function returns the number of generated primitives during the traversal of the sub scene graph.
|
static boolean |
isSupported(SoState state)
This function indicates if the vertex attributes feedback feature is available on this system.
|
void |
registerFeedback(java.lang.String varyingName,
SoBufferObject bufferObject)
Calls registerFeedback(varyingName, bufferObject, (int)-1).
|
void |
registerFeedback(java.lang.String varyingName,
SoBufferObject bufferObject,
int primitiveSize)
This function allows to attach a buffer object to a specific varying of the shader pushed on the state.
|
void |
unregisterFeedback(java.lang.String varyingName)
This function is used to unregister a varying registered with the registerFeedback function.
|
addChild, findChild, getChild, getNumChildren, insertChild, removeAllChildren, removeChild, removeChild, replaceChild, replaceChild
affectsState, callback, copy, copy, distribute, doAction, getAlternateRep, getBoundingBox, getByName, getMatrix, getPrimitiveCount, getRenderEngineMode, getRenderUnitID, GLRender, GLRenderBelowPath, GLRenderInPath, GLRenderOffPath, grabEventsCleanup, grabEventsSetup, handleEvent, isBoundingBoxIgnoring, isOverride, pick, rayPick, search, setOverride, touch, write
copyFieldValues, copyFieldValues, enableNotify, fieldsAreEqual, get, getAllFields, getEventIn, getEventOut, getField, getFieldName, hasDefaultValues, isNotifyEnabled, set, setToDefaults
dispose, getName, isDisposable, isSynchronizable, setName, setSynchronizable
getNativeResourceHandle
public final SoSFBool disableFragmentProcessing
Most of the time the main goal of this node is to record the result of varyings from the geometry shaders and the recorded primitives are not supposed to be rendered.
Default value is true.
public final SoSFBool autoResizeBuffers
This is implemented by performing a first traversal of the children with OpenGL queries enabled to record the number of generated primitives during this traversal. Then the value of the query is used to compute the size in bytes of the buffer object and a second traversal is performed for the actual primitives recording.
Default value is false.
public final SoSFBool queryGeneratedPrimitivesCount
Default value is false.
public final SoSFEnum<SoVertexAttribFeedback.BufferModes> buffersMode
public final SoSFEnum<SoVertexAttribFeedback.PrimitiveTypes> primitiveType
PrimitiveType
. Default is TRIANGLES.public void registerFeedback(java.lang.String varyingName, SoBufferObject bufferObject)
public void registerFeedback(java.lang.String varyingName, SoBufferObject bufferObject, int primitiveSize)
The primitiveSize parameter is used to compute the actual size of buffer objects when autoResizeBuffers is set to true, it is ignored otherwise; It must be the size of each primitive, in bytes. When the buffer mode is set to INTERLEAVED the value must be the accumulated size in bytes for all the varyings. The actual buffer size is computed by multiplying the primitiveSize by the number of primitives and by the size of the data type (float). When the value is -1 (the default value) Open Inventor uses 3 * sizeof(float) * numVerticesPerPrimtive, which is the size of a basic triangle with 3 vertices of 3 float-components, for a triangle the computed value is 3 * sizeof(float) * 3.
NOTE: When the buffer mode is set to INTERLEAVED only the first specified buffer object is used the following ones are ignored.
varyingName
- The name of the varying which must will be added to the list of recorded varyings.
bufferObject
- The buffer object which will receive the recorded values from the varying.
primitiveSize
- The size, in bytes, of one primitive, used when the autoResizeBuffers field is set to true.public void unregisterFeedback(java.lang.String varyingName)
varyingName
- The name of the varying to unregister, previously registered using the registerFeeback function.public static boolean isSupported(SoState state)
SoGLExtension
for an example of using SoGLContext
to avoid them.
public int getGeneratedPrimitivesCount()
Generated on July 31, 2019, Copyright © Thermo Fisher Scientific. All rights reserved. http://www.openinventor.com