CesiumGS / CesiumGS/cesium-unity
Point clouds render incorrectly on Mac
- Dominant language
- C#
- Stars
- 535
- Forks
- 132
- Avg merge
- 6h 45m
- Merged PRs (30d)
- 1
Description
@joseph-kaile discovered that point clouds don't render correctly on Mac (or more specifically, Metal). Using Unity 2021.3.16f:
> I'm seeing some strange behavior in mac. I replaced the Melbourne tileset in the sample scene with the point cloud version. I do see the points, however when I move the camera around, random colors jump around in the screen.
> 
We tested on `main` and found that these artifacts happen even with the basic point cloud rendering. I couldn't find any posts about it being a problem with Unity, but I found someone else having this issue: https://github.com/bkaradzic/bgfx/issues/2822
> 
> I've run into this as well. I know the general solution, but I'm not sure where it would go as a fix within bgfx. Basically on Metal the point size needs to be a vertex shader output. From Apple: The vertex shader must provide [[point_size]], or the point size is undefined. https://developer.apple.com/documentation/metal/mtlprimitivetype/point
I don't think we're doing anything wrong on our side? It seems like something inside Unity's shader code isn't setting the default point size for meshes rendered with `MeshTopology::POINTS`. I'll submit a bug report and post when / if I get a response.
EDIT: @joseph-kaile also found this [Unity forum post](https://forum.unity.com/threads/meshtopology-points-very-strange-on-ios-unity-2017-3-0-b10.505792/) confirming it's a Unity and Metal interaction.
Contributor guide
Assessment
This issue has not been assessed yet.