]> git.tdb.fi Git - libs/gl.git/commitdiff
Put transform matrices into a uniform block too
authorMikko Rasa <tdb@tdb.fi>
Sun, 28 Sep 2014 17:54:56 +0000 (20:54 +0300)
committerMikko Rasa <tdb@tdb.fi>
Mon, 29 Sep 2014 15:10:03 +0000 (18:10 +0300)
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.

source/programbuilder.cpp

index db9809c4f986a29b2fca7bbd6a204fb31df2de57..1706b9d4ad70c0dc8e362f7c37b754e5df7a02b8 100644 (file)
@@ -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 },