From 3101f1e39018b33c74898fa76664ee1cb6326dc3 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Sun, 28 Sep 2014 20:54:56 +0300 Subject: [PATCH] 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. --- source/programbuilder.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 }, -- 2.45.2