From: Paolo Farinelli (paolo++at++sgi.com)
Date: 11/06/2002 14:32:39
Hi again Kevin,
I just thought of something else that could be the cause for emulated
cliptextures not working:
You must enable sorting on your pfChannels.
This is because cliptexture emulation does its per-gset computation
when Cull Programs are carried out, in the CULL process. If sorting
is disabled for a channel, no Cull Programs will take place, and
cliptexture emulation will not work either.
If you look at /usr/share/Performer/src/sample/C++/clipdemo/clipdemo.C,
you will see the following:
// channel sorting must be ON for emulated cliptextures to work
if( Shared->hwclip )
chan_main[i]->setTravMode(PFTRAV_CULL, PFCULL_VIEW|PFCULL_GSET);
else
chan_main[i]->setTravMode(PFTRAV_CULL,
PFCULL_VIEW|PFCULL_GSET|PFCULL_SORT);
So, once again my advice is to try running the clipdemo sample program,
then try
to spot things you may be doing differently in your own app.
ciao,
Paolo
Paolo Farinelli wrote:
> Hi Kevin,
>
> cliptexture emulation uses a single mipmapped texture for all non-clipped
> levels (up to clipsize), and one non-mipmapped texture for each
> clipped level.
> If cliptexture emulation is not active, gset will still display base
> texture with
> all LODs up to (and including) size clipsize.
>
> So the fact that you are only seeing levels from the single
> base-texture does not
> mean cliptex emulation is working.
>
> I am still inclined to think that perhaps your geosets are not
> recognized as
> being cliptextured (see my previous email).
>
> Please try running/modifying the clipdemo sample program in
> /usr/share/Performer/src/sample/C++/clipdemo
>
> This does everything we talked about:
> . creates a regular grid of geosets, each one mapping a small portion
> of the cliptexture
> . creates pfClipTexture and pfMPClipTexture objects
> . creates geostate and associates it with cliptexture
> . assignes geostate to gsets
>
> It will also include other necessary functions, such as:
> pfuAddMPClipTextureToPipes(),
> and will demonstrate how to update clipcenter position (in function
> UpdateClipCenter,
> in file dbase.C).
>
> HINT: I find it very hard to navigate when running the clipdemo
> application. The problem
> is that the cliptextured terrain is not visible initially, and you may
> think things are not
> working even though they are. So, make sure you are able to navigate
> to a position where
> the terrain is visible. I have added a print statement (to my copy of
> clipdemo.C) that will
> display current xyzhpr on each frame, and then place the mouse at the
> center-top of my
> window, until pitch falls to around -90.0, at which point I can see
> the terrain.
>
> Let me know if clipdemo compiles and runs properly on your system(s)..
> once you get
> clipdemo to run, you should look for what you are doing differently in
> your own code..
>
> Hope this helps.
> ciao,
> Paolo
>
>
>
> K. Chugh wrote:
>
>> hi paolo. i'm doing this exactly with no luck. i set up a .01
>> texture space grid and same problem. just to clarify, it's not that
>> i'm only seeing one LOD, i'm only seeing the non-tiled LODs, that is,
>> the LODs that are smaller than the clipsize. i fly around and the
>> texture changes, but only among these LODs. i substituted a simple
>> texture for the cliptexture and am getting about the same
>> performance, but i'll implement statistics to be sure. but, the fact
>> that i'm seeing multiple LODs implies that cliptexturing is working
>> but just not the tiled levels right?
>> one more question- the clipcenter is automatically updated for you,
>> or you can write your own updateclipcenter function- do you have to
>> tell performer that you'll be updating the clipcenter manually? i'd
>> like to avoid wasting the time for performer doing it, then me
>> overriding it.
>> thanks again for your help.
>>
>> kevin
>>
>>> If you divide your geometry into 100 x 100 tiles, you'll have 10,000
>>>
>>> geosets,
>>> and each one will occupy a 0.01 x 0.01 in texture space. This should
>>>
>>> guarantee
>>> that as you move your clipcenter around, different resolutions will
>>> be used to
>>> render different gset
>>>
>>
>> ...
>>
>>> You should be calling gset->setGState(gstate) AFTER having created
>>> and
>>> configured the emulated cliptexture (pfdLoadClipTexture, new
>>> pfMPClipTexture,
>>> mpcliptex->setClipTex(),.. ), and AFTER having assigned the emulated
>>>
>>> cliptexture
>>> to the geostate through gstate->setAttr(PFSTATE_TEXTURE,cliptex),
>>> and
>>> gstate->setMode(PFSTATE_ENTEXTURE, PF_ON);
>>>
>>> If you link gstate to gsets before cliptexture is associated with
>>> gstate, the cte
>>> implementation will not mark gsets as 'cliptextured' and cliptex
>>> emulation
>>> will not work.
>>>
-- 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 : Wed Nov 06 2002 - 14:32:45 PST