Still have problem for per-pixel spotlight

New Message Reply Date view Thread view Subject view Author view

Cao Zhigang (czg++at++iname.com)
Mon, 20 Oct 1997 00:11:26 -0700


Hello pfFriends,
I try to make per-pixel spotlight on my machine
( iR/IRIX6.2/pf2.1/OpenGL ) and get help from
many friends. But the scene looks like per-vertex
spotlight, NOT PER-PIXEL spotlight. I copied the
code bellow. Please help me.

Thanks

Cao Zhigang
  
 ===================================
 E-Mail: czg++at++iname.com
 Tel: (8610)68428861-340
 Fax: (8610)68424844
 ===================================

void
initEnvironment(void)
{
    pfEarthSky *es;

    pfFrustum *shadFrust;
    pfLightSource *proj;
    pfDCS *shadDCS, *projDCS;
    pfTexture *tex;

    /* Create and configure shadow frustum */
    shadFrust = pfNewFrust(pfGetSharedArena());
    pfMakeSimpleFrust(shadFrust, 1.0f);
    pfFrustNearFar(shadFrust, 10.0f, 10000.0f);
     
    /* Create and configure red spotlight */
    proj = pfNewLSource();
    tex = pfNewTex(pfGetSharedArena());
    pfLoadTexFile(tex, "spotlight.inta");
    pfLSourceMode(proj, PFLS_PROJTEX_ENABLE, 1);
    pfLSourceAttr(proj, PFLS_PROJ_FRUST, shadFrust);
    pfLSourceAttr(proj, PFLS_PROJ_TEX, tex);
    pfLSourceColor(proj, PFLT_DIFFUSE, 1.0f, 0.0f, 0.0f);
    pfLSourceVal(proj, PFLS_INTENSITY, 1.0f);
    pfLSourcePos(proj, 0.0f, 0.0f, 1000.0f, 1.0f);
    pfSpotLSourceDir(proj, 1.0f, 0.0f, 1.0f);

    /* Add to DCSes so we can move lights around */
    projDCS = pfNewDCS();
    pfAddChild(projDCS, proj);
    pfAddChild(ViewState->scene, projDCS);

    /* Enable emissive pass since scene has emissive surfaces */
    pfChanTravMode(ViewState->masterChan, PFTRAV_MULTIPASS,
                         PFMPASS_EMISSIVE_PASS|PFMPASS_GLOBAL_AMBIENT);

}
=======================================================================
List Archives, FAQ, FTP: http://www.sgi.com/Technology/Performer/
            Submissions: info-performer++at++sgi.com
        Admin. requests: info-performer-request++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:56:06 PDT

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