two.js icon indicating copy to clipboard operation
two.js copied to clipboard

[Enhancement] Add Filters to Two.js

Open jonobr1 opened this issue 3 years ago • 3 comments

Is your feature request related to a problem? Please describe. Both SVG and Canvas APIs have the ability to filter the rendering style of the content displayed. Take those along with custom shaders for the WebGL renderer to incorporate filtering into Two.js.

Describe the solution you'd like

var group = two.makeGroup();
group.add(circle, star, rectangle, path);
group.filter = 'blur(10px)';
star.filter = 'contrast(175%)'

Additional context Filter specifications on MDN: https://developer.mozilla.org/en-US/docs/Web/CSS/filter

jonobr1 avatar Jan 24 '22 05:01 jonobr1

Hi @jonobr1, I am Perminder singh, maintainer of p5.js. Interested in working on this issue. Can you assign this to me?

perminder-17 avatar Oct 07 '25 12:10 perminder-17

Thanks for diving in! Feel free to ask any follow up questions here. I think the SVG and Canvas implementation should be fairly straightforward, but there are a few different ways to approach this in WebGL

jonobr1 avatar Oct 07 '25 17:10 jonobr1

Referencing: https://github.com/jonobr1/two.js/issues/773

jonobr1 avatar Nov 21 '25 23:11 jonobr1