How to have efficient "old school" effect


I want to make this big pixel old school effect with openfl.

Untill now, I used to simply draw everything on a bitmap and then scaling it by 3 or 4.
But now i’m concerned by the fact this method does not use the gpu (I think).
I think everything is done on the cpu as it is only bitmap blitting.

i want to be able to rotate, scale, and add a lot off particles so that’s why i’m concerned about performances.

So, my question is, is there a way to disable anti-aliasing, reduce the backbuffer resolution , and then scale it to get an old shcool rendering ?

I tried somthing with the webgl export, scaling the game via css, and get big pixels, but i didn’t not found a wey to disable anti aliasing so it’s a bit awful.

So, does anyone know a better way to do it ?

edit :
I don’t want to scale all of my sprite as it won’t be pixel perfect and I think it ruins the old school effect.
On top of that I think if I reduce the buffer size, rendering will be faster proportionally right ?
On the other hand scalling the sprites will have a performance cost and then the old school effect will be slower than normal hd rendering, and I think it’s a bit ironic x)

On some targets, you can set <window antialiasing="0" />.

As for GPU-based scaling, have you tried Tilesheet? Alternately, HaxeFlixel has what I assume is an efficient implementation.

+1 for HaxeFlixel, which is basically made for that kind of stuff…

If you are targeting HTML5, you should be able to create your own <canvas /> element, and use that in the openfl.embed script in the HTML template.

Create a templates/html/index.html file, add <template path="templates" /> and then you can customize your own HTML page to work as you want. When you point to a canvas element, I think it (may?) disable the resizing code within OpenFL and Lime, so you can use CSS to scale it up as you want :slight_smile: