CesiumGS / cesium

An open-source JavaScript library for world-class 3D globes and maps :earth_americas:
https://cesium.com/cesiumjs/
Apache License 2.0
12.92k stars 3.48k forks source link

Add option to draw point cloud points as spheres or circles instead of squares #9488

Open dzungpng opened 3 years ago

dzungpng commented 3 years ago

Currently, points in a point cloud is drawn as squares by default.

image From 3D Tiles Point Cloud Styling Sandcastle.

This is because WebGL by default draw points as squares. It would be nice for visualization purposes to add an option (potentially to PointCloudShading) allowing the points to be drawn in a more circular shape.

A suggestion from @lilleyse: one way to do this is to pass the point position to the frag shader and then in the frag shader get the fragment's position and render any fragment whose distance to the point position is less than the circle radius.

lilleyse commented 2 years ago

This is possible to do with custom shaders, see Custom Shaders Models.html for an example.

I still think it would be a good idea to add an option to PointCloudShading, so we can leave this issue open.