From Aurelien Albert, "This line,I use the "useVertexAttributeAliasing" mode in my application, and color arrays are not normalized, so shaders get [0.0-255.0] values instead of [0.0-1.0] values.

This patch fix this."

and those below, will be ignored
----

M    include/osg/State
This commit is contained in:
Robert Osfield 2013-02-06 14:50:37 +00:00
parent c89d1968fd
commit 00c7e5e552

View File

@ -818,7 +818,7 @@ class OSG_EXPORT State : public Referenced, public Observer
#ifdef OSG_GL_VERTEX_ARRAY_FUNCS_AVAILABLE
if (_useVertexAttributeAliasing)
{
setVertexAttribPointer(_colorAlias._location, size, type, GL_FALSE, stride, ptr);
setVertexAttribPointer(_colorAlias._location, size, type, GL_TRUE, stride, ptr);
}
else
{
@ -836,7 +836,7 @@ class OSG_EXPORT State : public Referenced, public Observer
_colorArray._dirty = false;
}
#else
setVertexAttribPointer(_colorAlias._location, size, type, GL_FALSE, stride, ptr);
setVertexAttribPointer(_colorAlias._location, size, type, GL_TRUE, stride, ptr);
#endif
}