You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So far, we use OffsetCSMShadowNode to get CSM effect in a scene. We can pass some parameters to this node when constructing. In the file https://github.com/mrdoob/three.js/blob/dev/examples/jsm/csm/CSMShadowNode.js#L369OffsetCSMShadowNode update transfrom of each internal light in each frame. but the frustum value(.left, .top, far...) of shadow map camera doesn't update, which clones from the main light at the begining.
Solution
Because the frustum of each shadow camera may be bigger or smaller than the view frustum, It may cause a waste of shadow map or lost some shadow area. I think we should calculate the best fit frustum for shadow map automatically in three.js.
I've tested some way to get it. some code like this: ligaofeng0901@2a00ba9
It can get a better tight box for shadow camera, get better quality of shadow.
Alternatives
But there are more sitiuation should be considered, the box should be a little bigger than the tight one, but the margin of each box should not be a constant. Also, if .fade is true, some blank area will appear.
Additional context
No response
The text was updated successfully, but these errors were encountered:
Description
So far, we use
OffsetCSMShadowNode
to get CSM effect in a scene. We can pass some parameters to this node when constructing. In the file https://github.com/mrdoob/three.js/blob/dev/examples/jsm/csm/CSMShadowNode.js#L369OffsetCSMShadowNode
update transfrom of each internal light in each frame. but the frustum value(.left
,.top
,far
...) of shadow map camera doesn't update, which clones from the main light at the begining.Solution
Because the frustum of each shadow camera may be bigger or smaller than the view frustum, It may cause a waste of shadow map or lost some shadow area. I think we should calculate the best fit frustum for shadow map automatically in
three.js
.I've tested some way to get it. some code like this: ligaofeng0901@2a00ba9
It can get a better tight box for shadow camera, get better quality of shadow.
Alternatives
But there are more sitiuation should be considered, the box should be a little bigger than the tight one, but the margin of each box should not be a constant. Also, if
.fade
is true, some blank area will appear.Additional context
No response
The text was updated successfully, but these errors were encountered: