pfString

New Message Reply Date view Thread view Subject view Author view

From: Larry Ramey (ramey++at++de-solutions.com)
Date: 01/12/2000 10:48:31


We have an environment where lighting is under user control. What we
don't want is for the user to be able to "wash" the control panels by
cranking up a bunch of lights. We want the user panels to be lighting
independent....so I had the brilliant idea of turning light off for that
section of the scene graph and using emissive values in the material.
(If AMBIENT and DIFFUSE track color and color is (0 0 0 1) then only the
emissive values should contribute)

Well it didn't work.

Here is what I tried:

// set string attributes
        m_string->setFont( m_font );
        m_string->setString( text.data() );
        
        pfMaterial* mat = new(pfGetSharedArena()) pfMaterial;
        mat->setAlpha(color.getAlpha());
        mat->setShininess(0);
        mat->setColorMode(PFMTL_BOTH,PFMTL_CMODE_OFF);
        mat->setSide(PFMTL_BOTH);
        mat->setColor(PFMTL_AMBIENT,0,0,0);
        mat->setColor(PFMTL_DIFFUSE,0,0,0);
        mat->setColor(PFMTL_SPECULAR,0,0,0);

mat->setColor(PFMTL_EMISSION,color.getRed(),color.getGreen(),color.getBlue());
        

        pfGeoState* gState = new(pfGetSharedArena()) pfGeoState;
        gState->setAttr(PFSTATE_ENLIGHTING,PF_OFF);
        //gState->setAttr(PFSTATE_ANTIALIAS,PFAA_ON);
        gState->setAttr(PFSTATE_FRONTMTL,mat);
        gState->setAttr(PFSTATE_BACKMTL,mat);
        gState->setMode(PFSTATE_CULLFACE, PFCF_OFF);
        gState->setMode(PFSTATE_TRANSPARENCY, PFTR_BLEND_ALPHA );

        m_string->setGState(gState);

DIDN'T DO JACK!!!!!!!!! I got nothing, unlit strings.

So I did this evil hack,

//##################HACK WARNING!!!#######################
// I just CAN'T make Performer listen to reason
        pfGeoSet* chr = (pfGeoSet*)m_string->getCharGSet(0);
        chr->setGState(gState);

But this is foul beyond all belief. Any ideas why pfString is ignoring
the attached GoeState? The funny thing is that the GeoSets for each
character had a NULL GeoState until I hacked one in there.

---------------------------------------------------------------
Larry E. Ramey ramey++at++de-solutions.com
"I eat weirder things than you in my cereal" - Zaphod Bebblebrox
"Can't talk to a Psycho like a normal human being" - Poe


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Wed Jan 12 2000 - 10:48:43 PST

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