Use bilinear filtering except when we shouldn't

Use bilinear filtering unless the Drawable is angled by a multiple of 90
degrees and is either a raster image (like a BitmapSkin) or is around
its native resoluion. This makes both bitmaps and vectors look better in
most cases. This is roughly the same logic that Scratch 2.0 used; we may
want to tweak it over time to see if we can make it even better.
This commit is contained in:
Christopher Willis-Ford
2017-11-29 20:51:19 -08:00
parent 72af98d2cf
commit 9307e09031
5 changed files with 49 additions and 10 deletions

View File

@@ -81,10 +81,9 @@ class SVGSkin extends Skin {
gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, this._svgRenderer.canvas);
this._silhouette.update(this._svgRenderer.canvas);
} else {
// TODO: mipmaps?
const textureOptions = {
auto: true,
mag: gl.NEAREST,
min: gl.NEAREST, /** @todo mipmaps, linear (except pixelate) */
wrap: gl.CLAMP_TO_EDGE,
src: this._svgRenderer.canvas
};