Skip to content

fix(GTAOPass): exclude Line2 objects from AO calculation #31422

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 15, 2025

Conversation

wyc001122
Copy link
Contributor

Description

This PR fixes a rendering issue where black squares appear at the world center when using Line2 objects with GTAOPass.

Problem:
When Line2 objects are present in a scene that uses GTAOPass for ambient occlusion, black artifacts (squares) appear at the world center during rendering.

Root Cause:
The GTAOPass's _overrideVisibility() method was not excluding Line2 objects from AO calculation. While Points and Line objects were already properly excluded, Line2 objects were inadvertently included in the ambient occlusion rendering pass, causing rendering artifacts.

Solution:
Added || object.isLine2 condition to the visibility override check in GTAOPass._overrideVisibility(). This ensures Line2 objects are treated consistently with other line-based objects (Points and Line) and are excluded from AO calculations.

Changes:

  • Modified examples/jsm/postprocessing/GTAOPass.js line 660 to include Line2 objects in the visibility override condition
  • Line2 objects now follow the same rendering behavior as Points and Line objects in GTAO passes

@Mugen87 Mugen87 merged commit f2e958a into mrdoob:dev Jul 15, 2025
8 checks passed
@Mugen87 Mugen87 added this to the r179 milestone Jul 16, 2025
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.

2 participants