some enchancements for shadowmapping

new /= operator in point4f
_calcClipSpaceAABB in pssm no longer uses radius just transform points into light space and do min max
_roundProjection matrix also optimized.
This commit is contained in:
marauder2k7 2024-12-09 17:54:48 +00:00
parent 03a348deb7
commit 80bd8f8117
3 changed files with 66 additions and 63 deletions

View file

@ -58,7 +58,7 @@ protected:
Box3F _calcClipSpaceAABB(const Frustum& f, const MatrixF& transform, F32 farDist);
void _calcPlanesCullForShadowCasters(Vector< Vector<PlaneF> > &out, const Frustum &viewFrustum, const Point3F &_ligthDir);
void _roundProjection(const MatrixF& lightMat, const MatrixF& cropMatrix, Point3F &offset, U32 splitNum);
void _adjustScaleAndOffset(Box3F& clipAABB, Point3F& scale, Point3F& offset);
static const S32 MAX_SPLITS = 4;
U32 mNumSplits;
F32 mSplitDist[MAX_SPLITS+1]; // +1 because we store a cap