From: Paolo Farinelli (paolo++at++sgi.com)
Date: 05/14/2002 15:17:28
Hi Yossi,
there are a few issues with cliptexture emulation, and I will be happy
to step you through them in order to get your app to work on the O2..
The first thing you could try, is to run clipfly with your .ct file.
This should work well enough and is a good starting point.
Please let me know if you have problems running clipfly with your data.
The main issue when using cliptexture emulation is the requirement for
pfGeoSets to cover small areas of the cliptexture. This is because the
cliptexture emulation implementation will render each pfGeoSet with a
single level from the cliptexture. This requires that the selected
cliplevel
provides full coverage for the entire pfGeoSet. Thus if a pfgeoSet is
too
large (in texcoord space), high resolution levels will never provide
full
coverage for it, and will never be used to render it.
The .ct loader is able to obtain optimal results using cliptexture
emulation by dynamically re-tesselating its geometry (flat earth) on
every frame. The geometry is cut in such a way that each donut-shaped
pfGeoSet is completely enclosed inside areas covered by consecutive
cliplevels, thus all valid levels of cliptexture are used for rendering.
I assume your code will not be doing this, but will use static geometry.
There are a few differences in setting up geometry to be used with an
emulated cliptexture. In particular, you should follow the following
order:
1. create your cliptexture using pfdLoadClipTexture()
2. set up pfGeoState, including gstate->setAttr(PFSTATE_TEXTURE,
cliptex);
3. set up pfGeoSets, including valid texture coordinates
4. you can now assign pfGeoState to pfGeoSets through gset->setGState
Note that step 3 above can also be done before step1 or before step2.
What should happen is that on step4, Performer will realize that geoset
will be rendered with an emulated cliptexture and will pre-compute
texture coordinate bounds for it. This will allow the correct selection
of an appropriate cliplevel on each frame.
For an example of an application using cliptexture emulation with
static geometry, take a look at
/usr/share/Performer/src/sample/C++/clipdemo/
Note that there is one line (222) in clipdemo.C that you may need to
change:
from: Shared->hwclip = (Shared->hwclip==PFQFTR_FALSE)? 0:1;
to: Shared->hwclip = (Shared->hwclip!=PFQFTR_FAST)? 0:1;
This has been fixed in Performer 2.5.2
Finally, it is worth noting that cliptexture emulation will not work
with
texture matrices, nor with texgen, as texcoords are needed (in CULL
proc)
for cliplevel selection.
I hope this helps.
Please let me know if you have further questions.
Best Regards,
Paolo
Yossi Kadosh wrote:
>
> Hi,
>
> I currently have a Performer 2.4 application that uses
> cliptexture and it works fine on Onyx machines.
>
> I compiled my application with the new Performer 2.5 and expected
> to see the cliptexture working on my O2 computer (using software emulation
> cliptexture),
> but I didn't notice any dynamic texture load.
> When starting my application, I received this message :
>
> getMaxClipSize : MachType17 BytesPerTexel 2 MaxClipSize 2048
> This System DOES NOT have hw support for cliptextures ! Using sw emulation.
> pfQueue::setSortMode : FORCING SORT MODE TO 0
>
> I think that the cliptexture emulation is actually not working at all in my
> application.
> I also do not understand what does SORT MODE mean ?
>
> Does anybody have an idea about how can I turn on the cliptexture emulation
> ?
> Do I have to add additional code for it , or should it work automatically
> with my actual code ?
>
> Thanks a lot,
>
> Yossi Kadosh, Computer Graphics Programmer, BVR Systems.
-- 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 : Tue May 14 2002 - 14:49:36 PDT