remove global postfx volume and use global settings instead

This commit is contained in:
2022-06-17 23:39:11 +03:00
parent 97e74be0eb
commit 929c5de6ed
4 changed files with 294 additions and 80 deletions

View File

@@ -44,24 +44,19 @@ namespace Game
{
get
{
PostFxVolume postFx = Level.FindActor<PostFxVolume>();
if (postFx != null)
return postFx.CameraArtifacts.VignetteIntensity.ToString();
return "";
return Graphics.PostProcessSettings.CameraArtifacts.VignetteIntensity.ToString();
}
set
{
if (float.TryParse(value, out float valueFloat))
{
PostFxVolume postFx = Level.FindActor<PostFxVolume>();
if (postFx != null)
{
valueFloat = Mathf.Clamp(valueFloat, 0.0f, 2.0f);
valueFloat = Mathf.Clamp(valueFloat, 0.0f, 2.0f);
CameraArtifactsSettings cameraArtifacts = postFx.CameraArtifacts;
cameraArtifacts.VignetteIntensity = valueFloat;
postFx.CameraArtifacts = cameraArtifacts;
}
PostProcessSettings postProcessSettings = Graphics.PostProcessSettings;
CameraArtifactsSettings cameraArtifacts = postProcessSettings.CameraArtifacts;
cameraArtifacts.VignetteIntensity = valueFloat;
postProcessSettings.CameraArtifacts = cameraArtifacts;
Graphics.PostProcessSettings = postProcessSettings;
}
}
}
@@ -208,18 +203,17 @@ namespace Game
AssetManager.Globals.SetValue("Scene Lighting", boolValue);
PostFxVolume postFx = Level.FindActor<PostFxVolume>();
if (postFx != null)
{
AmbientOcclusionSettings aoSettings = postFx.AmbientOcclusion;
/*aoSettings.OverrideFlags = (aoSettings.OverrideFlags & ~AmbientOcclusionSettingsOverride.Enabled) |
(boolValue
? AmbientOcclusionSettingsOverride.Enabled
: 0 & AmbientOcclusionSettingsOverride.Enabled);
*/
aoSettings.Enabled = boolValue;
postFx.AmbientOcclusion = aoSettings;
}
PostProcessSettings postProcessSettings = Graphics.PostProcessSettings;
AmbientOcclusionSettings aoSettings = postProcessSettings.AmbientOcclusion;
/*aoSettings.OverrideFlags = (aoSettings.OverrideFlags & ~AmbientOcclusionSettingsOverride.Enabled) |
(boolValue
? AmbientOcclusionSettingsOverride.Enabled
: 0 & AmbientOcclusionSettingsOverride.Enabled);
*/
aoSettings.Enabled = boolValue;
postProcessSettings.AmbientOcclusion = aoSettings;
Graphics.PostProcessSettings = postProcessSettings;
// TODO: disable GI
Graphics.EnableGlobalSDF = boolValue;