From befd5cf28bbfe1b334d4e96138d35e05ce51b3dd Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Mon, 27 Oct 2014 22:28:35 +0200 Subject: [PATCH] Move eye_obj matrices back out of the uniform block 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 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/programbuilder.cpp b/source/programbuilder.cpp index 540518e4..832d5898 100644 --- a/source/programbuilder.cpp +++ b/source/programbuilder.cpp @@ -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 }, -- 2.45.2