Converted the osg::Material::set/getShininess option to use the standard

OpenGL range of 0.0 to 128.0 instead of the previous normalised shiniess
range. This brings it inline with the way the rest of the OSG uses a
1 to 1 mapping to OpenGL.

Converted the various loaders to use the new range, which is almost all
cases was simply removing the /128.0f which was required before!
This commit is contained in:
Robert Osfield
2002-07-18 09:55:30 +00:00
parent 1a139efbbc
commit 7a8eeb3c92
8 changed files with 15 additions and 19 deletions

View File

@@ -227,7 +227,7 @@ const Vec4& Material::getEmission(const Face face) const
void Material::setShininess( const Face face, float shininess )
{
clampBetweenRange(shininess,0.0f,1.0f,"Material::setShininess()");
clampBetweenRange(shininess,0.0f,128.0f,"Material::setShininess()");
switch(face)
{
@@ -389,12 +389,12 @@ void Material::apply(State&) const
if (_shininessFrontAndBack)
{
glMaterialf( GL_FRONT_AND_BACK, GL_SHININESS, _shininessFront* 128.0f );
glMaterialf( GL_FRONT_AND_BACK, GL_SHININESS, _shininessFront );
}
else
{
glMaterialf( GL_FRONT, GL_SHININESS, _shininessFront* 128.0f );
glMaterialf( GL_BACK, GL_SHININESS, _shininessBack* 128.0f );
glMaterialf( GL_FRONT, GL_SHININESS, _shininessFront );
glMaterialf( GL_BACK, GL_SHININESS, _shininessBack );
}
}