Skip to content
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

Scaling3D, MSAA, and other Viewport properties have no effect on macOS #57784

Closed
cybereality opened this issue Feb 8, 2022 · 6 comments
Closed

Comments

@cybereality
Copy link
Contributor

Godot version

v4.0.alpha1.official [31a7ddb]

System information

Apple M1 macOS 12.1

Issue description

Changing the viewport properties directly on the root viewport have no affect on macOS in Godot 4.0.

This code works on Windows and Linux, but does nothing on Mac:

var viewport = get_viewport()
viewport.msaa = Viewport.MSAA_4X
viewport.scaling_3d_scale = 0.25

This is the work around I found that works on all operating systems:

var id = get_viewport().get_viewport_rid()
RenderingServer.viewport_set_msaa(id, Viewport.MSAA_4X)
RenderingServer.viewport_set_scaling_3d_scale(id, 0.25)

Steps to reproduce

Use the code I posted above or download the project below. Just play the project on macOS and see the viewport looks normal (no scaling or MSAA) but works fine on Windows and Linux.

Minimal reproduction project

MacScaling.zip

@cybereality
Copy link
Contributor Author

Wait, I'm sorry. I just double checked on macOS and it seems my reproduction project does in fact work. But that same code I posted did not work before in my main project and I'm sure it was broken only on Mac (meaning working on Windows and Linux so not a mistake in my code). However, there must have been some additional contributing factor, I will see if I can figure it out.

@cybereality
Copy link
Contributor Author

MacScaleGI.zip

Okay, so I attached a new project. It appears to have something to do with SDFGI, SSIL, or some combination of the two. The code works fine normally. But if you add a WorldEnvironment node and then enable SDFGI and SSIL (or maybe just SSIL) then the scaling stops working. However, it is not consistently reproducible. In the project I uploaded, it happen a few times, then I tried like 10 more times and it worked, without changing any code (just enabling or disabling SDFGI or SSIL). Seems to be some race condition, I'm not sure.

@Calinou
Copy link
Member

Calinou commented Feb 8, 2022

MSAA works on macOS when I last tried it (only up to 4×), but I didn't couple it with scaling options.

@cybereality
Copy link
Contributor Author

Yes, MSAA works, by itself, on Mac. The issue is that somehow either SSIL or SDFGI block the Viewport properties from working. I only needed msaa, screen_space_aa, and scaling_3d_scale, but it's possible other properties are broken as well. Once you get into this state, you are no longer able to change these properties directly through the viewport, nothing happens. However, changing them through RenderingServer still works.

@Calinou Calinou changed the title Scaling3D, MSAA, and other Viewport properties have no affect on macOS Scaling3D, MSAA, and other Viewport properties have no effect on macOS Sep 17, 2022
@Calinou
Copy link
Member

Calinou commented Sep 17, 2022

@cybereality Can you still reproduce this in 4.0.beta1?

@cybereality
Copy link
Contributor Author

I can confirm this is no longer an issue on 4.0 beta.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

3 participants