OverlayEditor anti-aliasing

Discussion in 'Rivatuner Statistics Server (RTSS) Forum' started by get_me_out_of_here, May 22, 2020.

  1. get_me_out_of_here

    get_me_out_of_here New Member

    Messages:
    3
    Likes Received:
    0
    GPU:
    Model / Memory size
    Is there a way to disable the anti-aliasing used in the on-screen display? I spent a good three hours playing with zoom settings, layer formatting, source image formatting, etc. It seems to be impossible to render a pixel-perfect image in the OSD. There is no concept of scale in the editor, so whatever image you feed it will end up resized in some way.

    The specifics of my problem is that I want to display a box around regions of my display (like a 2 pixel rectangle around my fps display). In every instance of attempting to do this, the borders of the box are stretched or blurred or resized, even if I give specific pixel dimensions (in embedded image settings). I just want to display an image accurately, without having to fight the resampling.

    In addition, what is the "default" value for "On-Screen Display Zoom"? The minimum value leads to text being crushed and distorted, with the maximum value being blown-out beyond usability in the editor.
     
  2. Unwinder

    Unwinder Moderator Staff Member

    Messages:
    14,808
    Likes Received:
    1,921
    There is no antialiasing, you’re confusing it with bilinear filtered resizing. To get pixel-to-pixel mapping set zoom to 1, adjust font size directly in raster font selection dialog and specify object/layer dimensions in pixels.
     
  3. get_me_out_of_here

    get_me_out_of_here New Member

    Messages:
    3
    Likes Received:
    0
    GPU:
    Model / Memory size
    Assuming that to mean "ZoomRatio=1", and attached image to be what you are referring to for "raster font selection dialog"
    [​IMG]

    ###Also attached is a 16x16 image, nearest-neighbor scaled to 64x64. I have found that if I use an embedded image which is too small (16x16 is "too small") then the image will simply not update. The image displayed in all layers, and able to be chosen in the "embedded image settings" is the last "good sized" image. I don't know what the boundaries are, but 16x16 is too small, and 512x512 is too big. I get artifacts on 512x512. Resizing 16x16 to 64x64, or inserting the 16x16 image into the "sample" sprite sheet (included with plugin) both update properly.
    ###Actually, while writing this up, this seems to not be the case. There seems to be some sort of voodoo black magic that determines if an image is "okay" or "not okay" and I have no clue what decides it. An image that worked 10 minutes before, no longer works now. As in, under embedded image, I am only offered the symbols/numbers/letters black and white sheet. Changing the image to the default "sample" image (with the afterburner jet, etc.) works fine.
    ###The sample png works reliably, every time. Copying the sample image and editing it in certain ways sometimes doesn't work. Creating a new image with different dimensions, or even the same image, works sometimes and I don't know what decides if it works or doesn't. This is sort of unrelated to what I was posting about originally, but it came up and maybe you can elucidate the issue.
    I've been writing this as I experimented, and I didn't delete the three previous paragraphs(prefixed with ###) because it sort of shows my progression and assumptions.
    My current working theory is that an image with the same number of characters (6 in the case of sample) will work reliably. renaming a file to "zample" or "ample_" or "sampl1" works, but "ssample" doesn't. Occasionally some images with different length names will sometimes work and sometimes they don't. While now I can reliably make an image display, some large large images (512x512) reliably produce artifacts.

    [​IMG]
    The first case is the 16x16 image, which ends up resized and distorted.
    [​IMG]
    The second case is a 64x64 version of the original 16x16 image (nearest neighbor scaled). from left to right, image width and image height are (-2,-2); (16,16); and (64,64) respectively. Sprite width/height were unchanged. I discovered that the 16x16 "image height, width" was the best version, and was pixel accurate in game. This is a workaround that fits what I need, and I have solved my own problem, but not really in a way that is satisfying. It works, but I don't like how it works. The (-2,-2) and (64,64) images are distorted.
    [​IMG]
    [​IMG]
    The third case is one of "artifacting". It is a 512x512 cyan and black cube. The three upper images have sprite dimensions 512x512, and image dimensions of (-2,-2); (16,16); and (64,64) respectively.

    I was limited to 5 total files so I didn't upload the actual files I used to generate these results (the 16x16, 64x64). If you want them, I'll upload them in a separate post
     

    Attached Files:

  4. Unwinder

    Unwinder Moderator Staff Member

    Messages:
    14,808
    Likes Received:
    1,921
    Try to increase sprite width and height by 1 pixel in embedded image settings dialog.
     

  5. get_me_out_of_here

    get_me_out_of_here New Member

    Messages:
    3
    Likes Received:
    0
    GPU:
    Model / Memory size
    That works for the 16x and 64x cases, but doesn't resolve "artifacting". I don't really have any practical use for the one that generates artifacts, it was just an experiment. I guess the image size is offset by 1, so it attempts to resize it. However, I have a workable solution for my purposes. For all intents and purposes, my question is resolved.

    edit: Is there a coordinate system? There is a set of position coordinates on the lower bar of the overlay editor, but that doesn't seem to be 1:1 with the pixels of the display.
    In the <name>.ovl file, there is a positionX and positionY value, I guess offset from the upper left corner.
    Is there a way to force the plugin to watch for updates on the <name>.ovl file? I want to be able to write to the overlay externally so I can exert more control over moving overlay elements (or showing/hiding them) while in game.
     
    Last edited: May 23, 2020
  6. Unwinder

    Unwinder Moderator Staff Member

    Messages:
    14,808
    Likes Received:
    1,921
    Your artifacting 512x512 PNG image is 8-bit palettized. Only 32-bit PNGs are supported for ebmedding in OSD. Convert it to correct format and it will work too.

    Positive coords are in pixels multiplied by zoom level. Negative ones are in symbols.

    I don't think that it is a good idea to poll file system and overlay file contents in realtime, it is a direct way to stuttering on some PCs. But the plugin's source is included in SDK so you can add it on your side to customize the editor for your personal needs.
     
  7. Unwinder

    Unwinder Moderator Staff Member

    Messages:
    14,808
    Likes Received:
    1,921
    There is alternate way to acheive that. HotkeyHanlder plugin allow assigning a hotkey for loading any desired overlay layout. So you may use it to forcibly reload the layout on the fly when necessary.
     
  8. Unwinder

    Unwinder Moderator Staff Member

    Messages:
    14,808
    Likes Received:
    1,921

Share This Page