lingdong- / ofxpoissonfill Goto Github PK
View Code? Open in Web Editor NEWPoisson filling shader for OpenFrameworks
License: MIT License
Poisson filling shader for OpenFrameworks
License: MIT License
Hi there! Thanks for making this addon. I was working on porting it to SparkAR but I noticed there is quite a lot of branching in the shader, especially with the G and h1 functions. Apologies for the unsolicited issues, but I wonder if you might increase performance by using arrays instead of the branching if statements.
float h1[5] = {0.1507, 0.6836, 1.0334, 0.6836, 0.1507};
float G[3] = {0.0312, 0.7753, 0.0312};
And then later on, you can also simplify this calculation be only calculating the weight once:
float weight = h1[dx + 2] * h1[dy + 2];
acc += col * weight;
The last parts of each section of the shader could remove the check for if acc.a == 0.0 to also read something like:
float mask = step(0.00001, acc.a);
fragColor= vec4(acc.rgb / acc.a, 1.0) * mask + acc * (1.0-mask);
Thanks for making this add-on.
Can it be used to do poisson disc sampling? i.e. get a point cloud instead of manipulating a texture?
Like here:
https://www.jasondavies.com/poisson-disc/
Thanks for this great addon!
I've noticed it sometimes cause an offset of the original image if using arbitrary texture sizes, like 1920x1080
and using power of two textures, like 512 x 512 the effect mantains the alignment with the original scene.
is it possible to use different texture values?
Thank you
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.