From Adrian Egli, "update the PSSM, i did some bug fixes and added new features to move the camera virtual against the view direction by applaying a simple distance factor (a), which is calculated camera eye - camera center distance. and we can move the "light camera" against the light direction (b).
(a) some objects behind the camera can cast shadow (b) object aboive the camera can cast shadow then i fixed the shadow map orientation, now screen x coordinate alinged which improve the quality"
This commit is contained in:
@@ -60,7 +60,10 @@ class OSGSHADOW_EXPORT ParallelSplitShadowMap : public ShadowTechnique
|
||||
/** Set the max far distance */
|
||||
inline void setMaxFarDistance(double farDist) { _setMaxFarDistance = farDist; _isSetMaxFarDistance = true; }
|
||||
|
||||
/** Force to add a osg::CullFace::FRONT state */
|
||||
/** Set the factor for moving the virtual camera behind the real camera*/
|
||||
inline void setMoveVCamBehindRCamFactor(double distFactor ) { _move_vcam_behind_rcam_factor = distFactor; }
|
||||
|
||||
/** Force to add a cull face front */
|
||||
inline void forceFrontCullFace() { _useFrontCullFace = true; }
|
||||
|
||||
/** Set min near distance for splits */
|
||||
@@ -158,7 +161,9 @@ class OSGSHADOW_EXPORT ParallelSplitShadowMap : public ShadowTechnique
|
||||
bool _useFrontCullFace;
|
||||
|
||||
double _split_min_near_dist;
|
||||
|
||||
|
||||
double _move_vcam_behind_rcam_factor;
|
||||
|
||||
bool _linearSplit;
|
||||
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user