From: Marcin Romaszewicz (marcin++at++sgi.com)
Date: 04/18/2002 16:48:17
The only way to do this right now is to create your own draw callback and
call pfDraw twice from it, which will draw the scene two times. If you
only want to draw a piece of your scene twice, use draw bins. These are
documented in the pfChannel and pfGeoSet man pages.
Now for the interesting part - how to change texture coordinates. First,
the easy possibility - If your second texture coordinates can be
generated from the first with a texture matrix, do that. You can apply a
texture matrix in the draw callback and then use a pfOverride to force all
geostates applied afterwards to use it.
Now for the hard case. What you could do is to create multiple copies of
your geosets. All the copies would point to the same vertex, normal and
color data, but would differ in texture coordinates. What you would do is
put all the copies together under the same geodes, but place them into
separate bins. The key here is to never call pfDraw in your draw callback,
which would force all of them to be drawn. Your draw callback should call
pfDrawBin for the first set of geosets, second set and so forth. When
drawing bins, don't forget to call pfDrawBin at least once for bins -1 (the
default bin if none is specified), PFSORT_OPAQUE_BIN and PFSORT_TRANSP_BIN.
The above case works for pre-computed texture coordinates. If you are
trying to compute new ones on the fly, things get really "interesting",
especially with multiple-pipes. If this is what you're trying, tell me and
I'll try to come up with a way to do it.
-- Marcin
On Thu, 18 Apr 2002, Yossi Kadosh wrote:
> Hey,
> While adding a new feature to an existing project, I encountered
> a problem that I do not know how to overcome, how can I render
> my scene twice ( multipasssss ) with tow different sets of texture
> coords ?
>
> Thanks for a quick response,
> Ran Amir B.V.R
> ran++at++bvr.co.il
> axelen++at++rocketmail.com
>
This archive was generated by hypermail 2b29 : Thu Apr 18 2002 - 16:48:28 PDT