Open almarklein opened 4 years ago
By depth attenuation, the goal is to be able to set the radius of points in world space.
This would visually resemble a 3D sphere in the scene, except it's flat, facing the camera, and shaded flat of course.
Added an item for per-vertex marker shape. See https://github.com/fastplotlib/fastplotlib/pull/549.
Some thoughts on this:
The current markers are shaped programmatically based on the point coords. What marker (i.e. code) to use is determined using templating. Making this dynamic could be done using a big multi-if statement, which possibly hurts performance. An alternative could be an array of function objects, but I'm not sure whether wgsl supports this.
Benchmarking reported in #772 suggests that using sdf's instead of computed markers may be more performant. And if we put all our builtin markers in a single texture, we can easily switch between markers! I think this would be the best approach, because it also allows us to create shapes that are not possible with the computed approach.