浏览代码

implement a material upgrader to port standard shader for all materials to one belonging to renderloop

/main
Filip Iliescu 8 年前
当前提交
5b00b86c
共有 1 个文件被更改,包括 16 次插入0 次删除
  1. 16
      Assets/ScriptableRenderPipeline/MobileRenderPipeline/ClassicDeferred/ClassicDeferredPipeline.cs

16
Assets/ScriptableRenderPipeline/MobileRenderPipeline/ClassicDeferred/ClassicDeferredPipeline.cs


var instance = ScriptableObject.CreateInstance<ClassicDeferredPipeline> ();
UnityEditor.AssetDatabase.CreateAsset (instance, "Assets/ClassicDeferredPipeline.asset");
}
[UnityEditor.MenuItem("MobileRenderPipeline/Setup Materials")]
static void SetupDeferredRenderPipelineMaterials()
{
Renderer[] _renderers = Component.FindObjectsOfType<Renderer> ();
foreach (Renderer _renderer in _renderers) {
Material[] _materials = _renderer.sharedMaterials;
foreach (Material _material in _materials) {
if (_material.shader.name.Contains ("Standard (Specular setup)")) {
_material.shader = Shader.Find("Standard-SRP (Specular setup)");
} else if (_material.shader.name.Contains ("Standard")) {
_material.shader = Shader.Find("Standard-SRP");
}
}
}
}
#endif
protected override IRenderPipeline InternalCreatePipeline()

正在加载...
取消
保存