Further work on occludision code.
This commit is contained in:
@@ -100,14 +100,23 @@ void CollectOccludersVisitor::apply(osg::OccluderNode& node)
|
||||
// list, if so disable the appropriate ShadowOccluderVolume
|
||||
disableOccluder(_nodePath);
|
||||
|
||||
std::cout<<"CollectOccludersVisitor:: We have found an Occlusion node in frustum"<<&node<<std::endl;
|
||||
|
||||
|
||||
if (isCulled(node)) return;
|
||||
|
||||
std::cout<<"CollectOccludersVisitor:: We have found an Occlusion node in frustum"<<&node<<std::endl;
|
||||
|
||||
// push the culling mode.
|
||||
pushCurrentMask();
|
||||
|
||||
|
||||
if (node.getOccluder()&& !isCulled(node.getOccluder()->getOccluder().getVertexList()))
|
||||
{
|
||||
|
||||
// need to test occluder against view frustum.
|
||||
std::cout << " adding in Occluder"<<std::endl;
|
||||
_occluderList.push_back(ShadowVolumeOccluder(_nodePath, *node.getOccluder(), getModelViewMatrix()));
|
||||
}
|
||||
|
||||
traverse(node);
|
||||
|
||||
// pop the culling mode.
|
||||
|
||||
@@ -58,7 +58,7 @@ CXXFILES =\
|
||||
Projection.cpp\
|
||||
Quat.cpp\
|
||||
ShadeModel.cpp\
|
||||
ShadowOccluderVolume.cpp\
|
||||
ShadowVolumeOccluder.cpp\
|
||||
State.cpp\
|
||||
StateSet.cpp\
|
||||
Stencil.cpp\
|
||||
|
||||
@@ -5,6 +5,22 @@ using namespace osg;
|
||||
|
||||
void ShadowVolumeOccluder::computeOccluder(const NodePath& nodePath,const ConvexPlanerOccluder& occluder,const Matrix& MVP)
|
||||
{
|
||||
std::cout<<" Computing Occluder"<<std::endl;
|
||||
}
|
||||
|
||||
bool ShadowVolumeOccluder::contains(const std::vector<Vec3>& vertices)
|
||||
{
|
||||
if (_occluderVolume.containsAllOf(vertices))
|
||||
{
|
||||
for(HoleList::iterator itr=_holeList.begin();
|
||||
itr!=_holeList.end();
|
||||
++itr)
|
||||
{
|
||||
if (itr->contains(vertices)) return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ShadowVolumeOccluder::contains(const BoundingSphere& bound)
|
||||
Reference in New Issue
Block a user