So here’s just a quick one. Since these days pixelated “retro” graphics are hot, there’s a way you can turn your uncool Full HD browser game into a cool retro game. The key is changing how the browser handles upscaling of images. By default linear filtering is used to upscale lower resolution images. With the CSS property “image-rendering” you can control this (source):
image-rendering: -moz-crisp-edges; /* Firefox */ image-rendering: -o-crisp-edges; /* Opera */ image-rendering: -webkit-optimize-contrast;/* Webkit (non-standard naming) */ image-rendering: crisp-edges;
-ms-interpolation-mode: nearest-neighbor; /* IE (non-standard property) *
All you need to do is take your (WebGL) canvas, set the resolution down to something retro-y (e.g. 320×240 px), scale it up to the full window size and apply the aforementioned styles to the canvas element.
Reblogged this on Dinesh Ram Kali..
Thanks for sharing it! 🙂