Repository navigation
Fix acne in PointLightShadowFilter (#2866) - #3086
adrian-andrzjewski wants to merge 2 commits into
Conversation
jaime-jmebot
left a comment
There was a problem hiding this comment.
Hi Adrian, thanks for putting together this fix and including both the focused test results and a visual reproduction. The change keeps the reconstructed receiver position intact for the filter calculations, while consistently using the small, capped lightward offset for the point-shadow lookup coordinates in both shader variants. That makes the bias apply to the comparison without perturbing the other calculations, and the zero-distance guard avoids normalizing a degenerate light-to-receiver vector.
I reviewed the paired shader changes and their surrounding point-light lookup flow. I don’t see a correctness issue with this approach, and it’s good to have the multisample and non-multisample paths kept in sync. The reported tests and visual check provide useful coverage for a rendering artifact like this. Looks good to me—thanks for addressing the acne report!
Fix
Point light shadow lookups could self-shadow receivers at grazing angles. Apply a small receiver-distance-scaled bias, capped at 0.01 world units, to shadow lookup positions in both point-light post-filter shaders. The receiver's original world position remains unchanged for filter calculations.
Validation
:jme3-core:testshadow tests: 5 tests passed acrossFilterPostProcessingTestandShadowCompareModeFallbackTest.Closes #2866