From: Dimi (christop++at++fhw.gr)
Date: 09/15/2003 05:51:28
Hi,
I managed to create an example to show the problem I found in the
pfdBuider and sought advice
on my previous post.
Since most of the loader written in Performer use the pfdBuilder
mechanism, I used the .im loader
which is in every Performer distribution. The .im file is an ascii based
format its called Simple OGL Performer data format. I include it here
just copy it and create a text file. I name the file box.im.
Contents of box.im file:
new root top
end_root
new geode poly
end_geode
new geode poly2
end_geode
load_geode poly
color 1.0 1.0 1.0 1.0
tex logo.512.rgb
poly 4
vc -.5 0.0 -.5 .5 0.0 -.5 .5 0.0 .5 -.5 0.0 .5
tc 0.0 0.0 1.0 0.0 1.0 1.0 0.0 1.0
end
load_geode poly2
color 1.0 1.0 1.0 1.0
tex logo.512.rgb
poly 4
vc -.5 1.0 -.5 .5 1.0 -.5 .5 1.0 .5 -.5 1.0 .5
tc 0.0 0.0 1.0 0.0 1.0 1.0 0.0 1.0
end
attach top poly
attach top poly2
You can load up this file using perfly. It will show 2 textured quads.
Each quad has the same texture
logo.512.rgb on it, but the quads are in differend geodes.
The texture logo.512.rgb is usually in the /usr/share/Performer/data
directory so you should not have any
problem loading it, since its one of the default places where perfly
looks for textures.
If you load the file using perfly and leave the texture in the
/usr/share/Performer/data directory
the message :pfdNewSharedObject() Loaded Texture:
/usr/share/Performer/data/logo.512.rgb
appears twice. this means that pfdBuilder has created 2 pfTextures.
Whereas if you copy the texture logo.512.rgb to the local directory
where the .im file is the
message appears only once.
Offcourse because off the texture dowloading (pfuMakeSceneTexList) of
perfly the texture is finally only loaded once into texture memory.
Unfortunately my custom loader which uses the pfdBuilder has to load
many files which have multiple
textures and the time to load the models differs tremendulsly when they
are in a local directory
instead of a directory pointed to by PFPATH.
Hope I showed you where the problem is and you can help me.
Dimi
--
Dimi Christopoulos {christop++at++fhw.gr}
VR Software Engineer
Foundation of the Hellenic World
Athens - Greece
This archive was generated by hypermail 2b29 : Mon Sep 15 2003 - 05:57:05 PDT