Add option to force MSAA samples (#448)

This commit is contained in:
pizzaboxer 2023-07-29 23:29:53 +01:00
parent bfe32ab679
commit 92aaa86d4f
No known key found for this signature in database
GPG Key ID: 59D4A1DBAD0F2BA8
3 changed files with 28 additions and 1 deletions

View File

@ -23,6 +23,7 @@ namespace Bloxstrap
{ "Rendering.ManualFullscreen", "FFlagHandleAltEnterFullscreenManually" },
{ "Rendering.TexturePack", "FStringPartTexturePackTable2022" },
{ "Rendering.DisableScaling", "DFFlagDisableDPIScale" },
{ "Rendering.MSAA", "FIntDebugForceMSAASamples" },
{ "Rendering.Mode.D3D11", "FFlagDebugGraphicsPreferD3D11" },
{ "Rendering.Mode.D3D10", "FFlagDebugGraphicsPreferD3D11FL10" },
@ -61,6 +62,15 @@ namespace Bloxstrap
{ "Future (Phase 3)", "Future" }
};
public static IReadOnlyDictionary<string, string?> MSAAModes => new Dictionary<string, string?>
{
{ "Automatic", null },
{ "1x MSAA", "1" },
{ "2x MSAA", "2" },
{ "4x MSAA", "4" },
{ "8x MSAA", "8" }
};
// this is one hell of a dictionary definition lmao
// since these all set the same flags, wouldn't making this use bitwise operators be better?
public static IReadOnlyDictionary<string, Dictionary<string, string?>> IGMenuVersions => new Dictionary<string, Dictionary<string, string?>>
@ -118,7 +128,7 @@ namespace Bloxstrap
else
{
if (Prop.ContainsKey(key))
App.Logger.WriteLine(LOG_IDENT, $"Setting of '{key}' from '{Prop[key]}' to '{value}' is pending");
App.Logger.WriteLine(LOG_IDENT, $"Changing of '{key}' from '{Prop[key]}' to '{value}' is pending");
else
App.Logger.WriteLine(LOG_IDENT, $"Setting of '{key}' to '{value}' is pending");

View File

@ -171,6 +171,15 @@
</ui:CardControl.Header>
<ComboBox Margin="5,0,0,0" Padding="10,5,10,5" Width="200" ItemsSource="{Binding RenderingModes.Keys, Mode=OneTime}" Text="{Binding SelectedRenderingMode, Mode=TwoWay}" />
</ui:CardControl>
<ui:CardControl Margin="0,8,0,0">
<ui:CardControl.Header>
<StackPanel>
<TextBlock FontSize="14" Text="Antialiasing quality" />
<TextBlock Margin="0,2,0,0" FontSize="12" Text="Forces the amount of MSAA samples that are taken." Foreground="{DynamicResource TextFillColorTertiaryBrush}" />
</StackPanel>
</ui:CardControl.Header>
<ComboBox Margin="5,0,0,0" Padding="10,5,10,5" Width="200" ItemsSource="{Binding MSAAModes.Keys, Mode=OneTime}" Text="{Binding SelectedMSAAMode, Mode=TwoWay}" />
</ui:CardControl>
<ui:CardControl Margin="0,8,0,0">
<ui:CardControl.Header>
<StackPanel>

View File

@ -127,6 +127,14 @@ namespace Bloxstrap.UI.ViewModels.Menu
set => App.FastFlags.SetPresetEnum("Rendering.Lighting", LightingModes[value], "True");
}
public IReadOnlyDictionary<string, string?> MSAAModes => FastFlagManager.MSAAModes;
public string SelectedMSAAMode
{
get => MSAAModes.First(x => x.Value == App.FastFlags.GetPreset("Rendering.MSAA")).Key ?? MSAAModes.First().Key;
set => App.FastFlags.SetPreset("Rendering.MSAA", MSAAModes[value]);
}
public bool GuiHidingEnabled
{
get => App.FastFlags.GetPreset("UI.Hide") == "32380007";