WIP pre-reboot checkpoint: Menu Settings Graphics + live VFX res/samples + SDFGI quality
This commit is contained in:
parent
5c471d298b
commit
c6221758e9
12 changed files with 1217 additions and 113 deletions
|
|
@ -305,6 +305,31 @@ public partial class AtmosphereSystem : Node
|
|||
_volumetricEffect?.SetEmitterPool(pool);
|
||||
}
|
||||
|
||||
public void ApplyGraphicsSettings(GraphicsSettings settings)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(settings);
|
||||
EnsureInitialized();
|
||||
|
||||
_volumetricEffect?.ApplyGraphicsSettings(settings);
|
||||
|
||||
SdfgiSettingsConfig sdfgi = GraphicsSettings.GetSdfgiConfig(settings.SdfgiQuality);
|
||||
_env.SdfgiEnabled = sdfgi.Enabled;
|
||||
if (sdfgi.Enabled)
|
||||
{
|
||||
_env.SdfgiMinCellSize = sdfgi.MinCellSize;
|
||||
_env.SdfgiCascades = sdfgi.Cascades;
|
||||
}
|
||||
|
||||
if (RenderingServer.GetRenderingDevice() is not null)
|
||||
{
|
||||
RenderingServer.GISetUseHalfResolution(sdfgi.HalfResolution);
|
||||
RenderingServer.EnvironmentSetSdfgiRayCount(
|
||||
sdfgi.RayCount >= 8
|
||||
? RenderingServer.EnvironmentSdfgiRayCount.Count8
|
||||
: RenderingServer.EnvironmentSdfgiRayCount.Count4);
|
||||
}
|
||||
}
|
||||
|
||||
public override void _ExitTree()
|
||||
{
|
||||
if (_worldEnv is not null && GodotObject.IsInstanceValid(_worldEnv))
|
||||
|
|
|
|||
Loading…
Reference in a new issue