SoShaderProgram

InventorModule

genre

Shader

author

MeVis Medical Solutions AG

package

MeVisLab/Standard

dll

SoShader

definition

SoShader.def

keywords

vertex, fragment, geometry

Purpose

The module SoShaderProgram links all vertex, geometry, and fragment shaders encountered so far. It determines all active uniform parameters and uses the shader parameter modules to update the uniforms before the OpenGL shading language program is run. It allows for setting up the geometry shader state for the shader program.

Details

Provides the following additional uniform parameters:

  • vec4 oiv_ViewPosition - the first three components specify the viewpoint position, the fourth component is 0 for orthographic projection or 1 for perspective projection

  • ivec2 oiv_ViewportSize - contains the current viewport size as determined by the Open Inventor state

  • float oiv_DevicePixelRatio - contains the ratio between physical pixels and device-independent pixels of the connected viewer (e.g., 2.0 for Apple Retina Display)

  • ivec2 oiv_NearDistance - contains the current near clipping plane distance determined by the Open Inventor state

  • ivec2 oiv_FarDistance - contains the current far clipping plane distance determined by the Open Inventor state

  • vec4 oiv_DiffuseColor - contains the current diffuse color and alpha value (1-transparency)

  • int oiv_NumEnabledLights - provides the number of currently active OpenGL lights

  • sampler2D oiv_Texture0 - provides the texture sampler for the current Open Inventor texture (which is set via SoTexture2 or SoMLTexture2).

Output Fields

self

name: self, type: SoNode

Parameter Fields

Field Index

Geometry Input Type: Enum

Geometry Output Type: Enum

Max Emitted Geometry Vertices: Integer

parameter: String

shaderObject: String

Visible Fields

Geometry Input Type

name: geometryInputType, type: Enum, default: TRIANGLES_INPUT

Defines the input type that the geometry shader expects.

Note that for LINES_ADJACENCY_INPUT and TRIANGLES_ADJACENCY_INPUT modes the OpenGL rendering needs to send adjacency information. This can be done using the sendAdjacency, which is available in SoIndexedFaceSet, SoIndexedLineSet, and SoIndexedTriangleSet.

Values:

Title

Name

​Points Input

​POINTS_INPUT

​Lines Input

​LINES_INPUT

​Triangles Input

​TRIANGLES_INPUT

​Lines Adjacency Input

​LINES_ADJACENCY_INPUT

​Triangles Adjacency Input

​TRIANGLES_ADJACENCY_INPUT

Geometry Output Type

name: geometryOutputType, type: Enum, default: TRIANGLE_STRIP_OUTPUT

Defines the type of the primitives that the geometry shader emits.

Values:

Title

Name

​Points Output

​POINTS_OUTPUT

​Line Strip Output

​LINE_STRIP_OUTPUT

​Triangle Strip Output

​TRIANGLE_STRIP_OUTPUT

Max Emitted Geometry Vertices

name: maxEmittedGeometryVertices, type: Integer, default: 8

Sets the maximum number of vertices that the geometry shader is allowed to emit.

Hidden Fields

shaderObject

name: shaderObject, type: String, default: [  ]

parameter

name: parameter, type: String, default: [  ]