]> git.tdb.fi Git - libs/gl.git/commitdiff
Move eye_obj matrices back out of the uniform block
authorMikko Rasa <tdb@tdb.fi>
Mon, 27 Oct 2014 20:28:35 +0000 (22:28 +0200)
committerMikko Rasa <tdb@tdb.fi>
Mon, 27 Oct 2014 20:28:35 +0000 (22:28 +0200)
It turns out that updating the buffer for every draw call causes trouble
for drivers, especially OpenGL ES.  Projection matrix typically does not
change during a frame, so it can stay.

source/programbuilder.cpp

index 540518e49bf4223594f2e53cdbd8b6cb3be55f11..832d5898bb33b44efc6c970a79d8250daf86395c 100644 (file)
@@ -134,8 +134,8 @@ 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, "Transform::eye_obj_matrix", "mat4", "gl_ModelViewMatrix", 0 },
-       { UNIFORM, "Transform::eye_obj_normal_matrix", "mat3", "gl_NormalMatrix", 0 },
+       { UNIFORM, "eye_obj_matrix", "mat4", "gl_ModelViewMatrix", 0 },
+       { UNIFORM, "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 },