2 ms·
true, also declarative approach is amazing for wegbl, you need to draw many lines - pass start/end points in a buffer at once.
by octacat 2y ago
true, also declarative approach is amazing for wegbl, you need to draw many lines - pass start/end points in a buffer at once.
- lukan 2y agoI wanted to do something like this, but have not found a nice way, yet. You do this by hand? Meaning writing the shader code yourself?
- octacat 2y agoBy hand or regl library (almost by hand). I tried THREE, but it feels it gives me more pain than benefits (and you still end up tweaking their shaders sometimes). AI is pretty good at small tasks like tweaking shaders. I needed to draw a spectroscope, like a line connecting all pixels on the image one by one on the colorspace projection. Ended up 100 times more efficient in webgl comparing to browser API. But it is pretty low level. On another hand once you dig deeper into shaders, they are actually more powerful. Let's just say, API is just painful too :). Also, there is some fun with how transparency works and order of elements displayed (because of parallel processing). Oh, ideally I want web canvas API, but which allows to pass a buffer of lines to draw instead of one ;)
- lukan 2y agoThanks. I started getting into shaders with WebGPU, but that is not widespread yet and WebGL I did not liked, so I likely will get back to writing WebGPU shaders for better performance, once there is decent support. (And my current solution works, just could be more performant)