Fernando D. Mato Mira (matomira++at++lig.di.epfl.ch)
Fri, 19 Aug 94 16:25 MDT
Is there a way of altering the current material without
doing pfApplyMtl, but by calling lmdef(DEFMATERIAL ...
If so,
a) How do I get the current material index (to use in the lmdef) ?
b) Will this get restored after subsequent pfPushState/ pfPopState
(I doubt it).
Otherwise, if do:
pfPushState();
mat = pfGetCurMtl(side);
modify mat
pfApplyMtl(mat);
Will this alter the previous entry in the stack or will it really create
a new material context?
The reason why is ask this is because I want to avoid allocating/copying
/modifying/ref checking/returning to material pool materials to be used
in draw callbacks (because of pipe latency, if the material associated
with a node (interior node, I use callbacks) gets modified in the app,
I can't just modify the structure).
I have closures (lisp), so it's easy for me to pass a callback that just
looks into some variables (instead of having to pass a `data' block).
Even if I passed some data block, avoiding using a pfMaterial means
I do not have to check in the post callback if the material is different,
checking ref (several callbacks could use the same pfMaterial) and
freeing, but just letting the lisp garbage collector take care of freeing
the closure (OK, I still have to keep a refcount on closures and check
on the post, because it could happen that the callback for a node is
changed, this was the only one to have it, and there's still a frame
down the pipe (in the C side) that needs it).
Also, like this a node could also alter one property (let's say,
front material specular), although if I have to do pfApplyMtl(mat);
I do not gain anything there, but if the attribute is highly animated,
I do not need to go copying full materials every frame, at least.
P.S. : If anybody sent me some info on Modelgen or DWB, or wrote it
to this list, I didn't get anything, I got some Mail problem
today (/usr/tmp full, Mail ate my mailbox, no mailer-daemon warnings
to the world).
Thanks,
Fernando D. Mato Mira
Computer Graphics Lab
Swiss Federal Institute of Technology (EPFL) Phone : +41 (21) 693 - 5248
CH-1015 Lausanne FAX : +41 (21) 693 - 5328
Switzerland E-mail : matomira++at++di.epfl.ch
This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:50:29 PDT