Hi..
heres the problem in short:
Im doing some massive shaddow mapping with many lights. So.. i setup a
shaddowmap atlas.
This went fine with my old card - geforce 5600.
With my new card 7600gt i have some problems when adding 21... instead of 20
shaddow maps.
What happens then?
 - the shaddowmap gets bad entries outside of the used map space (not really
a problem, but doesnt happen with 20)
- every few frames. the program halts and the whole atlas gets strange
entries.

Im complety out of options and dont know how i should proceed further.. so i
really appreciate any help.

thanks.. Tobi

(using osg 1.2 win32 pre-build release on winxp)


to make it easier to see the problem, i moddified the depthshaddow example
by
replacing

// set up the render to texture camera.
{ everyting witin brakkets
}

by

int ncams = 20; // 21 is bad for me
// create the texgen node to project the tex coords onto the subgraph
osg::TexGenNode* texgenNode = new osg::TexGenNode;
texgenNode->setTextureUnit(unit);
group->addChild(texgenNode);
CameraNode* cam;
int xact = 0;
int yact = 0;
int i;
for(i=0;i<ncams;i++){
cam = new CameraNode;
cam->setClearMask(GL_DEPTH_BUFFER_BIT);
cam->setClearColor(osg::Vec4(1.0f,1.0f,1.0f,1.0f));
cam->setComputeNearFarMode(osg::CameraNode::DO_NOT_COMPUTE_NEAR_FAR);
cam->setViewport( xact, yact, 64,64);
osg::StateSet* _local_stateset = cam->getOrCreateStateSet();
_local_stateset->setMode(GL_LIGHTING, osg::StateAttribute::OFF);
float factor = 0.0f;
float units = 1.0f;
ref_ptr<PolygonOffset> polygon_offset = new PolygonOffset;
polygon_offset->setFactor(factor);
polygon_offset->setUnits(units);
_local_stateset->setAttribute(polygon_offset.get(), StateAttribute::ON |
StateAttribute::OVERRIDE);
_local_stateset->setMode(GL_POLYGON_OFFSET_FILL, StateAttribute::ON |
StateAttribute::OVERRIDE);
ref_ptr<CullFace> cull_face = new CullFace;
cull_face->setMode(CullFace::FRONT);
_local_stateset->setAttribute(cull_face.get(), StateAttribute::ON |
StateAttribute::OVERRIDE);
_local_stateset->setMode(GL_CULL_FACE, StateAttribute::ON |
StateAttribute::OVERRIDE);
cam->setRenderOrder(osg::CameraNode::PRE_RENDER);
cam->setRenderTargetImplementation(osg::CameraNode::FRAME_BUFFER_OBJECT);
cam->attach(osg::CameraNode::DEPTH_BUFFER, texture);
cam->addChild(shadowed);
group->addChild(cam);
//cam->setViewMatrixAsLookAt(Vec3(100.0, 0, 0.0), Vec3(0.0, 0.0, 0.0),
Vec3(0, 1, 0));
//cam->setProjectionMatrixAsOrtho( -100, 100, -100, 100, 1.0f, 200.0f);
group->setUpdateCallback(new UpdateCameraAndTexGenCallback(light_transform,
cam, texgenNode));
//realcams[i] = cam;
// new scanline?
xact +=64;
if(xact>=tex_width){
xact =0;
yact+=64;
}
}

_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to