mafs icon indicating copy to clipboard operation
mafs copied to clipboard

WebGL component

Open stevenpetryk opened this issue 3 years ago • 4 comments

I think it'd be nice to add some sort of API for easily integrating webgl/threejs/react-three-fiber if someone wants to embed some really performance-intensive stuff into Mafs.

Much like the Mafs SVG stuff, this would really just be a matter of making sure that a WebGL canvas "has its bearings" and knows how to map things from coordinate space to pixel space.

An interesting idea would be to move Function and VectorField to WebGL to improve performance. VectorField would especially benefit. We do, however, lose server side rendering with that approach.

Side-note: I would never want Mafs to be pure WebGL, because it's really difficult to make that accessible. I enjoy how Mafs is keyboard accessible by default at the moment.

stevenpetryk avatar Jan 02 '23 23:01 stevenpetryk

Possible WebGPU support?

debater-coder avatar Apr 27 '23 05:04 debater-coder

Possible WebGPU support?

Something in particular you had in mind?

stevenpetryk avatar Apr 27 '23 09:04 stevenpetryk

Either through three.js or a raw implementation (WebGPU makes this actually feasible as it is less painful to work with directly). Not sure if there is much computation to GPU accelerate, but the graphics could definitely benefit.

debater-coder avatar Apr 28 '23 07:04 debater-coder

The only computation worth GPU accelerating would be function plotting/sampling, but doing that on the GPU would require Mafs users to write their function in shader code.

stevenpetryk avatar Apr 28 '23 08:04 stevenpetryk