Skip to content
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

[ShaderGraph][2022.1] Fix 1356725 - incorrect appearance of warning message in Node Settings #5672

Merged
merged 3 commits into from
Sep 15, 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 @@ -17,6 +17,7 @@ The version number for this package has increased due to a version update of a r
- Fixed an incorrect direction transform from view to world space [1362034] (https://issuetracker.unity3d.com/product/unity/issues/guid/1362034/)
- Fixed ShaderGraph HDRP master preview disappearing for a few seconds when graph is modified [1330289] (https://issuetracker.unity3d.com/issues/shadergraph-hdrp-main-preview-is-invisible-until-moved)
- Fixed noise nodes to use a deterministic integer hash, instead of platform dependent floating point hashes [1156544]
- Fixed the appearance (wrong text color, and not wrapped) of a warning in Node Settings [1356725] (https://issuetracker.unity3d.com/product/unity/issues/guid/1356725/)

## [12.0.0] - 2021-01-11

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,25 +101,30 @@ 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.";
#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