From: Paolo Farinelli (paolo++at++sgi.com)
Date: 03/03/2003 18:43:55
Hi Terry,
You can call pfPrint on your loaded geometry to verify whether the flt
loader is
throwing your texcoords away when the texture file is not found or is
invalid.
My guess is that you are right and that's exactly what's going on.
If so, I can suggest traversing your loaded geometry, and assigning your
clip-textured
geostate only after having allocated and assigned texture coords for
each geoset.
This way, texture coords will be present when cliptexture emulation code
attempts
to compute texture bounds for the geosets, which is a requirement, as
you suspected.
Let me know if this is too vague or if you come across other problems.
ciao,
Paolo
Terry Welsh wrote:
> I'm trying to load an .flt file and then assign a cliptexture to it. The model I'm loading references a texture with an extension that it doesn't know how to load. From what I'm seeing, I suspect that maybe since the texture doesn't get loaded, the .flt loader throws out all the tex coords, so the geosets are only left with vertex coords and normals.
> I can assign a regular texture to the model by creating a new geostate that loads a texture and uses pfTexGen to make new texture coords. The texture won't show up if I don't use pfTexGen.
> I try to replace that texture with a cliptexture, but my app crashes like so:
>
>#0 0x403c7420 in pfGeoSet::calcTexBBox () at eval.c:41
>#1 0x403ccecc in pfGeoSet::updateCteRefs () at eval.c:41
>#2 0x403cd369 in pfGeoSet::setGState () at eval.c:41
>#3 0x0804bd32 in metaflight::setAllGeoStates () at eval.c:41
>#4 0x0804bd81 in metaflight::setAllGeoStates () at eval.c:41
>#5 0x0804bd81 in metaflight::setAllGeoStates () at eval.c:41
>#6 0x0804bd81 in metaflight::setAllGeoStates () at eval.c:41
>#7 0x0804bd81 in metaflight::setAllGeoStates () at eval.c:41
>#8 0x0804b88b in metaflight::loadGeometryGridDataset () at eval.c:41
>#9 0x0804be16 in metaflight::loadDatabase () at eval.c:41
>#10 0x0804b341 in metaflight::metaflight () at eval.c:41
>#11 0x0804addf in main () at eval.c:41
>#12 0x409c6507 in __libc_start_main (main=0x804ad68 <main>, argc=1, ubp_av=0xbffffbc4, init=0x804a100 <_init>, fini=0x804eae0 <_fini>, rtld_fini=0x4000dc14 <_dl_fini>, stack_end=0xbffffbbc) at ../sysdeps/generic/libc-start.c:129
>
>This reminded me of a message that I got from Paolo a while ago that said this:
>
>>2. You must make sure that texture coordinates are already set on gsets,
>>and that gstate already points to your pfClipTexture when you assign
>>the geostate to the geoset. This is when pf will look to see whether
>>texcoord bounds need to be computed for the geoset.
>>
>
>My gstate already points to my cliptexture when I assign it, but maybe the geoset doesn't have any tex coords. Does this make sense, or am I barking up the wrong tree?
>
>Terry Welsh
>http://www.reallyslick.com
>
-- Paolo Farinelli paolo++at++sgi.com Member of Technical Staff, OpenGL Performer 1-650-933-1808 Silicon Graphics 1600 Amphitheatre Pkwy, Mountain View, CA 94043
This archive was generated by hypermail 2b29 : Mon Mar 03 2003 - 18:44:01 PST