Re: QUESTION: 3D texture and Performer

New Message Reply Date view Thread view Subject view Author view

Allan Schaffer (aschaffe)
Thu, 21 Jul 1994 17:30:06 -0700


On Jul 16, 3:12pm, ohbuchi++at++trl.ibm.co.jp wrote:
> I am trying to implement 3D texture in a program based on Performer.
> How can a 3D texture be realized using Performer? Do I have to use
> IRIS-GL directly? I can't find the answers in the manuals (so far).

Performer doesn't handle 3D textures, so yes, you would need to make
direct calls to IRIS GL in one of the DRAW callbacks. For 3D texture
I'd presume you'd want to use a node's DRAW traversal callback.

> If somebody can provide me with a short example code, it will be
> much appreciated.

I don't have a sample handy (even in IRIS GL) that demonstrates 3D
texture, but you could probably use the same idea as for a reflection
mapped texture. Set up PreDrawCallback and PostDrawCallback routines
for a particular node (which will "contain" your 3D texture), and
bind them to the node with pfNodeTravFuncs:

  pfNodeTravFuncs (node, PFTRAV_DRAW, PreDrawCallback, PostDrawCallback);

In the pre-draw callback, turn the 3D texture "on" using IRIS GL;
turn it "off" in the post-draw callback. Take a look at the code in
/usr/src/Performer/src/lib/libpfutil/callbacks.c for a sample of
how the same thing is done for reflection-map texture.

As an aside, an upcoming issue of Pipeline (perhaps the July/August
issue) will have a long article on the topic of "Extending Performer"
by the use of callback routines. Keep an eye out..

Allan

-- 
Allan Schaffer
Silicon Graphics
aschaffe++at++sgi.com

New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:50:23 PDT

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.