13 #ifndef SO_SHADER_OBJECT_H
14 #define SO_SHADER_OBJECT_H
21 #include <Inventor/nodes/SoSubNode.h>
22 #include <Inventor/fields/SoSFBool.h>
23 #include <Inventor/fields/SoSFEnum.h>
24 #include <Inventor/fields/SoSFString.h>
32 typedef SoNode inherited;
63 void GLRender(SoGLRenderAction *action)
override;
72 return _glShaderObject;
85 return _sourceProgram;
92 return _containsMainFunction;
100 return _snippetFunctionName;
104 return _snippetInsertionLocation;
108 return _snippetUniformList;
132 void isActiveSensorCB(SoField* field);
133 void emulateLegacySensorCB(SoField* field);
134 void sourceSensorCB(SoField* field);
136 void parseSource(
const SbString &srcCode);
139 SbBool _containsMainFunction;
142 SbString _snippetFunctionName;
#define INVENTOR_SHADER_API
Define class export specifier.
Vertex or fragment shader object class.
Abstract Open Inventor node for vertex or fragment shader nodes.
SoSFBool isActive
Enable / disable shader object.
SoGLShaderObject * _glShaderObject
void scheduleRebuild()
Schedule rebuild of underlying OpenGL shader (e.g. due to GL context switch)
SoSFBool emulateLegacyOpenGL
If enabled, legacy OpenGL state is emulated for shaders >= version 140.
const SbString & getSourceProgram() const
Returns shader object's source program.
virtual SoShader::ShaderType shaderType() const =0
Returns type of shader.
SbBool hasSourceModifications() const
SoSFString sourceProgram
Contains the shader object's source or the filename of the source file.
void GLRender(SoGLRenderAction *action) override
Add this node to element in state.
SoShaderObject()
Constructor.
~SoShaderObject() override
Destructor.
SourceType getSourceType() const
Returns shader object's source type.
SnippetInsertionLocation getSnippetInsertionLocation() const
SoSFEnum sourceType
Specify shader object's source type.
static void initClass()
Initialize class with runtime type system.
SoGLShaderObject * getGLShaderObject()
Returns shader object.
const SbList< SbString > & getSnippetUniformList() const
SbString getSnippetFunctionName() const
SourceType
Shader object's source type.
@ GLSL_PROGRAM
OpenGL Shading Language program.
SbBool containsMainFunction() const