From da90b3f90a1032b5aa2e4f64a2ed9c8fc837ad98 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 4 Nov 2009 11:02:00 +0000 Subject: [PATCH] Enabled the vertex aliasing and projection/modelview uniform setting by default for GLES2 and GL3 targets --- src/osg/State.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/osg/State.cpp b/src/osg/State.cpp index e51bf4175..6ae67d82a 100644 --- a/src/osg/State.cpp +++ b/src/osg/State.cpp @@ -46,14 +46,20 @@ State::State(): _projection = _identity; _modelView = _identity; - _useModelViewAndProjectionUniforms = false; + #if defined(OSG_GLES2_AVAILABLE) || defined(OSG_GL3_AVAILABLE) + _useModelViewAndProjectionUniforms = true; + _useVertexAttributeAliasing = true; + #else + _useModelViewAndProjectionUniforms = false; + _useVertexAttributeAliasing = false; + #endif + _modelViewMatrixUniform = new Uniform(Uniform::FLOAT_MAT4,"osg_ModelViewMatrix"); _projectionMatrixUniform = new Uniform(Uniform::FLOAT_MAT4,"osg_ProjectionMatrix"); _modelViewProjectionMatrixUniform = new Uniform(Uniform::FLOAT_MAT4,"osg_ModelViewProjectionMatrix"); _normalMatrixUniform = new Uniform(Uniform::FLOAT_MAT3,"osg_NormalMatrix"); { - _useVertexAttributeAliasing = false; setUpVertexAttribAlias(_vertexAlias,0, "gl_Vertex","osg_Vertex","attribute vec4 "); setUpVertexAttribAlias(_normalAlias, 2, "gl_Normal","osg_Normal","attribute vec3 "); setUpVertexAttribAlias(_colorAlias, 3, "gl_Color","osg_Color","attribute vec4 ");