Axel Sammet (axel++at++luca.hannover.sgi.com)
Tue, 10 Dec 1996 16:56:24 +0000
In the mean time there's a common fix available :
--------------------------------------------------------------------------
Environment mapping in Inventor loader is broken in OpenGL in 2.0
This can be fixed in libpfiv/pfiv.C in enable/disable SphereMap():
int
enableSphereMap(pfTraverser *, void *)
{
#ifdef IRISGL
texgen(TX_S, TG_SPHEREMAP, NULL);
texgen(TX_T, TG_SPHEREMAP, NULL);
texgen(TX_S, TG_ON, NULL);
texgen(TX_T, TG_ON, NULL);
#else
glTexGenf(GL_S, GL_TEXTURE_GEN_MODE, GL_SPHERE_MAP );
glTexGenf(GL_T, GL_TEXTURE_GEN_MODE, GL_SPHERE_MAP);
glEnable(GL_TEXTURE_GEN_S);
glEnable(GL_TEXTURE_GEN_T);
#endif
return PFTRAV_CONT;
}
int
disableSphereMap(pfTraverser *, void *)
{
#ifdef IRISGL
texgen(TX_S, TG_OFF, NULL);
texgen(TX_T, TG_OFF, NULL);
#else
glDisable(GL_TEXTURE_GEN_S);
glDisable(GL_TEXTURE_GEN_T);
#endif
return PFTRAV_CONT;
}
Cheers
Axel
On Dec 10, 14:57, Benedikt Kessler wrote:
> Subject: Re: Environment mapping with perfly
> On Dec 10, 11:47am, Christoph Brandt wrote:
> > Subject: Environment mapping with perfly
> > Hi,
> >
> > i have problems getting an environment mapped inventor model displayed
> > correctly with perfly, e.g. the model is not textured. Is there a
> > parameter i am missing when starting perfly or is the inventor loader
> > not supporting environment maps?
> >
> > Anyone has experienced this before?
> >
> > Christoph Brandt
> > - Heinz Nixdorf Institut
> > =======================================================================
>
> Hi!
>
> It seems your not the first one with this problem (see old messages
> attached below). But there's a solution!
>
> Du scheinst nicht der erste mit diesem Problem zu sein (siehe Mail weiter
> unten). Allerdings gabe es zu dieser Mail auch noch keine Antwort.
>
> That's what happening:
>
> - When you activate ivfix in ivview you will see the same problem you
have
> in Performer
>
> - the following (among other things) happens when the Inventor Loader in
> Performer har read your file:
>
> // Optimize converted scene graph
> pfNotify(PFNFY_INFO, PFNFY_MORE, " Optimizing Performer scene
> graph");
>
> if (DoFlatten)
> {
> result = pfdFreezeTransforms(result, NULL);
> result->flatten(0);
> }
>
> if (DoClean)
> result = pfdCleanTree(result, NULL);
>
> perfly has the option perfly -y iv,4,0 xxx.iv which sets DoClean to 0.
> This way the pre- and post-traversal callbacks which turn on and off
> env-mapping are left intact (it seems pfdCleanTree is removind/replacing
> the node that had the callbacks attached).
>
> But there's a second problem; the loader seems to retesselate the
object's
> geosets. There are also a few options to correct this:
>
> All three possibilities (maybe there are even more) provide correct
> results (even if the options look a little bit inconsistent):
>
> -o 3 disable PFDBLDR_MESH_MAX_TRIS
> -O 3 enable PFDBLDR_MESH_MAX_TRIS
> -O 5 enable PFDBLDR_MESH_LOCAL_LIGHTING
>
> all together: perfly -O 3 -y iv,4,0 xxx.iv
>
> Ciao! Benedikt
>
> On Oct 16, 10:03pm, Axel Sammet wrote:
> > Subject: Inventor loader problems
> > Hi
> >
> > I have problem getting environment mapped geometries to work in perfly.
> > the models are inventor based and work perfect in performer 2.0 on RE2
> > under 5.3. On iR (Performer 2.1+Patch 1355), however, the environment
> > mapping won't work. Modifying perfly to environment-map the entire
scene
> > works, but of course that's not what I want. ivview on the iR also
shows
> > the correct mappings.
> > I know there was the same kind of problem with env.mapping in the old
> > inventor loader under IRIX 5.3. Did the bug slip back in?
> >
> > has anybody experienced a similar behaviour?
> >
> > ONYX RE2 DS/4xR4400 150MHz/512MB RAM/4 RM5/MCO ---> WORKS
> > ONYX iR RACK 2-Pipe/TKO/DG4-8/8xR10K/1GB RAM/2x4 RM6-64 ---> DOESN'T
> WORK
> >
> >
> > Thanks, Axel
> >
>
> Sender: purschke++at++audi.de
> Date: Mon, 23 Sep 1996 09:28:44 +0200
> From: Frank Purschke <frank.purschke++at++audi.de>
> To: info-performer++at++sgi.com
> Subject: EnvMapping with Inventor files in perfly
>
> Here is another one on perfly:
> I have problems to get an environment mapping on inventor objects in
> perfly. The following inventor sample describes a little bit closer what
> I mean:
>
> Inventor file: test.iv
> ---------------------------
> #Inventor V2.0 ascii
>
> Separator {
> TextureCoordinateEnvironment {
> }
> Texture2Transform {
> center 0.5 0.5
> }
> Texture2 {
> filename "/usr/share/data/textures/reflect/cafe.rgb"
> model MODULATE
> }
> Cube {
> }
> }
>
> This small example works fine with ivview but it fails with perfly.
> Any hints would be very helpful!
>
> Frank
> --
> Frank Purschke
> Volkswagen AG
> Virtual Reality Lab
>
> --
> +---------------------------------+----------------------------------+
> |Benedikt J. Kessler | Silicon Graphics GmbH |
> |Training Munich | Am Hochacker 3 - Technopark |
> |Silicon Graphics Computer Systems| 85630 Grasbrunn-Neukeferloh, FRG |
> | --- __o ,__o | |
> | ------_ \<,_ _-\_<, | Phone: (+int) 89 46108-212 or -0 |
> |----- (*)/ (*) (*)/'(*) | Fax: (+int) 89 46108-190 or 222|
> +---------------------------------+----------------------------------+
> |Network: <bjk++at++munich.sgi.com> |
> +--------------------------------------------------------------------+
> =======================================================================
> List Archives, FAQ, FTP: http://www.sgi.com/Technology/Performer/
> Submissions: info-performer++at++sgi.com
> Admin. requests: info-performer-request++at++sgi.com
>
>-- End of excerpt from Benedikt Kessler
--_____________________________________________________________________
Axel Sammet Visual Simulation, Digital Media, CAD/CAM
Silicon Graphics GmbH | Tel: +49 511 9017229 (HNV Office) Ahrensburger Strasse 3 | Tel: +49 40 6028282 (Home Office) 30659 Hannover | Fax: +49 511 6138115 Germany | E-Mail: axel++at++hannover.sgi.com _____________________________________________________________________ ======================================================================= List Archives, FAQ, FTP: http://www.sgi.com/Technology/Performer/ Submissions: info-performer++at++sgi.com Admin. requests: info-performer-request++at++sgi.com
This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:54:07 PDT