Skip to content

Fix acne in PointLightShadowFilter (#2866) - #3086

Open
adrian-andrzjewski wants to merge 2 commits into
jMonkeyEngine:masterfrom
adrian-andrzjewski:codex/issue-2866-point-shadow-filter-acne
Open

adrian-andrzjewski wants to merge 2 commits into
jMonkeyEngine:masterfrom
adrian-andrzjewski:codex/issue-2866-point-shadow-filter-acne

Conversation

@adrian-andrzjewski

@adrian-andrzjewski adrian-andrzjewski commented Nov 14, 2026 •

Copy link
Copy Markdown

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

  • Focused :jme3-core:test shadow tests: 5 tests passed across FilterPostProcessingTest and ShadowCompareModeFallbackTest.
  • OpenGL 4.5 visual reproduction on an RTX 2060 SUPER: the before image shows the point-light shadow acne stripes; the after image confirms they are cleared.

PointLightShadowFilter before and after fix

Closes #2866

@jaime-jmebot jaime-jmebot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Shadow acne with PointLightShadowFilter

2 participants