Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Join us on Dec 8, 2022, between 7 am & 7 pm EST, in the DOTS Dev Blitz Day 2022 - Q&A forum, Discord, and Unity3D Subreddit to learn more about DOTS directly from the Unity Developers.
    Dismiss Notice
  3. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    Dismiss Notice

Render Scale Using Nearest Neighbor?

Discussion in 'Universal Render Pipeline' started by mizabitha, Feb 8, 2022.

  1. mizabitha

    mizabitha

    Joined:
    Jan 21, 2022
    Posts:
    1
    Hello! Please forgive me if this is a really basic question, I know in 2D rendering this would be pretty simple but I'm not used to 3D at all.

    I want to lock the resolution of my game at a low level (480x270) to keep everything looking really chunky, as if it's a widescreen PSX game, but that's pretty small on a lot of monitors now so I want the player to have the option to scale it up to 2, 3, or 4 times the size to 1080p, but with the pixels all staying chunky as the same resolution, resized at nearest neighbor.

    Simple enough (I think) and URP's render scale option is perfect for this. However, the process of scaling seems to come with some filtering and I can't figure out how to turn it off. MSAA options seem to only affect the lower render scale, so if I disable MSAA the filter remains. Is there any way to change the way render scale works?

    Basically (and please ignore my use of picocad models of extremely copyrighted characters; this is just a practice project) I want to be able to dynamically upscale this:


    So it looks like this:


    but URP defaults to this:


    Clicking around for threads about similar problems I've seen people talking up pixelation filters, which seem to defeat the purpose, and also mention of rendering to a texture and then just displaying the texture, which I suppose I'll have to do if there's no easy way to affect URP's scale options.
     
    mimiCryMuffin likes this.
  2. mimiCryMuffin

    mimiCryMuffin

    Joined:
    Oct 23, 2015
    Posts:
    9
    I have the same question
     
  3. CChong_at_Infinity

    CChong_at_Infinity

    Joined:
    Apr 7, 2020
    Posts:
    23
    I would also like to know.

    Unity 2021.3 with URP 14.xx has an option to select between automatic, bilinear or nearest-neighbor (point sampled) filtering, but while it seems to have an effect when playing in the editor, my Android builds show no difference.

    As you have pointed out, you can render to a texture to get the desired result, but this has fairly serious performance implications if you're intending for the game to run on low-end mobile hardware.
     
  4. StreamlineDesigns

    StreamlineDesigns

    Joined:
    Jun 13, 2019
    Posts:
    1
    Same! And wow that's not great to hear; No performance difference on Android but I'm new to upscaling techniques... I wonder why this is occurring. For NN upscaling for example - I thought regardless of chipset, it should substantially decrease graphics load unless I'm mistaken about how that works. I didn't see it anywhere but maybe its possible the default settings allow upscaling but you have to manually enable it for other platforms. Also, I would think that with this enabled, you are able to resize your images to be much smaller, use NN upscaling, then get the performance boost of having decreased the data input to the GPU while retaining image quality. Maybe that's the answer. It's a process to use, not just a button that makes it work.