Re: [info-performer] PFB format and mipmapping filter

Date view Thread view Subject view Author view

From: lawrence bertoldi (lberto++at++adelphia.net)
Date: 11/08/2003 15:07:10


On a similar topic, I was trying to load a bunch of 'obj' models in to an
ocean simulator that I built. I am able to pre-load about 20 models with
no problem
the display comes up and everything works correctly.
but if I try to load more than that (depending on the models complexity,
my display comes up black.

 From the debug in my code I can tell that all my functionality is still
there,
My Periscope goes up and down, I can still change cloud cover, seastate
and cycle through day/night. I can even exit the program, but no display.

I looked for any PF_INFO etc. from the loader to see if anything ran
amuck but it
looked normal, no errors, unusual warnings etc.!

I thought this might be a texture issue so to test this I removed the
"mtl" file from
some of the '.obj' models to see if I could load more without textures.
This worked fine,
I was able to load all of the other models I had as long as the material
files were comented out!

To make sure that it was not a problem with one of the models I swaped
the textured ones
to untextured and the untextured to textured by changing which ones had
the mtl files in them.
Again no problem in loading all of the models

Next I checked to see how many textures I was using and how much tex
memory I was
using. The max number of textures in my texture directory is125 and the
total texture size was about 58M. I am only trying to load about half of
them So
on a Gforce-4 with 128M of tex mem I thought I should be ok! (did I
mention that this is linux?)

Next I had my partner converted the models with pfconv to ".pfb" Now I
can load all
of the models with all of the textures with no problem!

So My question is .... is there a problem with the obj loader?

I use obj format because I don't have multi-gen (we work in maya)
and I can manipulate all of the shaders easily with a text editor!

Thanks in advance for any help!
lawrence bertoldi
simagery inc
lberto++at++adelphia,net

Paolo Farinelli wrote:

> Hi Jürgen,
>
> I think I found the origin of your problem.
>
> 1. Examining the differences in the two .pfa files you sent me, I can
> see that
> the texture e009n52-2-1-8.pfi has indeed been saved with different
> minification filter (mag filters are identical).
>
> On Indigo, minfilter is set to 0x2010 (PFTEX_LINEAR | PFTEX_MIPMAP)
> while on Onyx, it is set to 0x8010 (PFTEX_TRILINEAR | PFTEX_MIPMAP)
>
> 2. If you look at the source for the dwb loader in
> /usr/share/Performer/src/lib/libpfdb/libpfdwb/pfdwb.c, you will see
> the
> following in function getDwbTexture:
>
> ...
> switch ((int) ((double) tex->tex.minfilter))
> {
> case DWB_TX_POINT: minf = PFTEX_POINT; break;
> case DWB_TX_BILINEAR: minf = PFTEX_BILINEAR; break;
> case DWB_TX_BICUBIC: minf = PFTEX_BICUBIC; break;
> case DWB_TX_MIPMAP_POINT: minf = PFTEX_MIPMAP_POINT; break;
>
> case DWB_TX_MIPMAP_LINEAR:
> if (GfxType & GFX_REALITY)
> minf = PFTEX_MIPMAP_TRILINEAR;
> else
> minf = PFTEX_MIPMAP_LINEAR;
> break;
>
> case DWB_TX_MIPMAP_BILINEAR:
> if (GfxType & GFX_REALITY)
> minf = PFTEX_MIPMAP_TRILINEAR;
> else
> minf = PFTEX_MIPMAP_BILINEAR;
> break;
>
> case DWB_TX_MIPMAP_TRILINEAR: minf = PFTEX_MIPMAP_TRILINEAR; break;
>
> default:
> fprintf (stderr, "LoadDwb: Unknown minFilter for %s\n", tex->name);
> minf = PFTEX_BILINEAR;
> break;
> }
> ...
>
> 3. The value of GfxType is set somewhere else, like this:
>
> GfxType = 0;
> pfQueryFeature (PFQFTR_TEXTURE_SHARPEN, &sharpen);
> pfQueryFeature (PFQFTR_MULTISAMPLE, &multisample);
> if (sharpen) GfxType |= GFX_REALITY;
> if (multisample) GfxType |= GFX_MULTISAMPLE;
>
>
> CONCLUSION:
>
> The original minification filter specified in your .dwb file is
> DWB_TX_MIPMAP_BILINEAR and *NOT* DWB_TX_MIPMAP_TRILINEAR.
> This means that the .pfa saved by the Indigo is actually the correct
> one (ie it uses
> exactly the minfilter specified in the .dwb file).
> On Onyx systems however, the dwb loader replaces the requested
> MIPMAP_BILINEAR filter with a MIPMAP_TRILINEAR filter.
>
> So, if you want a MIPMAP_TRILINEAR minfilter on both platforms, you need
> to explicitely request a DWB_TX_MIPMAP_TRILINEAR minfilter in your
> .dwb file.
>
> Hope this solves your problem.
> Let me know if you need further assistance.
>
> Best Regards,
> Paolo
>
>
>
>
> Juergen Gotschlich wrote:
>
>> Hi Paolo,
>>
>> here are the two pfa-files and the original dwb.
>>
>> 1.
>> (INDIGO) > pfconv -M pfb,2,1 e009n52-2-1-8.dwb
>> e009n52-2-1-8-indigo.pfa
>>
>> 2.
>> (ONYX) > pfconv -M pfb,2,1 e009n52-2-1-8.dwb e009n52-2-1-8-onyx.pfa
>>
>> I cannot interpret the difference in the pfa-files.
>>
>> thanks, Jürgen
>
>


Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Sat Nov 08 2003 - 15:35:02 PST