editor: sampler modifications will happen after system init
This commit is contained in:
+17
-11
@@ -630,23 +630,17 @@ void GraphicsWindow::Create(EditorComponent* _editor)
|
||||
break;
|
||||
}
|
||||
|
||||
desc.mip_lod_bias = wi::math::Clamp(mipLodBiasSlider.GetValue(), -15.9f, 15.9f);
|
||||
|
||||
wi::renderer::ModifyObjectSampler(desc);
|
||||
|
||||
editor->main->config.GetSection("graphics").Set("texture_quality", args.iValue);
|
||||
editor->main->config.Commit();
|
||||
});
|
||||
if (editor->main->config.GetSection("graphics").Has("texture_quality"))
|
||||
{
|
||||
textureQualityComboBox.SetSelected(editor->main->config.GetSection("graphics").GetInt("texture_quality"));
|
||||
}
|
||||
else
|
||||
{
|
||||
textureQualityComboBox.SetSelected(3);
|
||||
}
|
||||
textureQualityComboBox.SetTooltip("Choose a texture sampling method for material textures.");
|
||||
AddWidget(&textureQualityComboBox);
|
||||
|
||||
mipLodBiasSlider.Create(-2, 2, 0, 100000, "MipLOD Bias: ");
|
||||
mipLodBiasSlider.Create(-16, 16, 0, 100000, "MipLOD Bias: ");
|
||||
mipLodBiasSlider.SetTooltip("Bias the rendered mip map level of the material textures.");
|
||||
mipLodBiasSlider.SetSize(XMFLOAT2(wid, itemheight));
|
||||
mipLodBiasSlider.SetPos(XMFLOAT2(x, y += step));
|
||||
@@ -1398,7 +1392,6 @@ void GraphicsWindow::Create(EditorComponent* _editor)
|
||||
|
||||
fsr2Combo.Create("FSR 2.1 Preset: ");
|
||||
fsr2Combo.SetTooltip("Set resolution scaling quality mode for FSR 2.1:\nQuality: 1.5x\nBalanced: 1.7x\nPerformance: 2.0x\nUltra performance: 3.0x");
|
||||
int fsr2_preset = editor->main->config.GetSection("graphics").GetInt("fsr2_preset");
|
||||
fsr2Combo.SetSize(XMFLOAT2(wid, hei));
|
||||
fsr2Combo.SetPos(XMFLOAT2(x, y += step));
|
||||
fsr2Combo.AddItem("Quality", (uint64_t)wi::RenderPath3D::FSR2_Preset::Quality);
|
||||
@@ -1415,7 +1408,6 @@ void GraphicsWindow::Create(EditorComponent* _editor)
|
||||
editor->main->config.GetSection("graphics").Set("fsr2_preset", args.iValue);
|
||||
editor->main->config.Commit();
|
||||
});
|
||||
fsr2Combo.SetSelected(fsr2_preset);
|
||||
AddWidget(&fsr2Combo);
|
||||
|
||||
SetVisible(false);
|
||||
@@ -1855,3 +1847,17 @@ void GraphicsWindow::ResizeLayout()
|
||||
|
||||
|
||||
}
|
||||
|
||||
void GraphicsWindow::ApplySamplerSettings()
|
||||
{
|
||||
if (editor->main->config.GetSection("graphics").Has("texture_quality"))
|
||||
{
|
||||
textureQualityComboBox.SetSelected(editor->main->config.GetSection("graphics").GetInt("texture_quality"));
|
||||
}
|
||||
else
|
||||
{
|
||||
textureQualityComboBox.SetSelected(3);
|
||||
}
|
||||
int fsr2_preset = editor->main->config.GetSection("graphics").GetInt("fsr2_preset");
|
||||
fsr2Combo.SetSelected(fsr2_preset); // modifies sampler bias
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user