Skip to content

feature: 3D gaussian splatting viewer#125

Merged
altunenes merged 9 commits intomainfrom
3dgs
Jan 19, 2026
Merged

feature: 3D gaussian splatting viewer#125
altunenes merged 9 commits intomainfrom
3dgs

Conversation

@altunenes
Copy link
Owner

cargo run --release --example gaussian3d
I tried it with Apple's mlsharp ply export.
30fps: MacBook M3 16GB.

gpu radix sort ported from: wgpu_sort (Copyright (c) 2024, Simon Niedermayr, Josef Stumpfegger: BSD 2-Clause License). I must admit that I spent some time researching whether there are more modern sorting approaches for 3dgs. However, I think this is still the best approach for now.

ply reader: a new dep but very very tiny: https://github.com/bourumir-wyngs/ply-rs so

note that for now, its compute + frag approach. When I have time, I want to try to convert this entirely into a compute pipeline. However, I realized that I need to work harder on this because I had some performance issues.

As I did previously in gaussian.wgsl, I tried a purely tiled approach for creating entire compute pipeline. However, given the immense size of the 3D gaussians, this approach proved to be too naive and ineffective result: 8-10 fps and lower quality. but I'll still push for it. I'll take that as a “starting point” for now.

NOTE: I was able to get my ply file in minutes using the following simple script via Google Colab:
An even crazier idea would be to export this model to ONNX, make the necessary adjustments, and serve it in real time :-P
but considering the complexity, this would be a huge work.

import os
import shutil
from google.colab import drive

# cfg
drive_folder = '/content/drive/My Drive/your_folder/'
image_filename = 'your_image.png'

# env
if not os.path.exists('/content/drive'):
    drive.mount('/content/drive')

repo_dir = '/content/ml-sharp'
if not os.path.exists(repo_dir):
    !git clone https://github.com/apple/ml-sharp.git {repo_dir}

os.chdir(repo_dir)
!pip install -q -r requirements.txt
!pip install -q .

# Run Prediction
input_path = os.path.join(drive_folder, image_filename)
output_dir = '/content/inference_output'

!sharp predict -i "{input_path}" -o "{output_dir}" --device cuda

# Save Result to Drive
ply_filename = os.path.splitext(image_filename)[0] + '.ply'
shutil.copy(os.path.join(output_dir, ply_filename), os.path.join(drive_folder, ply_filename))

@altunenes
Copy link
Owner Author

note: With WGPU 28, we can also try this with mesh shaders. However, this is just an idea for now...

#115

@altunenes altunenes merged commit 43219e9 into main Jan 19, 2026
@altunenes altunenes deleted the 3dgs branch January 19, 2026 16:43
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.

1 participant