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

@@ -49,13 +49,13 @@
"ParentID": "ff6b6db54b5aa08e7286ef86246149ef",
"Transform": {
"Translation": {
"X": 1264.0,
"Y": 802.0,
"X": 1489.0,
"Y": 814.0,
"Z": 0.0
}
},
"Data": {
"Text": "900899 tris\n 500 drawcalls\n15fps"
"Text": "412955 tris\n 898 drawcalls\n120fps"
}
},
{
@@ -160,58 +160,6 @@
"TypeName": "Game.CrosshairWidget",
"ParentID": "2fe5467d4e92726e24227cbcbcbd2844",
"V": {}
},
{
"ID": "9b0c532d4247061970c809a0af58c82a",
"TypeName": "FlaxEngine.PostFxVolume",
"ParentID": "194e05f445ece24ec5448d886e1334df",
"Name": "GlobalPostFxVolume",
"Size": {
"X": 10.0,
"Y": 10.0,
"Z": 10.0
},
"IsBounded": false,
"Settings": {
"AO": {
"OverrideFlags": 13,
"Power": 0.5,
"Radius": 0.5
},
"Bloom": {
"OverrideFlags": 1,
"Enabled": false
},
"ToneMapping": {
"OverrideFlags": 4,
"Mode": 0
},
"ColorGrading": {},
"EyeAdaptation": {
"OverrideFlags": 1,
"Mode": 0
},
"CameraArtifacts": {
"OverrideFlags": 9,
"VignetteIntensity": 0.0,
"GrainAmount": 0.0
},
"LensFlares": {},
"DepthOfField": {},
"MotionBlur": {
"OverrideFlags": 1,
"Enabled": false
},
"SSR": {
"OverrideFlags": 1,
"Intensity": 0.0
},
"AA": {
"OverrideFlags": 1,
"Mode": 0
},
"PostFxMaterials": {}
}
}
]
}

View File

@@ -11,6 +11,276 @@
"ShadowsQuality": 3,
"ShadowMapsQuality": 3,
"AllowCSMBlending": true,
"GenerateSDFOnModelImport": true
"GlobalSDFQuality": 2,
"GenerateSDFOnModelImport": true,
"GIQuality": 2,
"GlobalSurfaceAtlasResolution": 2048,
"PostProcessSettings": {
"AO": {
"OverrideFlags": 13,
"Enabled": true,
"Intensity": 0.8,
"Power": 0.5,
"Radius": 0.5,
"FadeOutDistance": 5000.0,
"FadeDistance": 500.0
},
"GI": {
"OverrideFlags": 0,
"Mode": 0,
"Intensity": 1.0,
"TemporalResponse": 0.9,
"Distance": 20000.0,
"FallbackIrradiance": {
"R": 0.0,
"G": 0.0,
"B": 0.0,
"A": 0.0
}
},
"Bloom": {
"OverrideFlags": 1,
"Enabled": false,
"Intensity": 1.0,
"Threshold": 3.0,
"BlurSigma": 4.0,
"Limit": 10.0
},
"ToneMapping": {
"OverrideFlags": 4,
"WhiteTemperature": 6500.0,
"WhiteTint": 0.0,
"Mode": 0
},
"ColorGrading": {
"OverrideFlags": 0,
"ColorSaturation": {
"X": 1.0,
"Y": 1.0,
"Z": 1.0,
"W": 1.0
},
"ColorContrast": {
"X": 1.0,
"Y": 1.0,
"Z": 1.0,
"W": 1.0
},
"ColorGamma": {
"X": 1.0,
"Y": 1.0,
"Z": 1.0,
"W": 1.0
},
"ColorGain": {
"X": 1.0,
"Y": 1.0,
"Z": 1.0,
"W": 1.0
},
"ColorOffset": {
"X": 0.0,
"Y": 0.0,
"Z": 0.0,
"W": 0.0
},
"ColorSaturationShadows": {
"X": 1.0,
"Y": 1.0,
"Z": 1.0,
"W": 1.0
},
"ColorContrastShadows": {
"X": 1.0,
"Y": 1.0,
"Z": 1.0,
"W": 1.0
},
"ColorGammaShadows": {
"X": 1.0,
"Y": 1.0,
"Z": 1.0,
"W": 1.0
},
"ColorGainShadows": {
"X": 1.0,
"Y": 1.0,
"Z": 1.0,
"W": 1.0
},
"ColorOffsetShadows": {
"X": 0.0,
"Y": 0.0,
"Z": 0.0,
"W": 0.0
},
"ColorSaturationMidtones": {
"X": 1.0,
"Y": 1.0,
"Z": 1.0,
"W": 1.0
},
"ColorContrastMidtones": {
"X": 1.0,
"Y": 1.0,
"Z": 1.0,
"W": 1.0
},
"ColorGammaMidtones": {
"X": 1.0,
"Y": 1.0,
"Z": 1.0,
"W": 1.0
},
"ColorGainMidtones": {
"X": 1.0,
"Y": 1.0,
"Z": 1.0,
"W": 1.0
},
"ColorOffsetMidtones": {
"X": 0.0,
"Y": 0.0,
"Z": 0.0,
"W": 0.0
},
"ColorSaturationHighlights": {
"X": 1.0,
"Y": 1.0,
"Z": 1.0,
"W": 1.0
},
"ColorContrastHighlights": {
"X": 1.0,
"Y": 1.0,
"Z": 1.0,
"W": 1.0
},
"ColorGammaHighlights": {
"X": 1.0,
"Y": 1.0,
"Z": 1.0,
"W": 1.0
},
"ColorGainHighlights": {
"X": 1.0,
"Y": 1.0,
"Z": 1.0,
"W": 1.0
},
"ColorOffsetHighlights": {
"X": 0.0,
"Y": 0.0,
"Z": 0.0,
"W": 0.0
},
"ShadowsMax": 0.09,
"HighlightsMin": 0.5,
"LutTexture": null,
"LutWeight": 1.0
},
"EyeAdaptation": {
"OverrideFlags": 1,
"Mode": 0,
"SpeedUp": 3.0,
"SpeedDown": 1.0,
"PreExposure": 0.0,
"PostExposure": 0.0,
"MinBrightness": 0.03,
"MaxBrightness": 2.0,
"HistogramLowPercent": 70.0,
"HistogramHighPercent": 98.0
},
"CameraArtifacts": {
"OverrideFlags": 9,
"VignetteIntensity": 0.0,
"VignetteColor": {
"X": 0.0,
"Y": 0.0,
"Z": 0.001
},
"VignetteShapeFactor": 0.125,
"GrainAmount": 0.0,
"GrainParticleSize": 1.6,
"GrainSpeed": 1.0,
"ChromaticDistortion": 0.0,
"ScreenFadeColor": {
"R": 0.0,
"G": 0.0,
"B": 0.0,
"A": 0.0
}
},
"LensFlares": {
"OverrideFlags": 0,
"Intensity": 1.0,
"Ghosts": 8,
"HaloWidth": 0.16,
"HaloIntensity": 0.666,
"GhostDispersal": 0.3,
"Distortion": 1.5,
"ThresholdBias": -0.5,
"ThresholdScale": 0.22,
"LensDirt": null,
"LensDirtIntensity": 1.0,
"LensColor": null,
"LensStar": null
},
"DepthOfField": {
"OverrideFlags": 0,
"Enabled": false,
"BlurStrength": 1.0,
"FocalDistance": 1700.0,
"FocalRegion": 3000.0,
"NearTransitionRange": 300.0,
"FarTransitionRange": 500.0,
"DepthLimit": 0.0,
"BokehEnabled": true,
"BokehSize": 25.0,
"BokehBrightness": 1.0,
"BokehShape": 1,
"BokehShapeCustom": null,
"BokehBrightnessThreshold": 3.0,
"BokehBlurThreshold": 0.05,
"BokehFalloff": 0.5,
"BokehDepthCutoff": 1.5
},
"MotionBlur": {
"OverrideFlags": 1,
"Enabled": false,
"Scale": 1.0,
"SampleCount": 10,
"MotionVectorsResolution": 2
},
"SSR": {
"OverrideFlags": 1,
"Intensity": 0.0,
"DepthResolution": 2,
"RayTracePassResolution": 2,
"BRDFBias": 0.82,
"RoughnessThreshold": 0.45,
"WorldAntiSelfOcclusionBias": 0.1,
"ResolvePassResolution": 1,
"ResolveSamples": 4,
"EdgeFadeFactor": 0.1,
"FadeOutDistance": 5000.0,
"FadeDistance": 500.0,
"UseColorBufferMips": true,
"TemporalEffect": true,
"TemporalScale": 8.0,
"TemporalResponse": 0.8
},
"AA": {
"OverrideFlags": 1,
"Mode": 0,
"TAA_JitterSpread": 0.75,
"TAA_Sharpness": 0.0,
"TAA_StationaryBlending": 0.95,
"TAA_MotionBlending": 0.4
},
"PostFxMaterials": {
"Materials": null
}
}
}
}

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;

View File

@@ -839,6 +839,8 @@ namespace Game
childModel.Name = "Batch_" + kvp.Key.Path;
childModel.Model = batchModel;
//childModel.Position = geom.offset;
sdfModels.Add(batchModel);
}
}