|
|
|
|
|
|
using UnityEditor; |
|
|
|
using UnityEditor.Experimental.Rendering; |
|
|
|
|
|
|
|
public class StandardToLowEndMaterialUpgrader : MaterialUpgrader |
|
|
|
public class StandardToLowEndMaterialUpgrader |
|
|
|
[MenuItem("RenderPipeline/LowEndMobilePipeline/Material Upgraders/Upgrade Standard Materials to Low End Mobile - Selection", false, 1)] |
|
|
|
[MenuItem("RenderPipeline/LowEndMobilePipeline/Material Upgraders/Upgrade Standard Materials to Low End Mobile - Project Folder", false, 1)] |
|
|
|
private static void UpgradeMaterialsToLDProject() |
|
|
|
{ |
|
|
|
List<MaterialUpgrader> upgraders = new List<MaterialUpgrader>(); |
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
[MenuItem("RenderPipeline/LowEndMobilePipeline/Material Upgraders/Upgrade Standard Materials to Low End Mobile - Project Folder", false, 2)] |
|
|
|
[MenuItem("RenderPipeline/LowEndMobilePipeline/Material Upgraders/Upgrade Standard Materials to Low End Mobile - Selection", false, 2)] |
|
|
|
private static void UpgradeMaterialsToLDSelection() |
|
|
|
{ |
|
|
|
List<MaterialUpgrader> upgraders = new List<MaterialUpgrader>(); |
|
|
|
|
|
|
|
|
|
|
private static void GetUpgraders(ref List<MaterialUpgrader> upgraders) |
|
|
|
{ |
|
|
|
upgraders.Add(new StandardToLowEndMaterialUpgrader("Standard (Specular setup)")); |
|
|
|
upgraders.Add(new StandardToLowEndMaterialUpgrader("Standard")); |
|
|
|
upgraders.Add(new StandardToLowEndMaterialUpgrader("TerrainSurface")); |
|
|
|
} |
|
|
|
|
|
|
|
StandardToLowEndMaterialUpgrader(string oldShaderName) |
|
|
|
{ |
|
|
|
RenameShader(oldShaderName, "ScriptableRenderPipeline/LowEndMobile/NonPBR"); |
|
|
|
RenameFloat("_Glossiness", "_Shininess"); |
|
|
|
upgraders.Add(new StandardUpgrader("Standard (Specular setup)")); |
|
|
|
upgraders.Add(new StandardUpgrader("Standard")); |
|
|
|
upgraders.Add(new TerrainUpgrader("TerrainSurface")); |
|
|
|
} |
|
|
|
} |