1 decade ago by MikeH
I had a mad idea this evening: what if we used WebGL to scale images?
So I started messing with the webgl-2d plugin and got it so that WebGL does all the scaling of animations, fonts, and images. The results look better to my eye than the nearest neighbor scaling and even the hqx scaling. As far as performance goes, it's on a par, if not a bit more efficient than the software scaling, but I'm guessing this depends on your hardware.
It has an advantage that you aren't limited to scaling by whole numbers, so a scale factor of 1.5 works and looks good, whereas before, font were messed up and animations with an alpha channel looked poor.
Code is here : http://facebook.cocolocogame.com/webgl-2d.js
It's just an experiment though, so don't be harsh ;)
So I started messing with the webgl-2d plugin and got it so that WebGL does all the scaling of animations, fonts, and images. The results look better to my eye than the nearest neighbor scaling and even the hqx scaling. As far as performance goes, it's on a par, if not a bit more efficient than the software scaling, but I'm guessing this depends on your hardware.
It has an advantage that you aren't limited to scaling by whole numbers, so a scale factor of 1.5 works and looks good, whereas before, font were messed up and animations with an alpha channel looked poor.
Code is here : http://facebook.cocolocogame.com/webgl-2d.js
It's just an experiment though, so don't be harsh ;)