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:
@@ -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 );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user