From: Mikko Rasa Date: Sun, 28 Sep 2014 17:54:56 +0000 (+0300) Subject: Put transform matrices into a uniform block too X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=3101f1e39018b33c74898fa76664ee1cb6326dc3;p=libs%2Fgl.git Put transform matrices into a uniform block too I'm fairly certain the glBufferSubData call required to update the block contents is no slower than the glUniformMatrix* calls to set the uniforms directly. --- diff --git a/source/programbuilder.cpp b/source/programbuilder.cpp index db9809c4..1706b9d4 100644 --- a/source/programbuilder.cpp +++ b/source/programbuilder.cpp @@ -136,9 +136,9 @@ const ProgramBuilder::VariableDefinition ProgramBuilder::standard_variables[] = { UNIFORM, "environment", "samplerCube", 0, 0 }, { UNIFORM, "EnvMap::env_eye_matrix", "mat3", 0, 0 }, { UNIFORM, "Material::reflectivity", "float", 0, 0 }, - { UNIFORM, "eye_obj_matrix", "mat4", "gl_ModelViewMatrix", 0 }, - { UNIFORM, "eye_obj_normal_matrix", "mat3", "gl_NormalMatrix", 0 }, - { UNIFORM, "projection_matrix", "mat4", "gl_ProjectionMatrix", 0 }, + { UNIFORM, "Transform::eye_obj_matrix", "mat4", "gl_ModelViewMatrix", 0 }, + { UNIFORM, "Transform::eye_obj_normal_matrix", "mat3", "gl_NormalMatrix", 0 }, + { UNIFORM, "Transform::projection_matrix", "mat4", "gl_ProjectionMatrix", 0 }, { UNIFORM, "ShadowMap::shd_eye_matrix", "mat4", 0, 0 }, { UNIFORM, "Lighting::light_sources", "LightSourceParameters[MAX_LIGHTS]", "gl_LightSource[i]", 0 }, { UNIFORM, "Lighting::ambient_color", "vec4", "gl_LightModel.ambient", 0 },