I’m looking for a way to draw 2D primitives in a Processing-like way.
Most importantly Processing allows setting a size-independent strokeWeight(). No matter what dimensions primitives like rectangle or ellipses have the stroke weight will always be the same. This approach feels very intuitive to me.
This feels very much like designing in Photoshop, Illustrator etc. I would really like to use similar workflow in vvvv/DX11 as well. I was surprised when I couldn’t figure out a way of doing this easily in vvvv as it seems so basic.
the thing is that the underlying Skia library just comes with those primitives, while DX11 doesn’t. so in DX11 someone would have to do that work manually. i guess there’d be different strategies as of how to go about this. so i’m afraid i don’t see an “easy” way there other than sitting down and patching some primitives to your needs.
it highly depends on what you do and how you output the pixels to the screen… skia is hardware accelerated, so this resolution shouldn’t be a problem. if you could describe in more detail what you are doing we might find the bottleneck.
… a HUD with dashed line, rectangles, circles and text. With 4 objects it runs at 40 to 50 fps on my machine. System Monitor tells me the CPU is the bottleneck.
I went ahead and started working on a DX11 version. I’m using Segment (DX11.Geometry) to create rectangles and circles since I couldn’t find anything else that allowed to create loops. For dashed lines, I’m using Line (DX11). It kind of works. I can easily do 100 objects at least at 60fps.
Only the dashes of the lines vary depending on the angle of the line whereas I would like them to be constant. I think it has to do with AspectRatio(DX11.Layer). Maybe I need to change the coordinate system in the shader to work in screen space?
have you alt f9’d the skia, is the bottle neck in the VL node or in the as image output from VL? I’m not keen on getting image data into and out of VL, seems like making nodes for vvvv is heavy, I wonder if they should be inside the threaded VL environment. As image with an image size that large is going to be slow (thinking from VL.cv )
At the LINK camp we had a discussion going on about how to make vl more friendly for complete beginners, and in the discourse the idea dropped that a starter vl kit should be as minimal and concise as 2d proce55ing - öh p5.
Just remembered, when reading this thread, and I believe it’s one of those ideas worth spreading, even though there is no particular thread about random LINK ideas. I guess it could already be done functionality-wise (Forward)
in regards to the screen shot you posted, should those UI elements be always the same sitze but correlate to 3d positions?
because if yes then you would want to do it differently. you can unproject the 3d position into 2d viewspace ( by doing 3d transform * ViewProjection ) … and then use a quad that renders your ui element with alpha transparency and with pixelbillboard, so that you have it crisp and nicely fitting exact on your output pixels.
and then create the ui element with a vector program like adobe illustrator or inkscape