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

Anti-Aliasing will not function until the graphics tab is selected #898

Closed
andrewwvc opened this issue Jul 23, 2022 · 5 comments
Closed

Comments

@andrewwvc
Copy link
Contributor

When starting up the game, even if AA is already set, it will not be applied to the game's graphics for that session until the graphics tab in the F1 menu has at least been hovered over.

Tested using develop-rachael, running on Pop!_OS 22.04 with default compiler settings.

@Flax4
Copy link

Flax4 commented Jul 23, 2022

Can confirm this happens on Windows too.

@andrewwvc
Copy link
Contributor Author

Ok, I've found the cause and believe I may have a solution. The lines in ImGuiImpl.cpp:
gfx_current_dimensions.internal_mul = CVar_GetFloat("gInternalResolution", 1);
gfx_msaa_level = CVar_GetS32("gMSAAValue", 1);

are each only called in the block that begins with:
if (ImGui::BeginMenu("Graphics"))

and these variables are otherwise never changed by the game code.
By adding these lines to the Init section of code in ImGuiImpl.cpp (immediately after ImGuiBackendInit() is called) the AA and resolution scaling will be applied at startup.

If there's a more appropriate section of the codebase to put this change instead, I'd be happy to know.

@GaryOderNichts
Copy link
Contributor

Initializing gfx_current_dimensions.internal_mul in SohImGui::Init will end up overwriting the multiplier in gfx_init:

gfx_current_dimensions.internal_mul = 1;

Either remove that line or move the initialization to gfx_init.

@andrewwvc
Copy link
Contributor Author

Either remove that line or move the initialization to gfx_init.

So, to be clear, are you arguing that the other line setting internal_mul to 1 ought to be replaced with CVar_GetS32("gMSAAValue", 1) given the CVars would default to 1 anyway, in which case gfx_msaa_level should be in the same gfx_init function? If so, I'll just make that change.

@GaryOderNichts
Copy link
Contributor

So, to be clear, are you arguing that the other line setting internal_mul to 1 ought to be replaced with CVar_GetS32("gMSAAValue", 1) given the CVars would default to 1 anyway, in which case gfx_msaa_level should be in the same gfx_init function? If so, I'll just make that change.

That's what I meant. Thanks for making a PR.

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

No branches or pull requests

3 participants