13#ifndef SO_SHADER_PROGRAM_H
14#define SO_SHADER_PROGRAM_H
23#include <Inventor/fields/SoSFEnum.h>
24#include <Inventor/fields/SoSFInt32.h>
25#include <Inventor/nodes/SoSubNode.h>
26#include <Inventor/SbPList.h>
31class SoGLRenderAction;
54 ClipPlaneBindingPoint,
57 GLint _modelViewProjLoc;
60 GLint _modelNormalMatrixLoc;
63 GLint _modelViewNormalMatrixLoc;
65 GLint _projInverseLoc;
66 GLint _modelInverseLoc;
67 GLint _viewInverseLoc;
68 GLint _modelViewInverseLoc;
69 GLint _modelViewProjInverseLoc;
71 GLint _lightModelAmbientLoc;
73 unsigned int _lastProjMatrixId;
74 unsigned int _lastModelViewMatrixId;
76 GLint _lightBlockIndex;
77 GLint _clipPlaneBlockIndex;
78 GLint _materialBlockIndex;
80 struct UniformBuffer {
82 void prepare(
size_t size,
int bindingPoint);
83 void upload(
unsigned int dataId,
void* data);
90 static UniformBuffer* _clipPlaneBuffer;
91 static UniformBuffer* _materialBuffer;
92 static UniformBuffer* _lightBuffer;
94 static void calculateInverseTransposed3x3(
float* in,
float* out);
100 typedef SoNode inherited;
111 TRIANGLES_ADJACENCY_INPUT
116 TRIANGLE_STRIP_OUTPUT
178 SbPList _prevGraphShaders;
179 SbPList _prevFieldShaders;
186 void shaderObjectChanged(SoField* field =
nullptr);
187 void geometryInputTypeChanged(SoField* field =
nullptr);
188 void geometryOutputTypeChanged(SoField* field =
nullptr);
189 void maxEmittedGeometryVerticesChanged(SoField* field =
nullptr);
#define INVENTOR_SHADER_API
Define class export specifier.
Derived class which supports OpenGL legacy emulation and updating of uniforms when rendering Inventor...
SoGLInventorShaderProgram()
void postLinkSetup() override
Store information about uniforms locations.
void preLinkSetup() override
Bind locations before linking the shader program.
void updateUniformsFromState(SoState *) override
Update the shader uniforms according to the current Inventor state.
Class managing an OpenGL shader program.
Open Inventor multiple field managing a list of shader objects.
Abstract Open Inventor node for vertex or fragment shader nodes.
Open Inventor shader program node.
SoSFEnum geometryInputType
Kind of primitives the geometry shader will accept as input.
SoGLInventorShaderProgram * _glShaderProgram
void adaptShadersList(SbPList &prevShaders, const SbPList &nextShaders)
SoSFInt32 maxEmittedGeometryVertices
Maximum number of points the geometry shader will emit.
SoGLShaderProgram * getGLShaderProgram()
SbPList _usedShaderParameters
Shader parameters known via element.
SoSFEnum geometryOutputType
Kind of primitives the geometry shader will output.
~SoShaderProgram() override
Destructor.
void updateOIVStateDependentParameters(SoState *state)
Assigns Open Inventor state to some predefined uniform parameters.
static void initClass()
Initialize class with runtime type system.
void scheduleShaderObjectRebuild()
SoMFUniformShaderParameter parameter
Collects all shader parameters.
SoMFShaderObject shaderObject
Collects all vertex and fragment shaders.
SoShaderProgram()
Constructor.
SbBool isValidShaderObjects() const
Returns 'TRUE' if all shader objects are valid.
void adaptParametersList(const SbPList &nextParameters)
void GLRender(SoGLRenderAction *action) override
Implements rendering.
void setup()
Initial setup of shader program.
VertexBuffer resource (vertex_buffer_object extension) http://www.opengl.org/registry/specs/ARB/verte...