Coin Logo Coin3D is Free Software,
published under the BSD 3-clause license.
https://coin3d.github.io
https://www.kongsberg.com/en/kogt/
SoShaderGenerator Class Reference

The SoShaderGenerator class is used for simplifying the process of generating shader scripts. More...

#include </misc/SoShaderGenerator.h>

Public Member Functions

 SoShaderGenerator (void)
 
 ~SoShaderGenerator ()
 
void reset (const SbBool freeoldstrings)
 
void setVersion (const SbString &str)
 
void addDefine (const SbString &str, const SbBool checkexists)
 
void addDeclaration (const SbString &str, const SbBool checkexists)
 
void addFunction (const SbString &str, const SbBool checkexists)
 
void addNamedFunction (const SbName &name, const SbBool checkexists)
 
void addMainStatement (const SbString &str)
 
const SbStringgetShaderProgram (void)
 

Detailed Description

The SoShaderGenerator class is used for simplifying the process of generating shader scripts.

Currently only GLSL scripts are supported.

Constructor & Destructor Documentation

◆ SoShaderGenerator()

SoShaderGenerator::SoShaderGenerator ( void )

Constructor.

◆ ~SoShaderGenerator()

SoShaderGenerator::~SoShaderGenerator ( )

Destructor.

Member Function Documentation

◆ addDefine()

void SoShaderGenerator::addDefine ( const SbString & str,
const SbBool checkexists )

Adds a define to the shader program.

◆ addDeclaration()

void SoShaderGenerator::addDeclaration ( const SbString & str,
const SbBool checkexists )

Adds a declaration (varying or uniform) to the script.

◆ addFunction()

void SoShaderGenerator::addFunction ( const SbString & str,
const SbBool checkexists )

Adds a function to the script.

◆ addNamedFunction()

void SoShaderGenerator::addNamedFunction ( const SbName & name,
const SbBool checkexists )

Adds a named function to the script.

◆ addMainStatement()

void SoShaderGenerator::addMainStatement ( const SbString & str)

Add a statement to the main function.

◆ getShaderProgram()

const SbString & SoShaderGenerator::getShaderProgram ( void )

Returns the complete shader program.


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