From Paul Martz,"Several misc changes, but the major fixes include:

* Support for Vec4ubArray for color data
 * Support for material transparency
 
Thanks to Neil Hughes, Jason Daly, yourself, and others for testing and reporting issues."
This commit is contained in:
Robert Osfield
2008-04-11 13:43:11 +00:00
parent 76e0198007
commit d0a2bf87f3
8 changed files with 267 additions and 105 deletions

View File

@@ -77,8 +77,7 @@ MaterialPaletteManager::write( DataOutputStream& dos ) const
dos.writeInt16( (int16) MATERIAL_PALETTE_OP );
dos.writeInt16( 84 ); // Length - FIXME: hard-code/FLT version?
dos.writeInt32( m.Index );
std::string fakename = "SOMEFAKENAME";
dos.writeString( fakename, 12 ); // Name - FIXME: put a 'real' name here?
dos.writeString( std::string( "" ), 12 ); // Name - FIXME: put a 'real' name here?
dos.writeInt32( 0 ); // Flags
dos.writeFloat32(ambient.r() );
dos.writeFloat32(ambient.g() );
@@ -93,7 +92,7 @@ MaterialPaletteManager::write( DataOutputStream& dos ) const
dos.writeFloat32(emissive.g() );
dos.writeFloat32(emissive.b() );
dos.writeFloat32(shininess);
dos.writeFloat32(1.0f); // Alpha - unused
dos.writeFloat32( diffuse.a() ); // alpha
dos.writeFloat32(1.0f); // 'Reserved' - unused
if (m.Material->getAmbientFrontAndBack() == false ||
@@ -103,13 +102,9 @@ MaterialPaletteManager::write( DataOutputStream& dos ) const
m.Material->getShininessFrontAndBack() == false )
{
std::stringstream ss;
ss << "Front and back faces of material \'"
<< fakename
<< "\' have different material"
<< "properties - OpenFlt does not support this..."
<< std::endl;
_fltOpt.getWriteResult().warn( ss.str() );
std::string warning( "fltexp: No support for different front and back material properties." );
osg::notify( osg::WARN ) << warning << std::endl;
_fltOpt.getWriteResult().warn( warning );
}
}