Low poly image effect / could this be done in realtime?
category: code [glöplog]
I'm just going to call it Dolanuay triangulation from now on.
Oh Maali, good attempt at discouraging me from engaging on pouet, it's not like I do it often..
Anyway the real topic of this thread is cool
knos: nothing personal man :)
i like the vonoroi variant of it too btw, i assume by tweaking some math you can get it to generate triangles instead of ngons for a low poly effect... e.g. http://unitzeroone.com/labs/jfavoronoi/
btw, Boris Vonoroi was called Vonoroy in France. His father Angus Vonoroisky was of mixed Irish-Russian descent.
btw, Boris Vonoroi was called Vonoroy in France. His father Angus Vonoroisky was of mixed Irish-Russian descent.
From Maali's post I'm thinking.
1) Detect edges with emboss filter.
2) Spray some Boris points for the edges.
3) Compute the Boris diagram using the Excess OpenGL method by rendering a 3d cone per point with z-test greater or equal.
Optionally afterwards you can apply the emboss filter again to the result since this is one of the best effects ever.
1) Detect edges with emboss filter.
2) Spray some Boris points for the edges.
3) Compute the Boris diagram using the Excess OpenGL method by rendering a 3d cone per point with z-test greater or equal.
Optionally afterwards you can apply the emboss filter again to the result since this is one of the best effects ever.
Maali: good finding, they use some kind of flooding algo on GPU. The question is: how to transform it to triangulation (still all in GPU) ? ;) I've seen some guys doing it directly from discretized Voronoi, but it's like "meh" solution: sometimes you may have missing/crossing triangles, probably you can "hack it" until it is good enough, but it is no fun either. I wonder if there is a better way.
Quote:
I'm just going to call it Dolanuay triangulation from now on.
"The spelling Delone is a straightforward transliteration from Cyrillic he often used in recent publications, while Delaunay is the French version he used in the early French and German publications. Boris Delone got his surname from his ancestor French Army officer De Launay, who was captured in Russia during Napoleon's invasion of 1812. De Launay was a nephew of the Bastille governor marquis de Launay." source
Elsewise, yes, however one might call it it is a nice and beautiful effect.
So... I've tried implementing it on GPU using two-pass JFA algo on shadertoy here. All in screen space. As I said it's kind of 'meh" solution, maybe it's possible to fix most artifacts - I don't know yet.
hey that's great. How do you pick the points to tesselate?
Navis: thx. I didn't focus on feature extraction here. So, it's just pixels that has higher luminance than surrounding pixels, sort of "corners" (code is in Buf A). I would bet some SIFT variant could give much better results, more stable over time and better following shape/sparser.
Only shows a black image on AMD here. ;(
Saga: I have also black screen in Firefox. Maybe it's the same problem. I have to manually pause/start video in "Buf A" and then it works fine. Looks like some bug in shadertoy/firefox.
@tomkh: Wow. This is really cool! Incredible.
So you can do multipass with shadertoy? (Image A -> shader A -> Image B-> Shader B etc.)? I didn't know!
Navis: yes, IQ did a lot of good work there lately. I like the direction ShaderToy is going, although, it will probably need full node editor at some point ;)
pixtur: thanks!
I've also tried to debug / add simple interaction and it seem to have less artifacts than I thought. I would still need to do proper analysis "when it works" and "when it fails" and possibly make more formal derivation/proof.
At this point I also wonder what @smash is really doing, is he constructing triangular mesh using "compute" in-between (like most publications suggest) or also doing everything in screen space.
I've also tried to debug / add simple interaction and it seem to have less artifacts than I thought. I would still need to do proper analysis "when it works" and "when it fails" and possibly make more formal derivation/proof.
At this point I also wonder what @smash is really doing, is he constructing triangular mesh using "compute" in-between (like most publications suggest) or also doing everything in screen space.
why not on cpu? its fast enough...
Yeah. I didn't do benchmark for a while, but CPU should be indeed fast enough, probably even for 100k, maybe even 1M points (?!). The usual problem is transferring points back and forth between CPU<->GPU, which is especially painful if you do feature extraction on GPU and/or some fancy rendering later. But honestly, you could probably do pretty fast extraction on CPU as well. It's funny how nowadays CPUs are simply underrated. I guess it is partially, because they are harder to optimize and port around (ARMv6 vs SSE/AVX).
tomkh: no, i construct actual triangles and points using compute.
actual triangles and points are way cooler than screen space because you can mess with them in more interesting ways, and also add stability (as we track the points).
i really like your screenspace solution though, its very nice!
actual triangles and points are way cooler than screen space because you can mess with them in more interesting ways, and also add stability (as we track the points).
i really like your screenspace solution though, its very nice!
Random sample points. Have them itterate a few boid- steps wrer similar colors fuse whole differences bounce off.
Create vornoy based on The remaining sample points.
Create vornoy based on The remaining sample points.
Good discussion! I used maybe the most primitive way to achieve video vectorizer featured in my last Revision's prod. Visually different from stuff you discussed here, but it got imo certain visual appeal..
Thx for theory review how to do it scientifically, this is my alchymist brute force way: check in this webapp - shape: filled triangles with some precision - should be possible to rewrite it to vertex shader to work in real-time...
Thx for theory review how to do it scientifically, this is my alchymist brute force way: check in this webapp - shape: filled triangles with some precision - should be possible to rewrite it to vertex shader to work in real-time...