From: Angus Dorbie (dorbie++at++sgi.com)
Date: 10/12/2000 14:01:07
Incase my verbose & typo riddled (sory) last email wasn't clear;
there are a few things you can try;
Reduce the num_effective levels even more to ensure that this isn't
jello. The difference is that even a screenshot can show jello (there
are also temporal jello effects) but wobble cannot be shown in
screenshot. Also wobble does not happen near s=0, t=0 in the texture
database.
Adjust the texture attributes rather than trying to use a matrix. I
expect the matrix will improve things but I'd preffer the attribute
adjustment.
The adjustment doesn't have to be based on good area size tiles. Just
try and keep the texture coordinates approximately low. The obvious way
you can get a feel for how low you need to keep the numbers is if you go
to the s=0, t=0 portion of your database and travel towards s=1, t=1,
when wobble becomes a problem then the texture coordinates of the area
you are over are too high and you should aim to keep them lower than
this for the entire database in question. You will find that you don't
need to make many adjustments over the whole database.
You can see that for any given region there will be a fixed texture
coordinate bias which has been applied in texture coordinate attributes.
This number should be used to compensate in the cliptexture centre
position. There's no need for and good area size voodoo or texture
matrix work for wobble reduction. Just fixed texture translates for each
region and the compensating clip centre positioning.
Cheers,Angus.
ihawkes2++at++csc.com.au wrote:
>
> Hi,
> I am having some problems curing a cliptexture of wobble/jello problems
> (Performer 2.2.8; Irix 6.5.8f on an Onyx2).
>
> Earlier in the project, we had similar problems with a 19 level
> cliptexture, and these were resolved by reducing the number of effective
> levels in the usual manner prescribed for fixing jello.
>
> We have now moved to a 26 level cliptexture, and the problem is back with a
> vengeance. It seems to be more severe than before, and reducing the number
> of effective levels does not seem to make any improvement (I went all the
> way back to 12 effective levels without improvement).
>
> The wobble seems to be confined to clipped polygons and the texels within a
> clipped polygon shake coherently with respect to eachother.
>
> On the assumption that this was a tex coord precision problem, I then tried
> the method of translating the tex coords closer to the origin by a multiple
> of the good area and moving the clip centre accordingly. I found some
> sample code in
> /usr/share/Performer/src/lib/libpfdb/libpfspherepatch/pfspherepatch.C (you
> may wish to update the sample reference in the IRClipmapBugs.html document
> because I couldn't find any precision fixes in the pfct.C reference!). I
> adapted the sample code to use a texture matrix as follows in a pre-cull
> callback:
>
> mpct->getCenter(&s, &t, &r);
> int goodAreaSize = 1<<(_numEffectiveLevels+Offset-1);
> newS = ((s-(goodAreaSize>>1))&(goodAreaSize-1))+(goodAreaSize>>1);
> newT = ((t-(goodAreaSize>>1))&(goodAreaSize-1))+(goodAreaSize>>1);
> newS = PF_MIN2(newS, s);
> newT = PF_MIN2(newT, t);
>
> ct->applyCenter(newS, newT, r);
>
> // Translate all the tex coords...
> double fudgeS = (double)(newS - s) / virtSize;
> double fudgeT = (double)(newT - t) / virtSize;
>
> // texMatrix has previously been established as the texture matrix
> // for the cliptextured geostate
> texMatrix->makeTrans(fudgeS, fudgeT, 0.0f);
>
> This seems to work insofar as it translates the tex coords & clipcentre and I end up with an image that is still sensible.
> However, it unfortunately doesn't seem to improve the wobble problem at
> all. I believe the translation code is OK, since if I comment out the
> applyCenter call, or the texMatrix->makeTrans call independently then I
> lose the hi-res image as you would expect.
>
> So, my questions are ...
>
> 1) Examples of wobbly tex coords (before translation) include the area
> around (0.917722, 0.266216) and also (perhaps less severely) around
> (0.095587, 0.362692). Would you expect precision problems at these values?
>
> 2) Any ideas why neither reducing the num effective levels, nor translating
> the texcoords seems to improve things? Is it possible that the polygons
> involved are just too big?
>
> 3) Assuming that translating tex coords is the way to go, how should I
> incorporate it into my cliptexture strategy which tiles the cliptexture,
> and uses pre-cull node callbacks to set the virtual cliptexture params for
> each tile. Should I use the largest (_numEffectiveLevels+Offset) of all the
> tile callbacks in order to calculate the goodAreaSize and then do the
> translation and the applyCenter a frame later in the pre-cull (since it
> doesn't work postcull)?
>
> Any help would be most appreciated!
>
> Thanks,
> Ian Hawkes
>
> -----------------------------------------------------------------------
> List Archives, FAQ, FTP: http://www.sgi.com/software/performer/
> Submissions: info-performer++at++sgi.com
> Admin. requests: info-performer-request++at++sgi.com
-- For Performer+OpenGL tutorials http://www.dorbie.com/"In the middle of difficulty lies opportunity." --Albert Einstein
This archive was generated by hypermail 2b29 : Thu Oct 12 2000 - 14:01:14 PDT