Exclude UI from Render Scale Changes (Screen Space - Camera Canvas)

Hi everyone,

I’m working on a graphics quality setting in my game that allows players to adjust the render quality by modifying the Render Scale in the Universal Render Pipeline Asset (URP) settings. Here’s how I have it set up:

  • High: Render Scale = 1
  • Medium: Render Scale = 0.7
  • Low: Render Scale = 0.5

The issue I’m running into is that when I lower the Render Scale below 1, the quality of my UI also degrades (it becomes blurry and noisy). According to the Unity documentation, UI rendering should remain at native resolution regardless of the Render Scale setting (look here)

After hours of investigation, I found that when I set my Canvas Renderer to Screen Space - Overlay, the UI remains unaffected by the Render Scale adjustments. However, my game design requires the Canvas to be set to Screen Space - Camera because I have a 3D character positioned in front of the UI. In this mode, the UI quality suffers when the Render Scale is reduced.

Is there a way to exclude my UI canvas from being affected by the Render Scale when using Screen Space - Camera? Alternatively, is there another approach I could take to preserve UI quality in this setup while maintaining the 3D elements in front of the UI?

Any help or suggestions would be greatly appreciated!

1 Like

I’ll look into this.

1 Like

What version of Unity are you using?

I did a quick test with the latest Unity 6, changed the render scale to 0.25, added a UI button, changed it to Screen Space - Camera, and added a sphere. The sphere was clearly rendered at a low resolution, and the UI button remained the same at all render scales.

Perhaps something isn’t working as expected in the Unity version you’re using?

1 Like

@brendanduncan_u3d
Hey Brendan, thanks for looking into this!

I’m using Unity 2022.3.46f1 LTS (the latest LTS version from Unity Hub).

I did a similar test in an empty project with a simple 2D sprite image in a Canvas and a cube. The Canvas is set to Screen Space - Camera, and I’ve assigned the Main Camera to the Event Camera in the Canvas settings. Here’s what I found:

Render scale at 1. Everything, including the sprite and the cube, looks crisp:

Render scale set to 0.1. Both the cube and the 2D sprite are rendered in low quality:

Switched the Canvas to Screen Space - Overlay (of course I had to move the image to avoid covering the cube). In this case, the cube is low resolution, but the sprite remains sharp:

I can upload this sample project for further investigation if you need.
Thanks again. Let me know if you have any suggestions for this.

If you can send me your project with any needed instructions, that would be very helpful. It’ll be a week or more before I can take a look at it, I’ll be at Unite next week.

1 Like

Here’s a sample project. Please make sure to install the URP and TextMesh Pro from the Package Manager:
CanvasTest.unitypackage (923.7 KB)

Whenever you have a chance to take a look, it would be much appreciated.

1 Like

Hey @brendanduncan_u3d ,
Any chance you got to take a look at this issue?

Sorry, I haven’t forgotten, I’ve just been catching up on things after Unite. I’ll get to it soon.

1 Like

I tested your package and can clearly repo the issue.

What’s different than the test I did? I have no idea. I asked the URP team.

1 Like

Thanks for testing, @brendanduncan_u3d. Any word from the URP team?
From many forum posts I’ve read, this seems to be the intended behavior since Screen Space - Camera canvases are part of the 3D world and follow the render scale in URP.

Is there a way to override this behavior? Could I exclude a specific canvas from the render scale or apply a different scale just for UI with code? I’ve tried some solutions but haven’t had success. Also, is this tied to camera or is it purely a URP setting?

We’re on a deadline to improve UI text quality for our publisher. Switching to Screen Space - Overlay isn’t an option since we have 3D characters in front of the UI (see below image).

Any help would be greatly appreciated.

I never did hear anything back from the URP team. I’ll dig into this some more, see if I can come up with anything.

Thinking about it more, I’m not sure if this will be possible to have a camera space UI not affected by renderScale. For the UI to render inside the scene, it would need to render into the same depth and color texture as the rest of the scene, which is at the renderScale resolution. I poked around with it a bit and was finding that to be the case.

So what options might you have? I can’t think of anything simple. Some hacky ideas:

renderScale applies to the rendering backbuffer texture URP uses, so it’s not per camera. Render Textures are per camera. You could create a Render Texture at runtime, by getting the screen resolution and scaling it by what you would have set the renderScale, render the scene minus the UI into that. Then blit the render texture onto the display texture. The part I don’t have an answer to yet, is you would want to also blit the depth texture from the render texture, onto the display depth texture, but being at different resolutions you would need to upscale it with point sampling (linear sampling wouldn’t be correct). Likely this would produce aliasing artifacts, once it was figured out how to do it.

It’s a tough problem.

Hi, sorry for using this thread for my own questions, but can you clarify if “UI rendered by Screen Space - Camera is affected by render scale” is an intended feature?

The thing is, I am building a game that’s heavily dependent on UI, and I want to take advantages of Render Scaling too. I don’t see why UI should be excluded from this feature, either. If the whole game is render scaled, shouldn’t UI, which is part of the game, also be affected too?

If all UI not being affected by Render Scale is intended, and the current setup is a mistake which will be fixed in the future, would it be possible to make “render scaling UI” an option for the users?

Another thing I want to get clarified is that, currently, are the (accidentally rendered down) UI upscaled by the Upscaling Filter, such as STP? It seems like they are, but they are still blurry in comparison to the upscaled 3D scene shown in this video: https://youtu.be/3rIhJqMbbhg?t=898, so I just want to know the answer for sure.

Thank you in advance!

1 Like

@Developer1999-1
I can answer your first question: Whether or not UI elements are affected by render scaling depends on the type of UI.

In old games, UI elements and game rendering quality were tied together, lowering the game’s resolution would also degrade the UI quality. This is not the modern game development best practice. Today, users can have the option to change the render quality in the settings, we have features such as Dynamic Render Scaling to adjust rendering resolution dynamically to maintain a stable frame rate. Technologies like DLSS and FSR exist to enhance performance by rendering at a lower resolution. People with lower-end PCs shouldn’t have to struggle to read or even see the menus!

In modern games, UI is typically treated separately from the 3D game world for a consistent and clear experience for players. Unity does this by default when using Screen Space - Overlay mode, the UI elements remain at the native display resolution, independent of render scaling. Core UI elements like menus, alerts, and modals, always appear sharp and clear, regardless of the rendering quality of the 3D environment.

However, when using Screen Space - Camera or World Space Canvas, the UI becomes part of the 3D scene and is subject to the same render scaling as the rest of the game world. Because it is expected that UI elements positioned within the 3D environment like floating text, in-world HUD elements, and interactive items, scale with the environment render resolution together.

Regarding your second question about the upscaling filter, yes, I believe in Screen Space Camera mode, UI elements are upscaled using the same techniques as the rest of the scene, including filters such as STP. But since the UI elements often contain fine lines and text, they may appear blurrier compared to the upscaled 3D environment, which relies on different cues for sharpness.

It would really be useful for Unity to provide an option to allow users to choose whether UI should be affected by render scaling or remain at native resolution.

4 Likes

Hey, any news on this? Its quite hard to do any kind of tutorial overlay without UI camera, to position 3D objects on top of UI elements.
Any way to make “screen space - camera” to ignore render scale or setting render scale per camera would be nice.

1 Like