Change Antialiasing method from C++

Is there a way to change the antialiasing method between FXAA and Temporal AA from C++? I’m trying to put this ability in a game settings menu, and so far I haven’t seen a way to actually switch the method, say through GEngine->GameUserSettings.

It’s possible. You can change console variable r.DefaultFeature.AntiAliasing by C++ code

And, sorry, how do I change a console variable from C++?

Check out the UGameUserSettings class. From there you can access anti-aliasing settings.

Use PlayerController’s function ConsoleCommand() APlayerController::ConsoleCommand | Unreal Engine Documentation

If you want to do some action and be sure that AA is set before then use

IConsoleManager::Get()->FindConsoleVariable(TEXT("r.DefaultFeature.AntiAliasing")) to get your AA variable, set callback for it IConsoleVariable::SetOnChangedCallback | Unreal Engine Documentation and then set it IConsoleVariable::Set | Unreal Engine Documentation

But read cautions before

Of course you can write to ini. Use global GConfig variable and its function SetInt() FConfigCacheIni::SetInt | Unreal Engine Documentation and use another variable GEngineIni as Filename argument.
It won’t write to default ini, though, but it will write to user-specific ini which overrides default settings.

No, thanks, the first one did it. Is there a built in way to make that persist, e.g. writing to DefaultEngine.ini, or do I have to roll my own?

Thanks !
That’s the right way to do it :slight_smile: