From: ihawkes2++at++csc.com.au
Date: 10/26/2000 18:15:58
Thanks for all the replies on this topic. We have now confirmed that the
problem is definitely wobble rather than jello (we added a high-res inset
around the texture coord origin & observed that the wobble was not apparent
in this region). Reducing the number of effective levels all the way back
to 7 does not help.
To clarify the solution, is the following what you are suggesting we do? ::
1) Divide the geometry into a grid of N by N regions, where N is chosen
such that there is no wobble observed within the region closest to the tex
coord origin with no (s,t) offset applied.
2) For each region, pre-process the texture coordinates (presumably using
double precision calculations) so that the appropriate offset is applied to
each region.
eg if regions are labelled (1,1) to (N,N), then for region (X,Y) the offset
for s and t would be (X-1)/N and (Y-1)/N respectively.
3) At runtime, apply the appropriate clipcentre offset, depending on which
region we are currently in.
If this is correct, then presumably this means that we will get odd effects
when flying over region boundaries? The application we are developing is a
helicopter simulator and our cliptexture covers the whole of Australia. We
really want to be able to fly between any two points without any region
boundary effects.
The cliptexture has 26 levels with high-res insets at 15cm resolution,
which means that we have only 2.0e-7 tex-coords per metre of geometry.
Does this mean we will need a lot of regions?
I guess the alternative is to adjust the tex coords at runtime - but
without using a texture matrix this is a daunting prospect!
Regards,
Ian Hawkes
Angus Dorbie <dorbie++at++sgi.com> on 13/10/2000 07:01:07
To: Ian Hawkes/AUST/CSC++at++CSC
cc: info-performer++at++sgi.com
Subject: Re: cliptexture wobble
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 26 2000 - 18:28:03 PDT