-
Notifications
You must be signed in to change notification settings - Fork 38
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
User/brandon palmer/auto migrate shaders #199
base: main
Are you sure you want to change the base?
User/brandon palmer/auto migrate shaders #199
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is already a huge improvement, well done! Added a few comments inline. One other request is could you add support for these properties?
The surface type is a bit complex, but that logic occurs here:
Line 549 in cd755a0
// Setup the rendering mode based on the old shader. |
com.microsoft.mrtk.graphicstools.unity/Editor/ShaderGUIs/StandardShaderGUI.cs
Outdated
Show resolved
Hide resolved
com.microsoft.mrtk.graphicstools.unity/Editor/ShaderGUIs/StandardShaderGUI.cs
Outdated
Show resolved
Hide resolved
@@ -491,13 +492,28 @@ public override void AssignNewShaderToMaterial(Material material, Shader oldShad | |||
rimLighting = GetFloatProperty(material, "_UseRimLighting"); | |||
textureScaleOffset = GetVectorProperty(material, "_TextureScaleOffset"); | |||
} | |||
else if (oldShader.name.Contains("Universal Render Pipeline/Lit")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a suggestion, I wonder if you could collapse all this into one conditionally so the body was the same. For example:
if (oldShader.name.Contains("Universal Render Pipeline/Lit") || oldShader.name.Contains("Universal Render Pipeline/Simple Lit") || etc... )
{
normalMap = material.IsKeywordEnabled("_NORMALMAP") ? 1.0f : 0.0f;
emission = material.IsKeywordEnabled("_EMISSION") ? 1.0f : 0.0f;
reflections = GetFloatProperty(material, "_EnvironmentReflections");
specularHighlights = GetFloatProperty(material, "_SpecularHighlights");
smoothness = GetFloatProperty(material, "_Smoothness");
textureScaleOffset = GetVectorProperty(material, "_TextureScaleOffset");
metallic = GetFloatProperty(material, "_Metallic");
alphaClip = GetFloatProperty(material, "_AlphaClip");
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
…ardShaderGUI.cs Removed extra line Co-authored-by: Cameron <thmicka@microsoft.com>
…ardShaderGUI.cs Removed Extra Line Co-authored-by: Cameron <thmicka@microsoft.com>
Overview
When Converting Lit Shader to Graphics Tools, it will Retain Changes
Changes