6 : shader_Ptr (_shader_program), shader_type (_shader_type),
7 shader_InVars_setup_done(false), shader_Uniforms_update_done(false),
8 vec_diffuse_color(glm::vec3(0.0f, 0.0f, 0.0f)),
9 vec_light_pos_0(glm::vec3(0.0f, 0.0f, 0.0f)), vec_light_col_0(glm::vec3(0.0f, 0.0f, 0.0f)),
10 vec_light_pos_1(glm::vec3(0.0f, 0.0f, 0.0f)), vec_light_col_1(glm::vec3(0.0f, 0.0f, 0.0f)),
11 vec_viewer_pos(glm::vec3(0.0f, 0.0f, 0.0f)), vec_viewer_lookAt(glm::vec3(0.0f, 0.0f, 1.0f)),
12 near_plane(1.0f), far_plane(10.0f),
13 use_gauss(1), gauss_kernel_size(3), blur_distance(0),
14 masking_color(glm::vec3(0.0f, 0.0f, 0.0f)), exculde_color(glm::vec3(0.0f, 0.0f, 0.0f)),
15 masking_tolerance(0.0f), use_prev_pass(0),
16 window_w(800.0f), window_h(600.0f),
17 depth_peel_bcgrd_col(glm::vec3(0.0f, 0.0f, 0.0f)),
18 blend_all_neighb_color(glm::vec3(1.0f, 1.0f, 1.0f))
38 GLuint _normal_buffer_handle,
39 GLuint _uv_buffer_handle,
40 GLuint _index_buffer_handle)
53 glBindBuffer(GL_ARRAY_BUFFER,_position_buffer_handle);
55 glEnableVertexAttribArray(shader_in_position_handle);
56 glVertexAttribPointer(shader_in_position_handle, 3, GL_FLOAT, GL_FALSE, 0, 0);
64 glBindBuffer(GL_ARRAY_BUFFER,_normal_buffer_handle);
66 glEnableVertexAttribArray(shader_in_normal_handle);
67 glVertexAttribPointer(shader_in_normal_handle, 3, GL_FLOAT, GL_FALSE, 0, 0);
73 glBindBuffer(GL_ARRAY_BUFFER,_uv_buffer_handle);
75 glEnableVertexAttribArray(shader_in_uv_handle);
76 glVertexAttribPointer(shader_in_uv_handle, 2, GL_FLOAT, GL_FALSE, 0, 0);
80 glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, _index_buffer_handle);
84 glBindBuffer(GL_ARRAY_BUFFER, 0);
85 glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
91 catch( std::exception & e)
93 std::cout <<
"Error during setup of VAO for shader type " <<
shader_type <<
": " << e.what() << std::endl;
147 const int _gauss_kernel_size,
148 const int _blur_dist)
151 if (_gauss_kernel_size == 3 || _gauss_kernel_size == 5 || _gauss_kernel_size == 7 || _gauss_kernel_size == 9)
157 const glm::vec3 _exclude_color,
158 const float _masking_tolerance,
159 const int _use_prev_pass)
175 if (_alpha >= 0.0f && _alpha <= 1.0f)
196 glm::mat4 & _modelMatrix,
197 const glm::vec3 & _obj_color,
198 const glm::vec3 & _contour_color)
213 glm::value_ptr(_projectionMatrix));
217 glm::value_ptr(_modelMatrix));
223 this->vec_light_pos_0.x, this->vec_light_pos_0.y, this->vec_light_pos_0.z);
226 this->vec_light_pos_1.x, this->vec_light_pos_1.y, this->vec_light_pos_1.z);
229 this->vec_viewer_pos.x, this->vec_viewer_pos.y, this->vec_viewer_pos.z);
232 this->vec_viewer_lookAt.x, this->vec_viewer_lookAt.y, this->vec_viewer_lookAt.z);
235 this->vec_light_col_0.x, this->vec_light_col_0.y, this->vec_light_col_0.z);
238 this->vec_light_col_1.x, this->vec_light_col_1.y, this->vec_light_col_1.z);
250 _obj_color.x, _obj_color.y, _obj_color.z);
278 _contour_color.x, _contour_color.y, _contour_color.z);
304 this->masking_color.x, this->masking_color.y, this->masking_color.z);
306 this->exculde_color.x, this->exculde_color.y, this->exculde_color.z);
342 this->depth_peel_blend[0], this->depth_peel_blend[1], this->depth_peel_blend[2], this->depth_peel_blend[3]);
345 this->depth_peel_bcgrd_col.r, this->depth_peel_bcgrd_col.g, this->depth_peel_bcgrd_col.b);
365 this->blend_all_neighb_color.r, this->blend_all_neighb_color.g, this->blend_all_neighb_color.b);
373 catch( std::exception & e)
375 std::cout <<
"Error during setup of uniforms for shader type " <<
shader_type <<
": " << e.what() << std::endl;