Skip to content

Fix SOGS rendering scenes with SH 1 or 2 #7703

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

vincentwoo
Copy link
Contributor

@vincentwoo vincentwoo commented May 22, 2025

SOGS scenes with SH 1 or 2 do not render currently, owing to missing handlers for their spherical harmonics.

I confirm I have read the contributing guidelines and signed the Contributor License Agreement.

@willeastcott
Copy link
Contributor

Thanks for the PR, @vincentwoo! Would you be able to pop a PR description up too please? Thanks! 🙏

@willeastcott willeastcott requested a review from Copilot May 22, 2025 21:30
@willeastcott willeastcott added bug area: graphics Graphics related issue labels May 22, 2025
Copy link
Contributor

@Copilot 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 rendering issues with SOGS scenes by introducing overloaded versions of the readSHData function to handle different spherical harmonics (SH) vector depths.

  • Added a comment clarifying the function overload rationale.
  • Introduced two new overloads of readSHData for SH vector sizes of 8 and 3.

@@ -19,4 +21,30 @@ void readSHData(in SplatSource source, out vec3 sh[15], out float scale) {

scale = 1.0;
}

void readSHData(in SplatSource source, out vec3 sh[8], out float scale) {
Copy link
Preview

Copilot AI May 22, 2025

Choose a reason for hiding this comment

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

[nitpick] Overloading readSHData based solely on the out array length may lead to future confusion in overload resolution. Consider adding explicit comments or using distinct function names to clarify the intended usage of each overload.

Suggested change
void readSHData(in SplatSource source, out vec3 sh[8], out float scale) {
// Reads SH data for 8 coefficients
void readSHData8(in SplatSource source, out vec3 sh[8], out float scale) {

Copilot uses AI. Check for mistakes.

Copy link
Contributor

@mvaligursky mvaligursky left a comment

Choose a reason for hiding this comment

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

We'll need to fix WGSL shaders to match as well

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants