brianchirls / Seriously.js

A real-time, node-based video effects compositor for the web built with HTML5, Javascript and WebGL
MIT License
3.87k stars 354 forks source link

Adds precision argument to chroma effect #141

Open javl opened 7 years ago

javl commented 7 years ago

As mentioned in issue #80 some devices will add black areas when using chroma due to problems when rounding the alpha value. This pull request adds a precision argument to the chroma effect to easily change the rounding factor to fit specific devices.

The default value is the original 0.00001 so this shouldn't break anything for existing scripts. For example: on the iPad 2 with Safari 9, iOS 9.3 I had to change the precision to 0.01 for the chroma effect to work reliably.

chroma = seriously.effect('chroma');
chroma.precision = 0.01;