13#ifndef SO_GLSHADER_PROGRAM_H
14#define SO_GLSHADER_PROGRAM_H
19#include "SoShaderSystem.h"
22#include <Inventor/SbString.h>
65 if (_geometryInputType != type) { _geometryInputType = type; scheduleLinking(); }
68 if (_geometryOutputType != type) { _geometryOutputType = type; scheduleLinking(); }
71 if (_geometryVerticesOut !=
number) { _geometryVerticesOut =
number; scheduleLinking(); }
99 void set1fv(
const SbString &name,
const int num,
const float *value)
override;
134 return _programRes.getHandle();
141 return _isExecutable;
Vertex or fragment shader object class.
Class managing an OpenGL shader program.
void setMatrix3fv(const SbString &, int, const float *, SbBool=FALSE) override
void removeShaderObject(SoGLShaderObject *shaderObject)
SbBool isExecutable() const
bool alwaysReadErrorLog()
void set2i(const SbString &name, const SbVec2s &value) override
void set4fv(const SbString &name, const int num, const float *value) override
int shaderVersion(SoShader::ShaderType type) const
Get the used GLSL version for the given shader type.
void set1fv(const SbString &name, const int num, const float *value) override
void setGeometryInputType(GLint type)
int _assignedTextureUnits
int getNumAssignedTextureUnits()
virtual void clearAssignedTextureUnits()
Clears the assigned texture units to 0.
bool isValid()
returns if the shader is valid or needs re-creation
const SbString & getName() const
void reset() override
Free all resources (OpenGL too) and reset instance to initial state.
void set4i(const SbString &name, const int32_t *value) override
int addTextureSampler(const SbString &name) override
Adds a new texture sampler with given name and returns the assigned texture unit.
void setGeometryOutputType(GLint type)
void set4f(const SbString &name, const float *value) override
virtual SbBool isActiveUniform(const SbString &name)
ml::GLSLProgram & getProgramResource()
void setMatrix4fv(const SbString &, int, const float *, SbBool=FALSE) override
void set2i(const SbString &name, const int32_t *value) override
void set3f(const SbString &name, const float *value) override
GLuint getProgramHandle() const
virtual void postLinkSetup()
void set3i(const SbString &name, const SbVec3s &value) override
void set3fv(const SbString &name, const int num, const float *value) override
void set4f(const SbString &name, const float value0, const float value1, const float value2, const float value3) override
void removeAllShaderObjects()
GLint _geometryVerticesOut
void set1f(const SbString &name, const float value) override
virtual void updateUniformsFromState(SoState *)
Update the shader uniforms according to the current Inventor state.
void set2f(const SbString &name, const float value0, const float value1) override
ml::GLSLProgram _programRes
void setNumAssignedTextureUnits(int num)
const SbString & getErrorLog()
GLint getUniform(const SbString &name, GLenum type, int *num=nullptr)
SbBool shouldLink() const
void setAlwaysReadErrorLog(bool flag)
void set2fv(const SbString &name, const int num, const float *value) override
std::list< SoGLShaderObject * > _shaderObjects
void setName(const SbString &name)
~SoGLShaderProgram() override
Destructor.
void set1i(const SbString &name, const int32_t value) override
std::map< std::string, UniformInfo > _uniformInfo
void set2f(const SbString &name, const float *value) override
GLint _geometryOutputType
void addShaderObject(SoGLShaderObject *shaderObject)
void set3i(const SbString &name, const int32_t *value) override
void updateUniformInfo(GLint programHandle)
SoGLShaderProgram()
Constructor.
virtual void preLinkSetup()
void setGeometryVerticesOut(GLint number)
void set3f(const SbString &name, const float value0, const float value1, const float value2) override
Abstract base class for shader objects.
Target mlrange_cast(Source arg)
Generic version of checked ML casts.