Choreonoid  1.8
Classes | Public Types | Public Member Functions | Protected Member Functions | List of all members
cnoid::ShaderProgram Class Reference

#include <ShaderPrograms.h>

Inheritance diagram for cnoid::ShaderProgram:
cnoid::LightingProgram cnoid::NolightingProgram cnoid::BasicLightingProgram cnoid::MinimumLightingProgram cnoid::ShadowMapProgram cnoid::SolidColorProgram cnoid::MaterialLightingProgram cnoid::OutlineProgram cnoid::SolidColorExProgram cnoid::SolidPointProgram cnoid::FullLightingProgram cnoid::ThickLineProgram

Classes

struct  ShaderSource
 

Public Types

enum  Capability { NoCapability = 0, Lighting = 1, Transparency = 2 }
 

Public Member Functions

virtual ~ShaderProgram ()
 
GLSLProgramglslProgram ()
 
virtual void initialize ()
 
virtual void release ()
 
virtual void activate ()
 
virtual void deactivate ()
 
bool isActive () const
 
virtual void setTransform (const Matrix4 &PV, const Isometry3 &V, const Affine3 &M, const Matrix4 *L=nullptr)
 
virtual void setMaterial (const SgMaterial *material)
 
virtual void setVertexColorEnabled (bool on)
 
int capabilities () const
 
bool hasCapability (int capability) const
 

Protected Member Functions

 ShaderProgram ()=default
 
 ShaderProgram (std::initializer_list< ShaderSource > sources)
 
void setCapability (int capability)
 

Member Enumeration Documentation

◆ Capability

Enumerator
NoCapability 
Lighting 
Transparency 

Constructor & Destructor Documentation

◆ ~ShaderProgram()

ShaderProgram::~ShaderProgram ( )
virtual

◆ ShaderProgram() [1/2]

cnoid::ShaderProgram::ShaderProgram ( )
protecteddefault

◆ ShaderProgram() [2/2]

ShaderProgram::ShaderProgram ( std::initializer_list< ShaderSource sources)
protected

Member Function Documentation

◆ activate()

void ShaderProgram::activate ( )
virtual

◆ capabilities()

int cnoid::ShaderProgram::capabilities ( ) const
inline

◆ deactivate()

void ShaderProgram::deactivate ( )
virtual

◆ glslProgram()

GLSLProgram& cnoid::ShaderProgram::glslProgram ( )
inline

◆ hasCapability()

bool cnoid::ShaderProgram::hasCapability ( int  capability) const
inline

◆ initialize()

void ShaderProgram::initialize ( )
virtual

◆ isActive()

bool ShaderProgram::isActive ( ) const

◆ release()

void ShaderProgram::release ( )
virtual

Reimplemented in cnoid::FullLightingProgram.

◆ setCapability()

void cnoid::ShaderProgram::setCapability ( int  capability)
inlineprotected

◆ setMaterial()

void ShaderProgram::setMaterial ( const SgMaterial material)
virtual

◆ setTransform()

void ShaderProgram::setTransform ( const Matrix4 PV,
const Isometry3 V,
const Affine3 M,
const Matrix4 L = nullptr 
)
virtual
Parameters
PVProduct of the project matrix and view matrix
VThe transform corresponding to the view matrix
MThe transform corresponding to the model matrix
LThe transform corresponding to the local vertex transform matrix
Note
L is used when the vertex positions are expressed as normalized ([-1.0, 1.0]) integer value

Reimplemented in cnoid::FullLightingProgram, cnoid::MinimumLightingProgram, cnoid::OutlineProgram, cnoid::SolidPointProgram, and cnoid::NolightingProgram.

◆ setVertexColorEnabled()

void ShaderProgram::setVertexColorEnabled ( bool  on)
virtual

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