Gaussian Splatting: Use half-precision for spherical harmonics evaluation on WebGPU#8441
Merged
mvaligursky merged 1 commit intomainfrom Feb 4, 2026
Merged
Gaussian Splatting: Use half-precision for spherical harmonics evaluation on WebGPU#8441mvaligursky merged 1 commit intomainfrom
mvaligursky merged 1 commit intomainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR optimizes spherical harmonics evaluation in Gaussian Splatting by converting it to use half-precision (f16) types on WebGPU, reducing memory usage and improving performance on GPUs with native f16 support.
Changes:
- Updated spherical harmonics evaluation to use half-precision types (half3, half4, half) throughout the computation pipeline
- Modified all SH data readers (uncompressed, compressed, and SOG formats) to output half3 coefficients
- Converted all SH constants and intermediate calculations to use half precision with automatic fallback to f32 on unsupported devices
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/scene/shader-lib/wgsl/chunks/gsplat/vert/gsplatEvalSH.js | Converts SH evaluation function to use half precision for constants, intermediate calculations, and array types; returns vec3f for compatibility |
| src/scene/shader-lib/wgsl/chunks/gsplat/vert/gsplat.js | Updates SH coefficient array declaration from vec3f to half3 in vertex shader |
| src/scene/shader-lib/wgsl/chunks/gsplat/vert/formats/uncompressedSH.js | Modifies readSHData functions to output half3 arrays with explicit half3 constructors for all three SH_BANDS configurations |
| src/scene/shader-lib/wgsl/chunks/gsplat/vert/formats/sogSH.js | Updates SOG format reader to output half3 coefficients with proper type conversion |
| src/scene/shader-lib/wgsl/chunks/gsplat/vert/formats/compressedSH.js | Converts compressed format unpacking to use half4 for intermediate values and half3 for final coefficients |
| src/scene/shader-lib/wgsl/chunks/gsplat/frag/gsplatCopyToWorkbuffer.js | Updates fragment shader's SH array declaration to use half3 for consistency |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
|
Does this mean the work buffer can use float16 to store coefficients as well? |
willeastcott
approved these changes
Feb 4, 2026
Contributor
Author
|
Work buffer stores only color .. we resolve SH every few degrees and store resolved values to keep rendering fast. But those are float16. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
array<vec3f, SH_COEFFS>toarray<half3, SH_COEFFS>Performance Impact
halftype aliases