From: Frank Hartman (Frank.Hartman++at++jpl.nasa.gov)
Date: 01/27/2005 09:10:45
faculaganymede,
Not sure what your setup is but we have had good luck shadow mapping on our NVidia cards under RH Linux. I think we just copied from projective.c but here is our shadow setup code:
--------------------------------------------------------------------
Shared->Sun = new pfLightSource();
Shared->Sun->setPos(-5.0f, -5.0f, -5.0f, 0.0f);
Shared->Sun->setAmbient(0.0f, 0.0f, 0.0f);
// Set up shadowing
Shared->Sun->setSpotDir(1.0, 1.0, 1.0);
pfFrustum *frust = new pfFrustum();
frust->makeSimple(60.0f);
Shared->Sun->setAttr(PFLS_PROJ_FRUST, frust);
Shared->Sun->setVal(PFLS_SHADOW_SIZE, 512);
Shared->Sun->setVal(PFLS_SHADOW_DISPLACE_SCALE, 1.0);
Shared->Sun->setVal(PFLS_SHADOW_DISPLACE_OFFSET, 0.002);
------------------------------------------------------------------
Shadows are turned on by:
-------------------------------------------------------------------
if(Shared->drawShadows) {
Shared->Sun->setMode(PFLS_SHADOW_ENABLE, PF_ON);
} else {
Shared->Sun->setMode(PFLS_SHADOW_ENABLE, PF_OFF);
}
--------------------------------------------------------------------
Hope this helps,
Frank
This archive was generated by hypermail 2b29 : Thu Jan 27 2005 - 09:11:08 PST