glTF-Sample-Assets icon indicating copy to clipboard operation
glTF-Sample-Assets copied to clipboard

Point cloud test model?

Open zeux opened this issue 2 years ago • 6 comments

One of the important use cases of glTF I've seen that doesn't seem to be covered in this repository are point clouds.

glTF-Sample-Models had MeshPrimitiveTest but I'm not really suggesting including that one - it feels like we should have some test instead that is a more realistic/heavy-weight test of point clouds specifically.

Sketchfab has a lot of assets that are point cloud scans but I'm not sure what the licensing restrictions here are. I'm thinking of something along these lines: https://sketchfab.com/3d-models/flower-point-cloud-photogrammetry-13a409d10f154d5dbfd009fe75d52222

zeux avatar Oct 07 '23 17:10 zeux

I agree (that there should be heavy point cloud models). The model you suggested (Flower Point Cloud Photogrammetry) is great because it is CC-BY. It is currently in XYZ point cloud format. Can someone convert this to glTF?

DRx3D avatar Oct 07 '23 22:10 DRx3D

Sketchfab natively supports conversion to glTF; for convenience I'm attaching the glTF export here for the asset above:

flower_point_cloud_photogrammetry.zip

zeux avatar Oct 08 '23 02:10 zeux

Hmm maybe this specific export isn't ideal - in addition to position and color, the file also contains normal data but it's redundant (every point has the same normal), which is probably a mistake in source asset or in the converter. So we'll need to post-process this or find a better scan.

zeux avatar Oct 08 '23 02:10 zeux

Okay, I cleaned up the glTF file manually (using glTF-Transform to repack the buffer data. Attaching the result.

gltf.report loads and renders the scene correctly, modulo what looks like sRGB issues:

image

Babylon.JS:

image

Sketchfab for comparison:

image

flower_point_cloud_cleaned.zip

zeux avatar Oct 08 '23 02:10 zeux

Ok, yeah, I had to convert the colors from sRGB to linear color space using a one-off C program. After conversion, the Babylon.JS render is now correct (using point size=2 here); I think we should now be able to use this asset.

image

flower_point_cloud_linear.zip

zeux avatar Oct 08 '23 03:10 zeux

Compressed with MeshOpt and Unlit extension

source files: https://github.com/wallabyway/minimal-pointcloud-gltf#flower

Flower_point-cloud_linear_unlit_MeshOpt

wallabyway avatar Nov 08 '23 23:11 wallabyway