Pixel-perfect fullscreen

Discussion in 'RPG Maker MV' started by GhostoInsomnio, Sep 13, 2017.

  1. GhostoInsomnio

    GhostoInsomnio Villager Member

    Messages:
    7
    Likes Received:
    2
    First Language:
    FR
    Primarily Uses:
    RMMV
    Hello!

    I want my game to be non-blurry, fullscreen, with a good scaling that doesn't weirdly upscale pixels. Here are the different steps I made:
    - I managed to get non-blurry assets (except fonts) thanks to KisaiTenshi posts in this topic, by adding both the js in a plugin and the css in index.html : https://forums.rpgmakerweb.com/index.php?threads/how-to-remove-blur.47504/#comment-475661
    - I made sure in Pixi.js that this setting was correct:
    Code:
    var SCALE_MODES = exports.SCALE_MODES = {
      LINEAR: 0,
      NEAREST: 1
    };
    - My target resolution is 1920x1080 while my game resolution is 1024x576, which are both true 16:9 resolutions; and shouldn't bring any problem while being upscaled in fullscreen.

    And yet here are the pixels being weirdly stretched out of proportion:
    [​IMG]

    If you look at the black oultine the problem is obvious. Anybody knows how I can correct that?
    Thanks a lot for your help!
     
    #1
    Chaos17 likes this.
  2. Plueschkatze

    Plueschkatze Veteran Veteran

    Messages:
    513
    Likes Received:
    1,513
    First Language:
    German
    Primarily Uses:
    N/A
    The 16:9 isn't the important part here...
    Pixels are pixels, so there is either 1 or 2 or 3 of them, but there's NEVER 1,5 pixels.
    So for pixelperfect its either 1 or 2.
    I guess that's why smooth upscaling exists in the first place, to get away from that problem by blending stuff into eachother.
    So it's important to always scale up in a way that support how pixels work.

    Example:
    640x360 (x1)
    1280x720 (x2)
    1920x1080 (x3)
    2560x1440 (x4)
    work perfectly fine.

    EDIT: but you can't take 720p and scale it to 1080p. You only can use 640x360 and go fullscreen on most of the common monitors today without worrying to much. (And it's also perfect for youtube and stuff... since most of the time you either use 720p or 1080p for letsplays and such!)
    EDIT2: But 640x360 needs you to edit a lot to make the windows etc work fine again. So it might be a better idea to go with something different.

    You could also take half the screensize of the endresolution you'd want.
    Example:
    For 1920*1080 it would be 960*540

    But you can't go with resolutions that would scale up by not using full numbers.
    Edits: Since pixels wouldn't know were to reposition themself to keep the look you wanted.
     
    Last edited: Sep 13, 2017
    #2
    Nacura and dbchest like this.
  3. GhostoInsomnio

    GhostoInsomnio Villager Member

    Messages:
    7
    Likes Received:
    2
    First Language:
    FR
    Primarily Uses:
    RMMV
    Thanks for clarifications!

    As for your comment on resolutions, it actually depends on the engine you're using. I'm new to RPG Maker so I thought it upscaled like other engines I used, like Construct, where as long as you respect the ratio (this is why I talked about 16:9), you can scale up using a 'nearest' scale and pixels stay square. Too bad we can't do that in RPG Maker!

    If I understand correctly, what it means is, if I'm for example using 640x360, it won't be pixel perfect in fullscreen on computer not using resolutions multiple of this one? Like, for example, 1680x1050...

    It looks like it might be an important problem :(
     
    #3
  4. Plueschkatze

    Plueschkatze Veteran Veteran

    Messages:
    513
    Likes Received:
    1,513
    First Language:
    German
    Primarily Uses:
    N/A
    Nearest always only works perfect if you scale up by a multiplication that is a full number (integer), so no decimal numbers.
    Otherwise some lines might get thiner or thicker than you want them to since a line that's orginally was 2 pixels might now get 3 pixels while another 2 pixel line will be calculated to use 4 pixels.
    Like I explained, a pixel can only be either on one or the other pixel on your screen, so it's impossible to be pixelperfect if you mess up with scaling in a way, that does not support this.

    Have something scale pixelperfect no matter the screensize (even if it's always 16:9) is impossible as far as I know.
    Just try upscaling something within photoshop (or another software) after setting the rendering to nearest and you'll see.
    Example:
    example_pixelperfect_plueschkatze.png

    It's pretty easy to see in some places, especially on the floor that there's a changing linesize, because the program does not know how to reposition the pixels (or were to add new pixels), since the amount of pixels that are there to place pixel isn't the same as in the original if you don't scale up using like 100,200,300,400,500%
    But since I'm not a person who's super familiar with all the coding and math behind such algorithms (or whatever calculates how pictures scale) I can't tell you much about that.
     
    #4
  5. GhostoInsomnio

    GhostoInsomnio Villager Member

    Messages:
    7
    Likes Received:
    2
    First Language:
    FR
    Primarily Uses:
    RMMV
    Thanks for taking the time to show me through examples, really appreciated.

    What I think might be a good solution is to do like responsive websites: check the computer resolution, and then choose the nearest x2/x3/x4 resolution.

    Now, I need to find a solution to do a full screen that doesn't scale up the actual game window but just adds black borders. :o

    Thanks for your help!
     
    #5
  6. Plueschkatze

    Plueschkatze Veteran Veteran

    Messages:
    513
    Likes Received:
    1,513
    First Language:
    German
    Primarily Uses:
    N/A
    Funny enough, I've just spend the past days with thinking about a good resolution to use for my game, haha.

    I hope you'll find a solution :)
     
    #6
  7. GhostoInsomnio

    GhostoInsomnio Villager Member

    Messages:
    7
    Likes Received:
    2
    First Language:
    FR
    Primarily Uses:
    RMMV
    I'll dig around, thanks :)
     
    #7
  8. Nilaul

    Nilaul Warper Member

    Messages:
    2
    Likes Received:
    0
    First Language:
    English
    Primarily Uses:
    RMMV
    New guy here, I've also spent the whole day trying to decide for a resolution, that would scale nicely into 1080p. I don't think there is a perfect solution, if your trying to go for a screen without scroll. I don't want the map to scroll. However the 48 x 48 pixels for a tile doesn't divide into 1080 or 540 or 270. There will always be a square extra or one square less, making the whole map scroll when walking vertically. There isn't a problem with the horizontal though.
     
    #8

Share This Page