elm-3d-scene icon indicating copy to clipboard operation
elm-3d-scene copied to clipboard

Implement optimized sphere mesh

Open ianmackenzie opened this issue 4 years ago • 1 comments

Should be possible to have a sphere mesh where every vertex is just pair of U and V values, and the center point/radius are passed in as uniforms. Then the vertex shader could calculate vertex position, normal, tangent vector etc. (and you have texture coordinates for free!).

You could even share a given "UV grid" mesh among several different shapes as long as they have 2D parameterizations - spheres, cylindrical surfaces, toruses, spline surfaces...

ianmackenzie avatar Nov 21 '19 22:11 ianmackenzie

Might need to have central frame as a uniform instead of just a point - this would be important if the sphere was textured. In that case you'd need to make sure that the sphere actually rotated properly!

ianmackenzie avatar Nov 21 '19 22:11 ianmackenzie