Skip to content

Conversation

@slimbuck
Copy link
Member

For scenes without spherical harmonics.

@slimbuck slimbuck requested review from a team and Copilot June 19, 2025 13:18
@slimbuck slimbuck self-assigned this Jun 19, 2025
@slimbuck slimbuck added bug Something isn't working area: graphics Graphics related issue labels Jun 19, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes the decompression behavior for scenes without spherical harmonics by ensuring that spherical harmonics image data (labels and centroids) is only read when applicable.

  • Moved the asynchronous image data reading for sh_labels and sh_centroids into a conditional block that checks if shBands > 0.
  • Removed the unnecessary reads outside the condition for scenes that do not use spherical harmonics.
Comments suppressed due to low confidence (2)

src/scene/gsplat/gsplat-sogs-data.js:240

  • Moving the readImageDataAsync call into the conditional block limits the processing to scenes with spherical harmonics. Please double-check that downstream code does not rely on sh_labels being initialized when shBands is 0.
            sh_labels._levels[0] = await readImageDataAsync(sh_labels);

src/scene/gsplat/gsplat-sogs-data.js:241

  • Ensure that moving the read for sh_centroids into the conditional block aligns with the expected behavior when spherical harmonics are not used and that no downstream functionality is adversely affected.
            sh_centroids._levels[0] = await readImageDataAsync(sh_centroids);

@slimbuck slimbuck merged commit 90fd1fe into playcanvas:main Jun 19, 2025
7 checks passed
@slimbuck slimbuck deleted the decompress-fxi branch June 19, 2025 13:23
slimbuck added a commit that referenced this pull request Jun 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: graphics Graphics related issue bug Something isn't working

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants