GlShaderBlinnShadowMap() { std::string infoLog; initVertFragShadersFromDirectory("shader_blinn_shadow_map"); attachFragShader(SHADER_GLSL_DEFAULT_DIR"shader_blinn/fragment_shader_skeleton.glsl"); // link programs if (!link()) { std::string infoLog; getInfoLog(infoLog); std::cerr << "info Log: during linking: " << infoLog << std::endl; return; } setupUniform(texture0_enabled, "texture0_enabled"); setupUniform(shadow_map_matrix_uniform, "shadow_map_matrix"); use(); setUniform1i("texture0", 0); setUniform1i("texture_shadow_map", 1); disable(); initBlinnSkeleton(*this); }
/** * set uniform to the 3 components of value */ inline void setUniform3fv(const GLchar *name, GLfloat *value) { GlUniform uniform; setupUniform(uniform, name); uniform.set3fv(value); CGlErrorCheckWithMessage(name); }
/** * set uniform to the value */ inline void setUniform1i(const GLchar *name, GLint value) { GlUniform uniform; setupUniform(uniform, name); uniform.set1i(value); CGlErrorCheckWithMessage(name); }
GlShaderBlinn() { std::string infoLog; initVertFragShadersFromDirectory("shader_blinn"); attachFragShader(SHADER_GLSL_DEFAULT_DIR"shader_blinn/fragment_shader_skeleton.glsl"); // link programs if (!link()) { std::string infoLog; getInfoLog(infoLog); std::cerr << "info Log: during linking: " << infoLog << std::endl; return; } setupUniform(texture0_enabled, "texture0_enabled"); setupUniform(vertex_color, "vertex_color"); initBlinnSkeleton(*this); }
GLShaderHeightColorBlinn() { std::string infoLog; initVertFragShadersFromDirectory("shader_height_color_blinn"); attachFragShader(SHADER_GLSL_DEFAULT_DIR"shader_blinn/fragment_shader_skeleton.glsl"); // link programs if (!link()) { std::string infoLog; getInfoLog(infoLog); std::cerr << "info Log: during linking: " << infoLog << std::endl; return; } setupUniform(height_color_scale, "height_color_scale"); setupUniform(height_color_offset, "height_color_offset"); initBlinnSkeleton(*this); setupColorScaleAndOffset(); }
GlShaderTexturize() { if (!initVertFragShadersFromDirectory("shader_texturize")) return; if (!link()) { std::string infoLog; getInfoLog(infoLog); std::cerr << "info Log: linking: " << infoLog << std::endl; return; } setupUniform(pvm_matrix_uniform, "pvm_matrix"); }