浏览代码

Fixed standar to lightweight upgrader. Removed terrains as we need to do a new upgrader.

/Add-support-for-light-specular-color-tint
Felipe Lira 7 年前
当前提交
a390328a
共有 2 个文件被更改,包括 19 次插入2 次删除
  1. 20
      ScriptableRenderPipeline/LightweightPipeline/Editor/LightweightPipelineUpgraders.cs
  2. 1
      ScriptableRenderPipeline/LightweightPipeline/Editor/StandardToLightweightMaterialUpgrader.cs

20
ScriptableRenderPipeline/LightweightPipeline/Editor/LightweightPipelineUpgraders.cs


public class StandardUpgrader : MaterialUpgrader
{
public static void UpdateStandardMaterialKeywords(Material material)
{
material.SetFloat("_WorkflowMode", 1.0f);
LightweightShaderHelper.SetKeyword(material, "_OCCLUSIONMAP", material.GetTexture("_OcclusionMap"));
LightweightShaderHelper.SetKeyword(material, "_METALLICSPECGLOSSMAP", material.GetTexture("_MetallicGlossMap"));
}
public static void UpdateStandardSpecularMaterialKeywords(Material material)
{
material.SetFloat("_WorkflowMode", 0.0f);
LightweightShaderHelper.SetKeyword(material, "_OCCLUSIONMAP", material.GetTexture("_OcclusionMap"));
LightweightShaderHelper.SetKeyword(material, "_METALLICSPECGLOSSMAP", material.GetTexture("_SpecGlossMap"));
LightweightShaderHelper.SetKeyword(material, "_SPECULAR_SETUP", true);
}
RenameShader(oldShaderName, LightweightPipelineAsset.m_StandardShaderPath);
if (oldShaderName.Contains("Specular"))
RenameShader(oldShaderName, LightweightPipelineAsset.m_StandardShaderPath, UpdateStandardSpecularMaterialKeywords);
else
RenameShader(oldShaderName, LightweightPipelineAsset.m_StandardShaderPath, UpdateStandardMaterialKeywords);
}
}

1
ScriptableRenderPipeline/LightweightPipeline/Editor/StandardToLightweightMaterialUpgrader.cs


{
upgraders.Add(new StandardUpgrader("Standard (Specular setup)"));
upgraders.Add(new StandardUpgrader("Standard"));
upgraders.Add(new TerrainUpgrader("TerrainSurface"));
}
}
}
正在加载...
取消
保存