it's a product of frustration since things tend to be so rigid that I always just copy paste this sort of thing into my code. so instead, I tried to make it pretty general (too general?).
Ricky Reusser
@rreusser
tl;dr you provide a vertex and a fragment shader. #pragma statements in the vertex shader specify attributes and varyings as well as functions for computing line geometry (vertex position and width). It sets up the correct attributes, strides, etc and handles all the other details
Feels overwrought, but I'm pretty happy with how usable it actually seems in practice
Amit Patel
@redblobgames
oooh
seems very handy!!
Mikola Lysenko
@mikolalysenko
way cool!
Ricky Reusser
@rreusser
Still making progress! Reworked the geometry and got the varyings unskewed by computing the projected offsets—so that you can do dashes!
Amit Patel
@redblobgames
makes me think of striped socks :smile:
1 reply
Ricky Reusser
@rreusser
Reminds me of Slimey
Amit Patel
@redblobgames
yessssssss
kev zettler
@kevzettler
very cool work Ricky
Ricky Reusser
@rreusser
thanks, @kevzettler! I kinda wanted to find out how hard it was to get a simple concept to documented, tested production quality. It's difficult.
@rreusser You may enjoy this paper from Nicholas Rougier, about adding dashes to gl-rendered lines https://jcgt.org/published/0002/02/08/paper.pdf . Not sure if it's the same approach you're using
Ricky Reusser
@rreusser
thanks! ooh, that has significantly better corner behavior than mine. strictly speaking, mine sets up geometry to avoid skewed varyings, but it's otherwise agnostic toward how you might implement dashes.
Ricky Reusser
@rreusser
in particular, mine provides no fragment shader. one of the main problems I was trying to solve was how attributes connect to vertices since that's usually very specific and ends up constraining everything end-to-end.
_
nyc-map
@nyc-map
i'm making a webgpu compute micro-library with the same syntax/api as REGL. its 3.5 faster than webgl and gpus are only doubling every 4 years. together we could make the world a better place. lmk if u want to collab. the lib is anonymous and i accept contrib from anyone :)
for curves you can just subdivide/simplify segments until you get about the same edge length
split long edges, collapse short ones
for surfaces you would probably want to use something like polthier's method which is kind of what they describe in that video very quickly
calculating the forces is actually not that terrible, though the preconditioning step sounds a bit complicated
but i think their split preconditioning scheme is actually not too bad to implement once you grind through the algebra
the hard part in terms of actual coding for repulsive surfaces is definitely that remeshing though
Dusan Bosnjak
@pailhead
Hi, i'm having some trouble using the stencil buffer. Are there any gotchas? I'm expecting one draw call to write 1 into it, and then another to only render where 1 is.
Dusan Bosnjak
@pailhead
dang, ^ i'm working with a layer of abstraction above regl, i was able to enable the stencil context, works like a charm,
roderick
@RodeRickIsWatching
hi 👋 , can i update my images/textures while the animation is on framing?
Yes I often directly hit the API.md for reference, but when I want to sell regl to outside newbies I send them the party URL and SSL failure can be a hard sale