Skip to content

Commit

Permalink
Improve no Tonemapping message to be more relevant and add a link to …
Browse files Browse the repository at this point in the history
…relevant documentation about it
  • Loading branch information
oneVR committed Jun 4, 2021
1 parent d200819 commit e92302a
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions Scripts/Editor/WorldDebugger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1375,7 +1375,7 @@ public static Action SetPostProcessingLayerResources(PostProcessLayer postProces

private const string NoMatchingLayersFound = "No enabled Post Processing Volumes found with matching layers to the main Post Processing Layer. Layers currently set to: {0}";

private const string DontUseNoneForTonemapping = "Use either Neutral or ACES for Color Grading Tonemapping. Selecting None for Tonemapping is essentially the same as leaving Tonemapping unchecked.";
private const string TonemapperMissing = "No global Tonemapper found. When there is no Tonemapper set, the colors in the scene will be distorted. Ideally, use Neutral or ACES.";

private const string TooHighBloomIntensity = "Do not raise the Bloom intensity too high! It is best to use a low Bloom intensity, between 0.01 to 0.3.";

Expand Down Expand Up @@ -2283,6 +2283,8 @@ private void CheckScene()
postProcessing.AddMessageGroup(new MessageGroup(NoMatchingLayersFound, MessageType.Warning).AddSingleMessage(new SingleMessage(Helper.GetAllLayersFromMask(postprocessLayer.volumeLayer)).SetSelectObject(postprocessLayer.gameObject)));
}

var noTonemapper = true;

// Go trough the profile settings and see if any bad one's are used
foreach (var postProcessVolume in matchingVolumes)
{
Expand All @@ -2308,17 +2310,17 @@ private void CheckScene()
postProcessing.AddMessageGroup(new MessageGroup(VignetteWarning, MessageType.Warning).AddSingleMessage(new SingleMessage(postProcessVolume.gameObject)));
}

var colorGrading = postProcessProfile.GetSetting<ColorGrading>();
if (colorGrading && colorGrading.enabled && colorGrading.active)
if (postProcessVolume.isGlobal)
{
if (colorGrading.tonemapper.value == Tonemapper.None && colorGrading.gradingMode == GradingMode.HighDefinitionRange)
var colorGrading = postProcessProfile.GetSetting<ColorGrading>();
if (colorGrading && colorGrading.enabled && colorGrading.active)
{
postProcessing.AddMessageGroup(new MessageGroup(DontUseNoneForTonemapping, MessageType.Error).AddSingleMessage(new SingleMessage(postProcessVolume.gameObject)));
if (colorGrading.tonemapper.overrideState && colorGrading.tonemapper.value == Tonemapper.None || !colorGrading.tonemapper.overrideState && colorGrading.gradingMode == GradingMode.HighDefinitionRange)
{
noTonemapper = false;
}
}
}

if (postProcessVolume.isGlobal)
{
var bloom = postProcessProfile.GetSetting<Bloom>();
if (bloom && bloom.enabled && bloom.active)
{
Expand All @@ -2345,6 +2347,11 @@ private void CheckScene()
}
}
}

if (noTonemapper)
{
postProcessing.AddMessageGroup(new MessageGroup(TonemapperMissing, MessageType.Tips).SetDocumentation("https://gitlab.com/s-ilent/SCSS/-/wikis/Other/Post-Processing#colour-grading"));
}
}
}
}
Expand Down

0 comments on commit e92302a

Please sign in to comment.