-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[3.x] Allow rendering of 3d content at lower resolution #74935
base: 3.x
Are you sure you want to change the base?
Conversation
d3af1c3
to
bbff3f9
Compare
This is useful for mobile devices that require more performance. |
bbff3f9
to
37186dc
Compare
Great work 🙂 Some comments (most of this can be done for future PRs):
|
I have a feeling that this should be exposed on a per-viewport basis as it is in 4.0. Doing viewport within viewport is pretty common for things like screens and gun scopes. Users will need the option to render at their selected resolution for the inner Viewports or else it will be very difficult to manage |
37186dc
to
0568bb2
Compare
0568bb2
to
51c574e
Compare
Updated the PR. The settings option has been renamed and an additional option for the filter mode has been added. I also added overwrites for specific viewports to the Viewport Node:
This won't be possible with my current code. At Ramatak our goal is to dynamically change the resolution while the game is running, so this PR doesn't actually change the size of the render buffer (buffer allocations are expensive). |
51c574e
to
eafb39c
Compare
eafb39c
to
36946c9
Compare
I see. We should try to support this use case in 4.x as well, likely by adding a separate This way, we'd still support the current approach for resolution scaling in 4.x. This is faster when you don't need dynamic resolution, or when it never goes past |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should work more like it does in 4.0. Primarily in 2 ways:
- The upscaling should happen at the time you copy the 3D buffers into the 2D buffer i.e. during the final post-process pass, not before post processing occurs. The reason is twofold 1) performance, you avoid a couple full screen copies and you can avoid doing Glow, auto-exposure, DoF at full res 2) quality, things like glow and DoF will build on the upscaling artifacts, plus they are low frequency effects so they will suffer from upscaling artifacts less.
Also, since you are doing a full screen blit anyway, you should have no problem supporting MSAA. When rendering at a lower resolution AA becomes much more important as the upscaling will make AA artifacts even worse.
[b]Note:[/b] This changes the width and the height of the 3D resolution. So if you set this setting to 0.5 you only render 1/4 the pixels. | ||
</member> | ||
<member name="rendering/quality/3d/resolution_scale_filter_method" type="int" setter="" getter="" default="1"> | ||
The fitlering method that is used when upscaling the 3D image. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The fitlering method that is used when upscaling the 3D image. | |
The filtering method that is used when upscaling the 3D image. |
This changes how the rendered image is filtered when it is upscaled. This defaults to whatever has been configured in the project settings. | ||
</member> | ||
<member name="resolution_scale_mix" type="bool" setter="set_resolution_scale_mix" getter="get_resolution_scale_mix" default="true"> | ||
If this is enabled the viewport specific scale factor is multiplied with the global scale factor that has been set in the project settings. If this is disabled the viewport scale overrides the global one for this viewport. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is enabled the viewport specific scale factor is multiplied with the global scale factor that has been set in the project settings. If this is disabled the viewport scale overrides the global one for this viewport. | |
If this is enabled, the viewport specific scale factor is multiplied with the global scale factor that has been set in the project settings. If this is disabled the viewport scale overrides the global one for this viewport. |
This makes it possible to dynamically adjust the rendering resolution of 3D content. 2D content and UI stuff are still rendered at full resolution.
The user can adjust the target resolution with the
Rendering/Quality/3D/Lower Resolution
project setting.The editor displaying a scene at 1/4 the resolution
This PR was sponsored by Ramatak with 💚