Idea Review: Better than Pixel Perfect ?
Posted: Wed Sep 15, 2021 10:53 am
Hi guys, I'm new to löve.
I'm starting to recreate a type of rendering render-to-texture that I did in C# with Unity back then.
Thx to comment and maybe proposing me other solution. For the moment I'm satisfied with what I ended up, but there's always room to do differently.
GOAL:
- Getting pixelated rendering.
- with smooth "crt" distortion.
- and not jaggy pixel contours.
* I could dig into some librairies as the "push" one, but I want to code lot of thing myself to 1)learn and 2)own more what I'm doing.
I don't want a complex shader that smooth-out pixels with costly blur thing. I did:
1. Drawing on a firstCanvas of 360x204
-- scale x1, nearest...
2. Storing that result in a image of 360x204 (pre-render)
-- scale x1, and nearest)
-- image = firstCanvas
3. Than rendering in a finalCanvas, the image "pre-render").
-- scaling this one as I want
-- linear filtering (getting for free, smooth (fake AA) pixel edges)
-- shader applied here, to distort and play with the upscaled low-pixels pre-render
WHY I do not just render low-resolution on a canvas and right-away rendering a second time in another canvas ?
I did not succeed only using 2 canvas in a row without storing some result in a buffer(image). Scaling up the second one doesn't "store" the first one as "printed" and the trick using "linear" filtering on the last Canvas won't work.
I'm starting to recreate a type of rendering render-to-texture that I did in C# with Unity back then.
Thx to comment and maybe proposing me other solution. For the moment I'm satisfied with what I ended up, but there's always room to do differently.
GOAL:
- Getting pixelated rendering.
- with smooth "crt" distortion.
- and not jaggy pixel contours.
* I could dig into some librairies as the "push" one, but I want to code lot of thing myself to 1)learn and 2)own more what I'm doing.
I don't want a complex shader that smooth-out pixels with costly blur thing. I did:
1. Drawing on a firstCanvas of 360x204
-- scale x1, nearest...
2. Storing that result in a image of 360x204 (pre-render)
-- scale x1, and nearest)
-- image = firstCanvas
3. Than rendering in a finalCanvas, the image "pre-render").
-- scaling this one as I want
-- linear filtering (getting for free, smooth (fake AA) pixel edges)
-- shader applied here, to distort and play with the upscaled low-pixels pre-render
WHY I do not just render low-resolution on a canvas and right-away rendering a second time in another canvas ?
I did not succeed only using 2 canvas in a row without storing some result in a buffer(image). Scaling up the second one doesn't "store" the first one as "printed" and the trick using "linear" filtering on the last Canvas won't work.