Re: Colour alteration with cloned nodes
John Rohlf (jrohlf++at++tubes)
Mon, 16 May 94 14:20:04 PDT
>
>
> Hi All,
>
> My application involves a two pass rendered scene. The first pass the application
> draws the scene as it is (i.e. as it was modeled in MultiGen with textures, rgb colours
> for each vertex, etc.). In the second pass I would like to draw the scene with a single
> texture (using texgen) and a single colour. To draw the scene twice I have cloned the
> database. Enforcing the database to use a single texture is easy, using the an override
> command as shown bellow:
>
> pfApplyTEnv(env);
> pfApplyTex(missjan);
> pfOverride(PFSTATE_ENTEXTURE | PFSTATE_TEXTURE, PF_ON);
>
> /* draw the scene */
>
> pfOverride(PFSTATE_ENTEXTURE | PFSTATE_TEXTURE, PF_OFF);
>
> However can I do the same for the colour? It would be nice if I could call
> say "pfApplyColor()" and then use pfOverride() to lock the colour in the GeoSets.
>
> Meanwhile I am loading the database twice. On the second loaded db I run a pre-process
> traversal which alters the existing colours in the GeoSets to the desired uniform colour.
>
You are doing the right thing for the texture but there is no
analogy for overriding color. However, if your database is lit, you can
override a material of the color you want. You'll have to disable color mode
on the material: pfMtlColorMode(mtl, PFMTL_BOTH, PFMTL_CMODE_COLOR)
so subsequent colors are ignored. If your database is not lit, then you'll
have to modify the above technique somewhat.
This archive was generated by hypermail 2.0b2
on Mon Aug 10 1998 - 17:50:16 PDT