Changeset 6058 for OpenSceneGraph/trunk/examples/osgshadow/osgshadow.cpp
- Timestamp:
- 01/27/07 13:54:58 (6 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/examples/osgshadow/osgshadow.cpp
r6055 r6058 329 329 osg::Vec4 diffuse(0.8,0.8,0.8,1.0); 330 330 osg::Vec4 zero_colour(0.0,0.0,0.0,1.0); 331 _lightpos.set(0.0, 0.0,1.0,0.0);331 _lightpos.set(0.0,1.0,0.0,0.0); 332 332 333 333 // first group, render the depth buffer + ambient light contribution … … 364 364 depth->setFunction(osg::Depth::LEQUAL); 365 365 _shadowVolumeStateSet->setAttribute(depth); 366 _shadowVolumeStateSet->setMode(GL_LIGHTING, osg::StateAttribute::O N| osg::StateAttribute::OVERRIDE);366 _shadowVolumeStateSet->setMode(GL_LIGHTING, osg::StateAttribute::OFF | osg::StateAttribute::OVERRIDE); 367 367 _shadowVolumeStateSet->setMode(GL_DEPTH_TEST, osg::StateAttribute::ON); 368 368 … … 407 407 _shadowedSceneStateSet->setAttribute(depth); 408 408 _shadowedSceneStateSet->setMode(GL_DEPTH_TEST, osg::StateAttribute::ON); 409 _shadowedSceneStateSet->setMode(GL_LIGHTING, osg::StateAttribute::ON | osg::StateAttribute::OVERRIDE);409 // _shadowedSceneStateSet->setMode(GL_LIGHTING, osg::StateAttribute::ON | osg::StateAttribute::OVERRIDE); 410 410 411 411 … … 434 434 blend->setFunction(osg::BlendFunc::ONE, osg::BlendFunc::ONE); 435 435 _shadowedSceneStateSet->setAttributeAndModes(blend, osg::StateAttribute::ON | osg::StateAttribute::OVERRIDE); 436 _shadowedSceneStateSet->setMode(GL_LIGHTING, osg::StateAttribute::ON | osg::StateAttribute::OVERRIDE);436 // _shadowedSceneStateSet->setMode(GL_LIGHTING, osg::StateAttribute::ON | osg::StateAttribute::OVERRIDE); 437 437 } 438 438 … … 453 453 } 454 454 455 //osg::notify(osg::NOTICE)<<std::endl<<std::endl<<"Cull callback"<<std::endl;455 // osg::notify(osg::NOTICE)<<std::endl<<std::endl<<"Cull callback"<<std::endl; 456 456 457 457 … … 476 476 ++itr) 477 477 { 478 osg::notify(osg::NOTICE)<<"bin num = "<<itr->first<<std::endl; 478 osg::notify(osg::NOTICE)<<" bin num = "<<itr->first<<std::endl; 479 osg::notify(osg::NOTICE)<<" new_bin->getStateGraphList().size()= "<<itr->second->getStateGraphList().size()<<std::endl; 480 osg::notify(osg::NOTICE)<<" new_bin->getRenderBinList().size()= "<<itr->second->getRenderBinList().size()<<std::endl; 481 osg::notify(osg::NOTICE)<<" new_bin->getRenderLeafList().size()= "<<itr->second->getRenderLeafList().size()<<std::endl; 482 479 483 } 480 484 #endif … … 520 524 new_rs->setColorMask(orig_rs->getColorMask()); 521 525 new_rs->setPositionalStateContainer(orig_rs->getPositionalStateContainer()); 522 #if 1 523 524 #if 0 525 osg::notify(osg::NOTICE)<<"orig_rs="<<orig_rs<<std::endl; 526 osg::notify(osg::NOTICE)<<"new_rs="<<new_rs<<std::endl; 527 #endif 526 528 527 if (shadowVolumeBin.valid()) 529 528 { … … 533 532 534 533 osg::ref_ptr<osgUtil::RenderBin> nested_bin = new_rs->find_or_insert(1,"RenderBin"); 535 nested_bin->getRenderBinList()[0] = new_bin; 534 nested_bin->getRenderBinList()[0] = new_bin; 535 nested_bin->setStateSet(_shadowedSceneStateSet.get()); 536 } 537 538 #if 0 539 osg::notify(osg::NOTICE)<<"After setup"<<std::endl; 540 osg::notify(osg::NOTICE)<<"new_bin->getStateGraphList().size()= "<<new_bin->getStateGraphList().size()<<std::endl; 541 osg::notify(osg::NOTICE)<<"new_bin->getRenderBinList().size()= "<<new_bin->getRenderBinList().size()<<std::endl; 542 osg::notify(osg::NOTICE)<<"new_bin->getRenderLeafList().size()= "<<new_bin->getRenderLeafList().size()<<std::endl; 543 544 545 for(osgUtil::RenderBin::RenderBinList::iterator itr = new_bin->getRenderBinList().begin(); 546 itr != new_bin->getRenderBinList().end(); 547 ++itr) 548 { 549 osg::notify(osg::NOTICE)<<" bin num = "<<itr->first<<std::endl; 550 osg::notify(osg::NOTICE)<<" new_bin->getStateGraphList().size()= "<<itr->second->getStateGraphList().size()<<std::endl; 551 osg::notify(osg::NOTICE)<<" new_bin->getRenderBinList().size()= "<<itr->second->getRenderBinList().size()<<std::endl; 552 osg::notify(osg::NOTICE)<<" new_bin->getRenderLeafList().size()= "<<itr->second->getRenderLeafList().size()<<std::endl; 536 553 537 nested_bin->setStateSet(_shadowedSceneStateSet.get()); 538 539 #if 0 540 osg::notify(osg::NOTICE)<<"shadowVolumeBin="<<shadowVolumeBin.get()<<std::endl; 541 osg::notify(osg::NOTICE)<<"nested_bin="<<nested_bin.get()<<std::endl; 542 #endif 543 } 554 } 555 osg::notify(osg::NOTICE)<<std::endl; 544 556 #endif 545 557
