Skip to content

[ShaderGraph][2021.2][Backport] Fix for 1365780 - node settings warning message formatting #5678

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions com.unity.shadergraph/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Fixed compilation problems on preview shader when using hybrid renderer v2 and property desc override Hybrid Per Instance
- Fixed a serialization bug wrt PVT property flags when using subgraphs. This fixes SRP batcher compatibility.
- Fixed an incorrect direction transform from view to world space [1365186]
- Fixed the appearance (wrong text color, and not wrapped) of a warning in Node Settings [1365780]

## [11.0.0] - 2020-10-21

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,25 +101,32 @@ VisualElement CreateGUI(SampleVirtualTextureNode node, InspectableAttribute attr
// }

// display warning if the current render pipeline doesn't support virtual texturing
HelpBoxRow help = new HelpBoxRow(MessageType.Warning);
string labelText;
IVirtualTexturingEnabledRenderPipeline vtRp =
GraphicsSettings.currentRenderPipeline as IVirtualTexturingEnabledRenderPipeline;
if (vtRp == null)
propertySheet.Add(new HelpBoxRow(MessageType.Warning),
(row) => row.Add(new Label(
"The current render pipeline does not support Virtual Texturing, this node will do regular 2D sampling.")));
labelText = "The current render pipeline does not support Virtual Texturing, this node will do regular 2D sampling.";
else if (vtRp.virtualTexturingEnabled == false)
propertySheet.Add(new HelpBoxRow(MessageType.Warning),
(row) => row.Add(new Label(
"The current render pipeline has disabled Virtual Texturing, this node will do regular 2D sampling.")));
labelText = "The current render pipeline has disabled Virtual Texturing, this node will do regular 2D sampling.";
else
{
#if !ENABLE_VIRTUALTEXTURES
propertySheet.Add(new HelpBoxRow(MessageType.Warning),
(row) => row.Add(new Label(
"Virtual Texturing is disabled globally (possibly by the render pipeline settings), this node will do regular 2D sampling.")));
labelText = "Virtual Texturing is disabled globally (possibly by the render pipeline settings), this node will do regular 2D sampling.";
#else
labelText = "";
#endif
}

if (!string.IsNullOrEmpty(labelText))
{
var label = new Label(labelText)
{
name = "message-warn"
};
label.style.whiteSpace = WhiteSpace.Normal;
propertySheet.Add(help, (row) => row.Add(label));
}
propertyVisualElement = propertySheet;
return propertySheet;
}
Expand Down