MeVisLab Resolution Independence API
SoShaderObject Class Referenceabstract

Abstract Open Inventor node for vertex or fragment shader nodes. More...

#include <SoShaderObject.h>

Inheritance diagram for SoShaderObject:
SoFragmentShader SoGeometryShader SoVertexShader

Public Types

enum  SourceType { GLSL_PROGRAM , FILENAME }
 Shader object's source type. More...
 
enum  SnippetInsertionLocation { AT_BEGIN , AT_END }
 

Public Member Functions

void GLRender (SoGLRenderAction *action) override
 Add this node to element in state.
 
SoGLShaderObjectgetGLShaderObject ()
 Returns shader object.
 
virtual SoShader::ShaderType shaderType () const =0
 Returns type of shader.
 
SourceType getSourceType () const
 Returns shader object's source type.
 
const SbString & getSourceProgram () const
 Returns shader object's source program.
 
void scheduleRebuild ()
 Schedule rebuild of underlying OpenGL shader (e.g. due to GL context switch)
 
SbBool containsMainFunction () const
 
SbBool isSnippet () const
 
SbString getSnippetFunctionName () const
 
SnippetInsertionLocation getSnippetInsertionLocation () const
 
const SbList< SbString > & getSnippetUniformList () const
 
SbBool hasSourceModifications () const
 

Static Public Member Functions

static void initClass ()
 Initialize class with runtime type system.
 

Public Attributes

SoSFBool isActive
 Enable / disable shader object.
 
SoSFEnum sourceType
 Specify shader object's source type.
 
SoSFString sourceProgram
 Contains the shader object's source or the filename of the source file.
 
SoSFBool emulateLegacyOpenGL
 If enabled, legacy OpenGL state is emulated for shaders >= version 140.
 

Protected Member Functions

void checkType ()
 
void readSource ()
 
 SoShaderObject ()
 Constructor.
 
 ~SoShaderObject () override
 Destructor.
 

Protected Attributes

SoGLShaderObject_glShaderObject
 
SourceType _sourceType
 
SbString _sourceProgram
 

Detailed Description

Abstract Open Inventor node for vertex or fragment shader nodes.

Definition at line 30 of file SoShaderObject.h.

Member Enumeration Documentation

◆ SnippetInsertionLocation

Enumerator
AT_BEGIN 
AT_END 

Definition at line 43 of file SoShaderObject.h.

◆ SourceType

Shader object's source type.

Enumerator
GLSL_PROGRAM 

OpenGL Shading Language program.

FILENAME 

Filename of source file.

Definition at line 39 of file SoShaderObject.h.

Constructor & Destructor Documentation

◆ SoShaderObject()

SoShaderObject::SoShaderObject ( )
protected

Constructor.

◆ ~SoShaderObject()

SoShaderObject::~SoShaderObject ( )
overrideprotected

Destructor.

Member Function Documentation

◆ checkType()

void SoShaderObject::checkType ( )
protected

◆ containsMainFunction()

SbBool SoShaderObject::containsMainFunction ( ) const
inline

Definition at line 91 of file SoShaderObject.h.

◆ getGLShaderObject()

SoGLShaderObject * SoShaderObject::getGLShaderObject ( )
inline

Returns shader object.

Definition at line 71 of file SoShaderObject.h.

◆ getSnippetFunctionName()

SbString SoShaderObject::getSnippetFunctionName ( ) const
inline

Definition at line 99 of file SoShaderObject.h.

◆ getSnippetInsertionLocation()

SnippetInsertionLocation SoShaderObject::getSnippetInsertionLocation ( ) const
inline

Definition at line 103 of file SoShaderObject.h.

◆ getSnippetUniformList()

const SbList< SbString > & SoShaderObject::getSnippetUniformList ( ) const
inline

Definition at line 107 of file SoShaderObject.h.

◆ getSourceProgram()

const SbString & SoShaderObject::getSourceProgram ( ) const
inline

Returns shader object's source program.

Definition at line 84 of file SoShaderObject.h.

◆ getSourceType()

SourceType SoShaderObject::getSourceType ( ) const
inline

Returns shader object's source type.

Definition at line 79 of file SoShaderObject.h.

◆ GLRender()

void SoShaderObject::GLRender ( SoGLRenderAction * action)
override

Add this node to element in state.

◆ hasSourceModifications()

SbBool SoShaderObject::hasSourceModifications ( ) const

◆ initClass()

static void SoShaderObject::initClass ( )
static

Initialize class with runtime type system.

◆ isSnippet()

SbBool SoShaderObject::isSnippet ( ) const
inline

Definition at line 95 of file SoShaderObject.h.

◆ readSource()

void SoShaderObject::readSource ( )
protected

◆ scheduleRebuild()

void SoShaderObject::scheduleRebuild ( )

Schedule rebuild of underlying OpenGL shader (e.g. due to GL context switch)

◆ shaderType()

virtual SoShader::ShaderType SoShaderObject::shaderType ( ) const
pure virtual

Returns type of shader.

Implemented in SoFragmentShader, SoGeometryShader, and SoVertexShader.

Member Data Documentation

◆ _glShaderObject

SoGLShaderObject* SoShaderObject::_glShaderObject
protected

Definition at line 119 of file SoShaderObject.h.

◆ _sourceProgram

SbString SoShaderObject::_sourceProgram
protected

Definition at line 122 of file SoShaderObject.h.

◆ _sourceType

SourceType SoShaderObject::_sourceType
protected

Definition at line 121 of file SoShaderObject.h.

◆ emulateLegacyOpenGL

SoSFBool SoShaderObject::emulateLegacyOpenGL

If enabled, legacy OpenGL state is emulated for shaders >= version 140.

Definition at line 58 of file SoShaderObject.h.

◆ isActive

SoSFBool SoShaderObject::isActive

Enable / disable shader object.

Definition at line 49 of file SoShaderObject.h.

◆ sourceProgram

SoSFString SoShaderObject::sourceProgram

Contains the shader object's source or the filename of the source file.

Definition at line 55 of file SoShaderObject.h.

◆ sourceType

SoSFEnum SoShaderObject::sourceType

Specify shader object's source type.

Definition at line 52 of file SoShaderObject.h.


The documentation for this class was generated from the following file: