zondag 18 mei 2008

code changes

I've rewritten certain parts of the code, mainly 'alWorld.cpp', alShadowmap.cpp, and alCamera.cpp.
before alWorld had 2 arraylists, containing both deferred and forward shaded polys. I've moved this variables to the alCamera.h so every camera has it's own set of visible polygons..much more easier to maintain. Since i can query frustum calls directly from the camera class.
plus it is easier to create special effects like mirrors, portals.
I hope to implement shadowmapping today.


void alWorld::doShadowPass(alLight* light)
{
//setup matrices for this light
if(light->setupMatrices())
{
alShadowMap *map = light->getShadowMap();
//render to FBO(depth only)
map->begin();
alCamera * cam = map->getCamera();
//get intersecting polys
fillPolys(cam);
//fill depth buffer
zOnlyPass(cam);
//end fbo
map->end();
//wxLogMessage(_T("NumPolys is %d"), cam->getDeferredPolys()->size());
}
}

Geen opmerkingen: