SFraissTU / BA_PointCloud

PointCloud-BachelorThesis
BSD 2-Clause "Simplified" License
185 stars 42 forks source link

Support for iOS? #40

Closed dzak83 closed 2 years ago

dzak83 commented 2 years ago

Thanks for sharing your project. This was very useful and I learned a lot. I'm trying to run it however on iOS devices and since geometry shaders are not supported on metal, I was wondering what would be your take if someone would like to run it there?

Do you think similar performance can be achieved without geometry shaders? What about interpolation and cones? Do you think this can be achieved too?

SFraissTU commented 2 years ago

Hi! Most shader programs require geometry shaders because they create quads from points. As far as I know there is no way to set a fixed point size in Unity (such as gl_PointSize in OpenGL or something similar). One alternative is to use the Quad4PointScreenSizeShader, which is used in Quad4PointMeshConfiguration. This is a variant that renders points of a fixed screen size by passing each vertex 4 times to the GPU. This is slower and requires more memory, but it works. However, note that this does currently not support world size points and interpolation modes. However, it might be possible to implement these for this variant as well. Just look at the other shaders for reference. Paraboloid and cone interpolation should be possible this way too, as their Frag-variants (which are faster than the Geo-variants anyway) perform the paraboloid/cone creation in the fragment shader.

dzak83 commented 2 years ago

Thanks for your input!