Go to the documentation of this file.
5 #ifndef CNOID_BASE_SHADER_PROGRAMS_H
6 #define CNOID_BASE_SHADER_PROGRAMS_H
9 #include <cnoid/EigenTypes>
10 #include <initializer_list>
11 #include "exportdecl.h"
29 virtual void initialize();
30 virtual void release();
31 virtual void activate();
32 virtual void deactivate();
34 bool isActive()
const;
45 virtual void setMaterial(
const SgMaterial* material);
46 virtual void setVertexColorEnabled(
bool on);
55 bool hasCapability(
int capability)
const {
return capabilities_ & capability; }
84 virtual void initialize()
override;
104 virtual void initialize()
override;
105 virtual void activate()
override;
106 virtual void setColor(
const Vector3f& color);
107 virtual void setMaterial(
const SgMaterial* material)
override;
108 virtual void setPointSize(
float s);
110 void setColorChangable(
bool on);
111 bool isColorChangable()
const;
112 void resetColor(
const Vector3f& color);
131 virtual void initialize()
override;
132 virtual void activate()
override;
133 virtual void setColor(
const Vector3f& color)
override;
134 virtual void setMaterial(
const SgMaterial* material)
override;
135 virtual void setVertexColorEnabled(
bool on)
override;
154 virtual void initialize()
override;
155 virtual void activate()
override;
157 void setViewportSize(
int width,
int height);
158 void setLineWidth(
float width);
174 virtual void initialize()
override;
175 virtual void activate()
override;
176 virtual void deactivate()
override;
179 void setProjectionMatrix(
const Matrix4& P);
180 void setViewportSize(
int width,
int height);
197 virtual void initialize()
override;
199 void setLineWidth(
float width);
202 GLint normalMatrixLocation;
212 virtual int maxNumLights()
const = 0;
213 virtual bool setLight(
215 virtual void setNumLights(
int n) = 0;
216 virtual void setFog(
const SgFog* fog);
231 virtual void initialize()
override;
232 virtual void activate()
override;
234 virtual int maxNumLights()
const override;
235 virtual bool setLight(
237 virtual void setNumLights(
int n)
override;
238 virtual void setMaterial(
const SgMaterial* material)
override;
251 virtual void initialize()
override;
252 virtual int maxNumLights()
const override;
253 virtual bool setLight(
255 virtual void setNumLights(
int n)
override;
256 virtual void setFog(
const SgFog* fog)
override;
308 virtual void release()
override;
bool hasCapability(int capability) const
Definition: ShaderPrograms.h:55
Definition: ShaderPrograms.h:338
virtual void activate() override
Definition: ShaderPrograms.cpp:1295
void setCapability(int capability)
Definition: ShaderPrograms.h:66
Definition: ShaderPrograms.h:294
Definition: ShaderPrograms.h:246
Eigen::Isometry3d Isometry3
Definition: EigenTypes.h:73
void setShadowAntiAliasingEnabled(bool on)
Definition: ShaderPrograms.cpp:1503
bool isShadowAntiAliasingEnabled() const
Definition: ShaderPrograms.cpp:1509
Definition: SceneCameras.h:14
virtual void release() override
Definition: ShaderPrograms.cpp:1282
virtual void setTransform(const Matrix4 &PV, const Isometry3 &V, const Affine3 &M, const Matrix4 *L) override
Definition: ShaderPrograms.cpp:1334
void setViewportSize(int width, int height)
Definition: ShaderPrograms.cpp:1418
void setColorTextureIndex(int textureIndex)
Definition: ShaderPrograms.cpp:979
int capabilities() const
Definition: ShaderPrograms.h:54
virtual void setMaterial(const SgMaterial *material) override
Definition: ShaderPrograms.cpp:1033
Definition: SceneLights.h:14
Definition: ShaderPrograms.h:146
virtual void setVertexColorEnabled(bool on) override
Definition: ShaderPrograms.cpp:1091
Definition: ShaderPrograms.h:191
void setMinimumTransparency(float t)
Definition: ShaderPrograms.cpp:1109
void initializeShadowMapBuffer()
Definition: ShaderPrograms.cpp:1528
virtual bool setLight(int index, const SgLight *light, const Isometry3 &T, const Isometry3 &view, bool shadowCasting) override
Definition: ShaderPrograms.cpp:1317
void activateMainRenderingPass()
Definition: ShaderPrograms.cpp:1436
SgCamera * getShadowMapCamera(SgLight *light, Isometry3 &io_T)
Definition: ShaderPrograms.cpp:1472
virtual void initialize() override
Definition: ShaderPrograms.cpp:991
Definition: ShaderPrograms.h:268
Eigen::Matrix4d Matrix4
Definition: EigenTypes.h:58
void setShadowMapViewProjection(const Matrix4 &PV)
Definition: ShaderPrograms.cpp:1497
Definition: ShaderPrograms.h:96
int shaderType
Definition: ShaderPrograms.h:62
void setNumShadows(int n)
Definition: ShaderPrograms.cpp:1453
GLSLProgram & glslProgram()
Definition: ShaderPrograms.h:28
Definition: SceneEffects.h:69
Definition: ShaderPrograms.h:60
Definition: AbstractSceneLoader.h:11
virtual void activate() override
Definition: ShaderPrograms.cpp:1546
void setTextureEnabled(bool on)
Definition: ShaderPrograms.cpp:1100
Definition: ShaderPrograms.h:166
Definition: ShaderPrograms.h:123
GLuint defaultFramebufferObject() const
Definition: ShaderPrograms.cpp:1174
void disableWireframe()
Definition: ShaderPrograms.cpp:1378
~MaterialLightingProgram()
Definition: ShaderPrograms.cpp:973
int colorTextureIndex() const
Definition: ShaderPrograms.cpp:985
virtual void initialize() override
Definition: ShaderPrograms.cpp:1522
ShadowMapProgram * shadowMapProgram()
Definition: ShaderPrograms.cpp:1459
const char * filename
Definition: ShaderPrograms.h:61
virtual void initialize() override
Definition: ShaderPrograms.cpp:1186
FullLightingProgram()
Definition: ShaderPrograms.cpp:1115
virtual void activate() override
Definition: ShaderPrograms.cpp:1026
bool isWireframeEnabled() const
Definition: ShaderPrograms.cpp:1389
Definition: GLSLProgram.h:17
virtual void deactivate() override
Definition: ShaderPrograms.cpp:1555
void enableWireframe(const Vector4f &color, float width)
Definition: ShaderPrograms.cpp:1365
void activateShadowMapGenerationPass(int shadowIndex)
Definition: ShaderPrograms.cpp:1426
Definition: ShaderPrograms.h:77
Capability
Definition: ShaderPrograms.h:48
Definition: ShaderPrograms.h:206
void setShadowMapTextureTopIndex(int textureIndex)
Definition: ShaderPrograms.cpp:1180
Definition: SceneDrawables.h:18
Eigen::Affine3d Affine3
Definition: EigenTypes.h:62
void getShadowMapSize(int &width, int &height) const
Definition: ShaderPrograms.cpp:1465
~FullLightingProgram()
Definition: ShaderPrograms.cpp:1162
Definition: ShaderPrograms.h:21
void setDefaultFramebufferObject(GLuint id)
Definition: ShaderPrograms.cpp:1168
int maxNumShadows() const
Definition: ShaderPrograms.cpp:1447
Definition: ShaderPrograms.h:223