-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
base: main
Are you sure you want to change the base?
Conversation
…WGSL (playcanvas#7702) Co-authored-by: Martin Valigursky <[email protected]>
Thanks for the PR, @vincentwoo! Would you be able to pop a PR description up too please? Thanks! 🙏 |
There was a problem hiding this 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) { |
There was a problem hiding this comment.
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.
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.
There was a problem hiding this 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
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.