|
Robotran C Documentation
|
Go to the documentation of this file.
7 #ifndef _OGL_SHAPE_RENDERER_HH_
8 #define _OGL_SHAPE_RENDERER_HH_
55 pos = glm::vec4(0.0f);
56 color = glm::vec3(0.0f);
86 virtual void Init(std::vector<glm::vec3> vertices,
87 std::vector<glm::vec3> colors,
88 std::vector<glm::vec3> normals,
89 std::vector<unsigned int> indexes);
95 glm::mat3 M_inv_trans,
98 glm::vec3
const& specular_mat,
180 void LightsInit(
float shiny_mat, glm::vec3
const& specular_mat,
float transparency);
184 std::string
StringLoc(
const char* fieldName,
size_t index);
185 std::string
StringLoc(
const char* fieldName,
const char* propertyName,
size_t index);
194 #endif //_OGL_SHAPE_RENDERER_HH_
GLuint VBO_indexes_id
VBO for indexes.
Definition: OglShapeRenderer.hh:155
std::string StringLoc(const char *fieldName, size_t index)
generate a string to get the location of a specific field (to communicate with fragment shader),...
Definition: OglShapeRenderer.cc:373
std::vector< ShaderLight > sh_lights
shaders for lights
Definition: OglShapeRenderer.hh:118
std::vector< GLuint > mvpDepthID
ID of the depth matrices MVP.
Definition: OglShapeRenderer.hh:169
OglShapeRenderer class is an implementation of MbsShapeRenderer that render a MbsShape3D using Open G...
Definition: OglShapeRenderer.hh:76
std::string depth_frag_sh
fragment depth shader path
Definition: OglShapeRenderer.hh:142
Definition: MpegFrameCaptureOptions.hh:6
Implementation of MbsWorldRenderer class that render a MbsWorld3D using Open GL.
Definition: OglWorldRenderer.hh:26
glm::mat4 biasMatrix
bias matrix
Definition: OglShapeRenderer.hh:136
virtual void Update(glm::mat4 model_mat, glm::mat4 MVP, glm::mat3 M_inv_trans, MbsWorld3D *world_3d, float shiny_mat, glm::vec3 const &specular_mat, float transparency)
Execute the necessary code to render this shape: Update the Ogl transform and add it to the pipeline.
Definition: OglShapeRenderer.cc:520
virtual ~OglShapeRenderer()
destructor of the OglShapeRenderer
Definition: OglShapeRenderer.cc:78
OglWorldRenderer * world_rend
reference to the world renderer that creat this shape renderer
Definition: OglShapeRenderer.hh:116
std::vector< int > depth_semi_x_width
X semi width of the shadow map depth textures (in pixels)
Definition: OglShapeRenderer.hh:174
void MVPDepth(int index)
update mvpDepth and depthBiasMVP (uniform matrices for shadow shaders)
Definition: OglShapeRenderer.cc:620
std::vector< glm::mat4 > mvpDepth
MVP depth matrix.
Definition: OglShapeRenderer.hh:138
GLuint MInvTransID
ID of transpose and inverse of the model matrix.
Definition: OglShapeRenderer.hh:134
std::vector< GLuint > frameBuffer
frame buffer
Definition: OglShapeRenderer.hh:171
std::vector< glm::mat4 > depthBiasMVP
depth bias
Definition: OglShapeRenderer.hh:139
GLuint transID
ID of the transparency.
Definition: OglShapeRenderer.hh:157
glm::vec3 attenuation
attenuation
Definition: OglShapeRenderer.hh:40
float coneCosAngle
cone opening angle
Definition: OglShapeRenderer.hh:44
virtual void Init(std::vector< glm::vec3 > vertices, std::vector< glm::vec3 > colors, std::vector< glm::vec3 > normals, std::vector< unsigned int > indexes)
Init the current shape renderer: create Ogl object necessary to represnet the shape.
Definition: OglShapeRenderer.cc:408
std::vector< GLuint > shadowMapID
ID of the shadow map.
Definition: OglShapeRenderer.hh:165
std::vector< GLuint > lightPosID
ID of the light position.
Definition: OglShapeRenderer.hh:125
Shader shader
main shader
Definition: OglShapeRenderer.hh:122
std::vector< GLuint > lightAmbID
ID of the light ambiance.
Definition: OglShapeRenderer.hh:128
OglShapeRenderer(std::string vertex_file, std::string fragment_file, MbsWorld3D *w, OglWorldRenderer *world_rend)
Constructor.
Definition: OglShapeRenderer.cc:45
glm::vec3 color
light color
Definition: OglShapeRenderer.hh:39
GLuint VBO_color_id
VBO for colors.
Definition: OglShapeRenderer.hh:153
std::vector< GLuint > depthBiasID
ID of the depth bias.
Definition: OglShapeRenderer.hh:164
virtual void SetModelMat(glm::mat4 const &model_mat)
set the model matrix
Definition: OglShapeRenderer.hh:104
std::vector< GLuint > lightConDirID
ID of the light cone direction (for spots)
Definition: OglShapeRenderer.hh:130
float shadowBias
shadow bias
Definition: OglShapeRenderer.hh:48
std::vector< GLuint > depthTexture
depth textures
Definition: OglShapeRenderer.hh:172
std::vector< GLuint > spreadID
ID of the spread factor for Poisson disk.
Definition: OglShapeRenderer.hh:167
GLuint shininessID
ID of the shininess (shape material)
Definition: OglShapeRenderer.hh:160
std::vector< int > depth_semi_y_width
X semi width of the shadow map depth textures (in pixels)
Definition: OglShapeRenderer.hh:175
glm::vec3 coneDir
cone direction
Definition: OglShapeRenderer.hh:45
MbsWorld3D * world_3d
3D world
Definition: OglShapeRenderer.hh:115
int nb_indexes
size of the indexes vector
Definition: OglShapeRenderer.hh:113
bool light_init
flag to know if the ligth is initialized
Definition: OglShapeRenderer.hh:149
std::vector< GLuint > lightConAngID
ID of the light cone angle (for spots)
Definition: OglShapeRenderer.hh:129
GLuint VBO_vertex_id
VBO for vertices.
Definition: OglShapeRenderer.hh:152
OglShapeRenderer class and utilities.
std::vector< GLuint > shadowBiasID
ID of the shadow bias.
Definition: OglShapeRenderer.hh:166
MbsShapeRenderer is an abstract class that defines the property need to render a MbsShape3D....
Definition: MbsShapeRenderer.hh:29
std::vector< GLuint > lightAttID
ID of the light attenuation.
Definition: OglShapeRenderer.hh:127
Shader * depth_shader
depth shader
Definition: OglShapeRenderer.hh:123
GLuint modelMatID
ID of the model matrix.
Definition: OglShapeRenderer.hh:133
float ambientCoef
ambient coefficient
Definition: OglShapeRenderer.hh:41
std::vector< float > depth_ratio_width
ration between the X and Y width components of the depth texture
Definition: OglShapeRenderer.hh:177
void LightsInit(float shiny_mat, glm::vec3 const &specular_mat, float transparency)
initalize the lights
Definition: OglShapeRenderer.cc:109
std::string depth_vert_sh
vertex depth shader path
Definition: OglShapeRenderer.hh:141
MbsLight * light
pointer to the related 'MbsLight' component
Definition: OglShapeRenderer.hh:50
GLuint cameraID
ID of the camera.
Definition: OglShapeRenderer.hh:159
ShaderLight()
Definition: OglShapeRenderer.hh:33
int GetDepthXWidth(int i) const
get the depth texture width along the X axis (in pixels)
Definition: OglWorldRenderer.hh:64
void LightsUpdate()
update the lights
Definition: OglShapeRenderer.cc:314
void Clear()
clear the current light shader
Definition: OglShapeRenderer.hh:53
GLuint GetDepthTexture(int i) const
get a depth texture
Definition: OglWorldRenderer.hh:58
GLuint nbLightsID
ID of the number of lights.
Definition: OglShapeRenderer.hh:158
GLuint GetFrameBuffer(int i) const
get a frame buffer
Definition: OglWorldRenderer.hh:61
virtual void ShadowDepth(int index)
update of the shadow depth buffer
Definition: OglShapeRenderer.cc:697
int shader_flag
flag for shaders
Definition: OglShapeRenderer.hh:120
GLuint VAO_id
VAO.
Definition: OglShapeRenderer.hh:151
shader light class
Definition: OglShapeRenderer.hh:30
GLuint specularID
ID of the specular value (shape material)
Definition: OglShapeRenderer.hh:161
glm::vec4 pos
light position
Definition: OglShapeRenderer.hh:38
int GetDepthYWidth(int i) const
get the depth texture width along the Y axis (in pixels)
Definition: OglWorldRenderer.hh:67
std::vector< GLuint > lightColID
ID of the light color.
Definition: OglShapeRenderer.hh:126
int GetNbDepthTextures() const
get the number of depth textures
Definition: OglWorldRenderer.hh:55
GLuint mvpID
ID of the MVP matrix.
Definition: OglShapeRenderer.hh:132
GLuint VBO_normal_id
VBO for normals.
Definition: OglShapeRenderer.hh:154
glm::mat4 model_mat
model matrix ==> the same as the one stored in MbsShape3D
Definition: OglShapeRenderer.hh:111