meltingice / CamanJS

Javascript HTML5 (Ca)nvas (Man)ipulation
http://camanjs.com
BSD 3-Clause "New" or "Revised" License
3.56k stars 406 forks source link

USE WebGL if possible ? #149

Open darkyen opened 10 years ago

darkyen commented 10 years ago

I think it should be possible to create a shim to run the filters in WebGL if supported and falling back to canvas. The direct advantage will be insanely boosted performance.

meltingice commented 10 years ago

I've thought about this a lot. Unfortunately my WebGL skills are pretty limited. Not sure how you would provide 100% compatibility with the current filters. A canvas can't be both a WebGL canvas and a 2d canvas as far as I know.— Ryan LeFevre (@meltingice) LayerVault Software Engineer

On Fri, Jul 18, 2014 at 7:54 AM, Abhishek Hingnikar notifications@github.com wrote:

I think it should be possible to create a shim to run the filters in WebGL if supported and falling back to canvas. The direct advantage will be insanely boosted performance.

Reply to this email directly or view it on GitHub: https://github.com/meltingice/CamanJS/issues/149

darkyen commented 10 years ago

There exists seriously.js - http://seriouslyjs.org/ its free and open source, The documentation is in stone age but the project is pretty robust and code is well written +1, maybe write a shim with seriously.js ? PS Seriously is lower level compared to canman

fesor commented 9 years ago

There is no big problems with rewriting all filters to GLSL and use as another driver with Canvas fallback.

fesor commented 9 years ago

Also there is glfx.

fesor commented 9 years ago

Just checked, glfx already have implementation for some of the filters:

What is missed here:

It's not so complicated to implement this filters. Some of them already implemented in other libraries (for example, sharpen filter)

Also blending modes should be implemented as fragment shaders. There is example: http://www.nutty.ca/articles/blend_modes/