From Brede Johansen,

"Geometry.cpp
Make sure number of normals match number of vertices when lit or
vertex-normal pairs are separated when geometries are merged by the
optimizer.

Ancillary.cpp
Improved support for multitexture effect field and use texture
environment from .attr file.

PaletteRecords.cpp
Use search path when looking for shader files.

PrimaryRecords.cpp
Added preset uniforms "TextureUnit0", "TextureUnit1", "TextureUnit2"
and "TextureUnit3" for GLSL shaders."
This commit is contained in:
Robert Osfield
2007-02-13 14:19:39 +00:00
parent cd07fb61eb
commit 927dfc0a52
4 changed files with 85 additions and 11 deletions

View File

@@ -148,10 +148,33 @@ public:
}
}
if (vertex.validNormal())
bool strict = false; // prepare for "strict" reader option.
if (strict)
{
osg::Vec3Array* normals = getOrCreateNormalArray(*_geometry);
normals->push_back(vertex._normal);
if (vertex.validNormal())
{
osg::Vec3Array* normals = getOrCreateNormalArray(*_geometry);
normals->push_back(vertex._normal);
}
}
else
{
// Add normal only if lit.
if (isLit())
{
osg::Vec3Array* normals = getOrCreateNormalArray(*_geometry);
if (vertex.validNormal())
normals->push_back(vertex._normal);
else // if lit and no normal in Vertex
{
// Use previous normal if available.
if (normals->empty())
normals->push_back(osg::Vec3(0,0,1));
else
normals->push_back(normals->back());
}
}
}
for (int layer=0; layer<Vertex::MAX_LAYERS; layer++)