SoGVRShaderDiagnosis

InventorModule
author MeVis Medical Solutions AG
package MeVisLab/Standard
dll SoGVR
definition soGVR.def

Purpose

The SoGVRShaderDiagnosis module allows to inspect the GLSL shaders and their warning/error logs. It also provides views of the actually used uniforms and their values. When the GVR shader pipeline is used (which is the default), it also list all available uniforms and varyings. It can be used for debugging purposes or to see how a GVR feature is implemented internally. When developing custom SoGVRShaderFunction, it is a good debug information source.

Tips

The module should not be used in production networks, since it will cause overhead and it will update its string fields, causing a repaint.

Windows

Default Panel

../../../Modules/Inventor/SoGVR/mhelp/Images/Screenshots/SoGVRShaderDiagnosis._default.png

Fragment Shader

Shows the GLSL code of the current fragment shader. Enabling the “Enable Debug Shader” checkbox will replace the current shader with an editable debug shader. This is a nice feature to quickly test a shader modification. The text edit supports GLSL keyword/function completion and the completion of available uniforms/varyings and shader pipeline state members. Pressing “Copy as Debug Shader” copies the current shader to the debug shader.

If the current shader contains warnings/errors, the shader log is shown below the shader code.

Vertex Shader

Same as fragment shader, but shows the vertex shader.

Geometry Shader

Same as fragment shader, but shows the geometry shader and does not support a debug shader.

Program Info

Shows the link information of the GLSL program and additional warnings/errors given by the driver or the shader pipeline.

Active Uniforms

Shows all active uniforms of the current shader. This includes both builtin GL uniforms, GVR uniforms and external uniforms provided by SoShaderParameter3f etc. This list shows quite well how the driver optimizes the shaders, as unused texture samplers and uniforms will disappear in this list.

Enabling “Fetch active uniform values” shows the values that the uniforms currently have. NOTE: enabling this will cause the fields to change on each rendering, so the FPS of the rendering will drop substantially, only use this for debugging!

Available Uniforms

This lists all uniforms that are available in the current render mode and may be used in the SoGVRShaderFunction.

Available Includes

This lists all includes that the GVR shader pipeline provides and the user provided SoGVRShaderInclude modules.

Output Fields

self

name: self, type: SoNode

a node that should be put in front of the SoGVRVolumeRenderer. The module will update its content when the scene is rendered in a viewer.

Parameter Fields

Visible Fields

Enabled

name: enabled, type: Bool, default: TRUE

Enables the diagnosis.

Available State Members

name: availableStateMembers, type: String, persistent: no

Hidden Fields

fragmentShaderError

name: fragmentShaderError, type: Bool, persistent: no

vertexShaderError

name: vertexShaderError, type: Bool, persistent: no

geometryShaderError

name: geometryShaderError, type: Bool, persistent: no

programLinkError

name: programLinkError, type: Bool, persistent: no

userFragmentShader

name: userFragmentShader, type: String

userVertexShader

name: userVertexShader, type: String

availableUniformNames

name: availableUniformNames, type: String, persistent: no

availableVaryingNames

name: availableVaryingNames, type: String, persistent: no

availableIncludeNames

name: availableIncludeNames, type: String, persistent: no

availableVertexShaderStateMembers

name: availableVertexShaderStateMembers, type: String, persistent: no

availableFragmentShaderStateMembers

name: availableFragmentShaderStateMembers, type: String, persistent: no

availableUniformSizes

name: availableUniformSizes, type: String, persistent: no

availableUniformTypes

name: availableUniformTypes, type: String, persistent: no

availableVaryingTypes

name: availableVaryingTypes, type: String, persistent: no

availableVertexShaderStateMemberTypes

name: availableVertexShaderStateMemberTypes, type: String, persistent: no

availableFragmentShaderStateMemberTypes

name: availableFragmentShaderStateMemberTypes, type: String, persistent: no

availableIncludes

name: availableIncludes, type: String, persistent: no

availableFragmentShaderSteps

name: availableFragmentShaderSteps, type: String, persistent: no

availableVertexShaderSteps

name: availableVertexShaderSteps, type: String, persistent: no