- Timestamp:
- 03/21/12 18:36:20 (15 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/src/osgShadow/ParallelSplitShadowMap.cpp
r12597 r13041 109 109 110 110 111 // filter the shadow (look up) 3x3 111 // filter the shadow (look up) 3x3 112 112 // 113 113 // 1 0 1 114 // 0 2 0 115 // 1 0 1 114 // 0 2 0 115 // 1 0 1 116 116 // 117 117 // / 6 … … 123 123 sstr << " float shadow3" << i <<" = shadow2D( shadowTexture" << i <<",gl_TexCoord[" << (i+textureOffset) <<"].xyz+vec3(-fTexelSize, fTexelSize,fZOffSet) ).r;" << std::endl; 124 124 125 sstr << " float shadow" << i <<" = ( 2.0*shadowOrg" << i 126 <<" + shadow0" << i 127 <<" + shadow1" << i 128 <<" + shadow2" << i 129 <<" + shadow3" << i 125 sstr << " float shadow" << i <<" = ( 2.0*shadowOrg" << i 126 <<" + shadow0" << i 127 <<" + shadow1" << i 128 <<" + shadow2" << i 129 <<" + shadow3" << i 130 130 << ")/6.0;"<< std::endl; 131 131 … … 372 372 stateset->setAttribute(polygon_offset.get(), osg::StateAttribute::ON | osg::StateAttribute::OVERRIDE); 373 373 stateset->setMode(GL_POLYGON_OFFSET_FILL, osg::StateAttribute::ON | osg::StateAttribute::OVERRIDE); 374 } 374 } 375 375 376 376 … … 747 747 748 748 749 void ParallelSplitShadowMap::calculateFrustumCorners(PSSMShadowSplitTexture &pssmShadowSplitTexture, osg::Vec3d *frustumCorners) 749 void ParallelSplitShadowMap::calculateFrustumCorners(PSSMShadowSplitTexture &pssmShadowSplitTexture, osg::Vec3d *frustumCorners) 750 750 { 751 751 // get user cameras … … 776 776 // double minNear = camNear; 777 777 double camNearFar_Dist = maxFar - camNear; 778 if ( _SplitCalcMode == SPLIT_LINEAR ) 778 if ( _SplitCalcMode == SPLIT_LINEAR ) 779 779 { 780 780 camFar = camNear + (camNearFar_Dist) * ((double)(pssmShadowSplitTexture._splitID+1))/((double)(_number_of_splits)); … … 791 791 double* pSplitDistances =new double[_number_of_splits+1]; 792 792 793 for(int i=0;i<(int)_number_of_splits;i++) 793 for(int i=0;i<(int)_number_of_splits;i++) 794 794 { 795 795 double fIDM=(double)(i)/(double)(_number_of_splits); … … 840 840 { 841 841 pssmShadowSplitTexture._frustumSplitCenter = frustumCorners[0]; 842 for(int i=1;i<8;i++) 842 for(int i=1;i<8;i++) 843 843 { 844 844 pssmShadowSplitTexture._frustumSplitCenter +=frustumCorners[i];
