Subpixel movement of pixel art on modern platforms

You can talk about almost anything that you want to on this board.

Moderator: Moderators

Sik
Posts: 1589
Joined: Thu Aug 12, 2010 3:43 am

Re: Subpixel movement of pixel art on modern platforms

Post by Sik » Fri May 29, 2015 8:39 pm

I believe the 3DS version does account for the pixel grid, but I'm not sure (there was some change regarding this though). The PC version definitely doesn't though.
rainwarrior wrote:Blaster
Blaster isn't even rendering sprites, it's just objects made out of multiple flat rectangles =P

User avatar
rainwarrior
Posts: 7884
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: Subpixel movement of pixel art on modern platforms

Post by rainwarrior » Fri May 29, 2015 9:36 pm

Sik wrote:
rainwarrior wrote:Blaster
Blaster isn't even rendering sprites, it's just objects made out of multiple flat rectangles =P
Depends which phase of gameplay you're talking about. The asteroid field is clearly sprites, but even the rainbow-road-robots-and-tron-gates things have a very clear grid to them. A row of large pixels and a flat rectangle are the same thing, in practice, and the "flat rectangles" do fit on a grid that's being scaled. (i.e. they really are pixels, the sprite resolution for the enemies in that phase is just REALLY low; the later phases have higher resolution sprites)

Sik
Posts: 1589
Joined: Thu Aug 12, 2010 3:43 am

Re: Subpixel movement of pixel art on modern platforms

Post by Sik » Sat May 30, 2015 11:13 am

OK yeah looking more later there are proper sprites in the second wave. They're prescaled though, so it isn't a good example either =/

User avatar
Drew Sebastino
Formerly Espozo
Posts: 3503
Joined: Mon Sep 15, 2014 4:35 pm
Location: Richmond, Virginia

Re: Subpixel movement of pixel art on modern platforms

Post by Drew Sebastino » Sat May 30, 2015 11:17 am

I believe you, but how do you know that they are prescaled? I guess it's that they never zoom in very far, because if it is prescaled, it looks pretty smooth.

Sik
Posts: 1589
Joined: Thu Aug 12, 2010 3:43 am

Re: Subpixel movement of pixel art on modern platforms

Post by Sik » Sat May 30, 2015 12:59 pm

It doesn't look very smooth to me.

EDIT: OK, looking at it again. OK yeah it's reasonably smooth, but still the steps are very obvious, so it's either prescaled or there's some really low granurality in the scaling.

User avatar
Drew Sebastino
Formerly Espozo
Posts: 3503
Joined: Mon Sep 15, 2014 4:35 pm
Location: Richmond, Virginia

Re: Subpixel movement of pixel art on modern platforms

Post by Drew Sebastino » Sat May 30, 2015 1:03 pm

Sik wrote:It doesn't look very smooth to me.

EDIT: OK, looking at it again. OK yeah it's reasonably smooth, but still the steps are very obvious, so it's either prescaled or there's some really low granurality in the scaling.
It's probably because I'm watching it on the lowest resolution on a tiny window. :oops:

User avatar
mikejmoffitt
Posts: 1352
Joined: Sun May 27, 2012 8:43 pm

Re: Subpixel movement of pixel art on modern platforms

Post by mikejmoffitt » Mon Jun 01, 2015 9:28 am

I have considered making a minimal game development framework, where the focus isn't on providing an engine but rather providing a more authentic display. Really my only goal is to make it extremely easy for someone to set up a low internal resolution (like 288x224 or 256x240, etc) and have the framework manage pre-scaling by some integer, then doing aspect ratio-respecting filtered scaling up to the target window or monitor resolution. Images blitted to the internal resolution framebuffer would not use filtering and have their coordinates floored to the nearest integer to prevent pixel transition blur. That way, a developer wishing to make a pixel game may utilize the framework, and doesn't have to think about these things that many developers do not even know to think about.

psycopathicteen
Posts: 2963
Joined: Wed May 19, 2010 6:12 pm

Re: Subpixel movement of pixel art on modern platforms

Post by psycopathicteen » Mon Jun 01, 2015 2:11 pm

Filtered scaling? I hope it's not the gaussian blur crap that everybody abuses nowadays.

User avatar
mikejmoffitt
Posts: 1352
Joined: Sun May 27, 2012 8:43 pm

Re: Subpixel movement of pixel art on modern platforms

Post by mikejmoffitt » Mon Jun 01, 2015 2:25 pm

psycopathicteen wrote:Filtered scaling? I hope it's not the gaussian blur crap that everybody abuses nowadays.
No, it's prescaled with nearest-neighbor first, then the blurrier linear filtering is used. This preserves pixel edges to an extent while making uneven pixel sizes less of an issue when the target resolution is not a multiple of the original.

Here's a mockup comparison. 256 x 240 --> 800 x 600.

First using linear filtering directly (ugly):

Image

Now with an integer pre-scale value of 2 done first with nearest, then linear scaled to 800x600 (better!):

Image

tepples
Posts: 22143
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Subpixel movement of pixel art on modern platforms

Post by tepples » Mon Jun 01, 2015 3:52 pm

Sort of reminds me of fractional bilinear interpolation (FBI), a pixel shader whose output is identical to this technique.

The pixels in your scaled version are a bit too wide. On a 4:3 TV adjusted to spec, an NTSC NES produces pixels that are 8/7 of a scanline's height wide. To preserve shapes, you should pad on the left and right with 12 pixels of the background color, producing a 280x240 pixel picture, before blowing it up to a 4:3 rectangle. For example, you'd blow up 280x240 to 560x480 before blowing it up to fit the screen. (3x, or 840x720, is too big both ways for 800x600.) Then you FBI that up to the 800x600 screen.

psycopathicteen
Posts: 2963
Joined: Wed May 19, 2010 6:12 pm

Re: Subpixel movement of pixel art on modern platforms

Post by psycopathicteen » Mon Jun 01, 2015 4:51 pm

Anybody thought of doing RGB subpixel rendering?

lidnariq
Posts: 9843
Joined: Sun Apr 13, 2008 11:12 am
Location: Seattle

Re: Subpixel movement of pixel art on modern platforms

Post by lidnariq » Mon Jun 01, 2015 5:03 pm

Ugh, ugh, ugh, NO, don't even.

1- Subpixel doesn't work well for colored input.
2- Subpixel requires an inordinate number of assumptions about the display you're rendering on.
3- Subpixel makes screenshots useless, because those assumptions from #2 are basically guaranteed to be broken on other viewing outputs.

User avatar
mikejmoffitt
Posts: 1352
Joined: Sun May 27, 2012 8:43 pm

Re: Subpixel movement of pixel art on modern platforms

Post by mikejmoffitt » Mon Jun 01, 2015 9:39 pm

tepples wrote:Sort of reminds me of fractional bilinear interpolation (FBI), a pixel shader whose output is identical to this technique.

The pixels in your scaled version are a bit too wide. On a 4:3 TV adjusted to spec, an NTSC NES produces pixels that are 8/7 of a scanline's height wide. To preserve shapes, you should pad on the left and right with 12 pixels of the background color, producing a 280x240 pixel picture, before blowing it up to a 4:3 rectangle. For example, you'd blow up 280x240 to 560x480 before blowing it up to fit the screen. (3x, or 840x720, is too big both ways for 800x600.) Then you FBI that up to the 800x600 screen.
It was just a lazy approximation where I punched in 800x600. That shader does look like exactly what I'm interested in.

Sik
Posts: 1589
Joined: Thu Aug 12, 2010 3:43 am

Re: Subpixel movement of pixel art on modern platforms

Post by Sik » Tue Jun 02, 2015 7:59 am

lidnariq wrote:Ugh, ugh, ugh, NO, don't even.

1- Subpixel doesn't work well for colored input.
2- Subpixel requires an inordinate number of assumptions about the display you're rendering on.
3- Subpixel makes screenshots useless, because those assumptions from #2 are basically guaranteed to be broken on other viewing outputs.
In other words: this is why ClearType sucks (I mean, that's exactly the very thing ClearType attempts so we have an existing example of how it works in practice =P).

And yeah forget about #2. These days each display has a completely different arrangement of the lights, mostly in order to account for the differences in perception between green and red/blue (as well as for reducing the discoloration at different angles in the case of LCD screens).

User avatar
rainwarrior
Posts: 7884
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: Subpixel movement of pixel art on modern platforms

Post by rainwarrior » Tue Jun 02, 2015 10:25 am

I just ran across this game for Genesis, Marko's Magic Football.

Take a look at the layers behind or in front of the action. The tiles have half the normal resolution, it looks like. I think they did this to hint at a depth-of-field out of focus effect. Kind of a neat reason to mix resolutions, (Is it a hardware feature or did they just draw the tiles that way?)

Post Reply