KhronosGroup / glTF-Sample-Assets

To store all models and other assets related to glTF
256 stars 30 forks source link

Point cloud test model? #31

Open zeux opened 9 months ago

zeux commented 9 months ago

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

DRx3D commented 9 months ago

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?

zeux commented 9 months ago

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 commented 9 months ago

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 commented 9 months ago

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 commented 9 months ago

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

wallabyway commented 7 months ago

Compressed with MeshOpt and Unlit extension

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

Flower_point-cloud_linear_unlit_MeshOpt