Re: Flt R14.2d loader and colours

New Message Reply Date view Thread view Subject view Author view

Marcus Barnes (marcus++at++multigen.com)
Wed, 24 Jan 1996 12:43:46 -0800


On Jan 24, 11:26am, Mark Baranowski wrote:
> Subject: Flt R14.2d loader and colours
> Hi all,
>
> Can anyone shed some light on why the Flight R14.2d loader does not
> seem to map colours directly from the database to the Performer
> hierarchy.

What you are seeing is the modulation of the color in the model with the
default material created by the OpenFlight loader. Everything in the model
that doesn't have a material is given the default material, just as polygon
normals are computed by default. The default material attributes are the same
as in MultiGen:

        ambient { 0.3f, 0.3f, 0.3f }
        diffuse { 0.7f, 0.7f, 0.7f }
        specular { 0.2f, 0.2f, 0.2f }
        emission { 0.0f, 0.0f, 0.0f }
        shininess { 0.0f }
        alpha { 1.0f }

This is an artifact of the way pfMtlColorMode( PFMTL_CMODE_AD ) works which the
loader uses by default. You can change this to PFMTL_CMODE_COLOR whereby the
loader doesn't need to modulate the colors (rather the materials) by calling:

        LoadFltMode( PFFLT_AMBIENT_IS_DIFFUSE, FALSE );

before loading the file. This can also be done from perfly 1.2 command line
with the -o option:

% perfly -o5 file.flt

> For example a test database with a single polygon whose colour is
> (R=0, G=255, B=0) ends up as a GeoSet with an overall colour set to
> (R=0, G=178, B=0) (as reported by perfly -w). Does anyone know if this
> apparent factoring of 0.7 is consistent.

Not exactly. Polygons that have a material will be modulated with that
materials diffuse component ... which may not be { 0.7. 0.7, 0.7 }. If for
example you define a material with diffuse { 1.0, 1.0, 1.0 } and still use
PFMTL_CMODE_AD then the modulation will be a no-op.

The man pages to study are lmcolor(3) and pfMaterial(3) and even lmdef(3) for
both IRIS GL and Performer based details.

[munch]

>-- End of excerpt from Mark Baranowski

Regards.

--
    __  ___      ____  _ ______          Marcus Barnes, Member Tech. Staff
   /  |/  /_  __/ / /_( ) ____/__  ____  MultiGen Inc, 550 S. Winchester
  / /|_/ / / / / / __/ / / __/ _ \/ __ \ Blvd. STE 500, San Jose CA 95128
 / /  / / /_/ / / / / / /_/ /  __/ / / / PH:1-408-556-2654 FX:1-408-261-4102
/_/  /_/\__,_/_/\_\/_/\____/\___/_/ /_/  EMAIL: marcus++at++multigen.com

New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:52:18 PDT

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.