您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
38 行
1.6 KiB
38 行
1.6 KiB
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
namespace UnityEditor.Experimental.Rendering.HDPipeline
|
|
{
|
|
public class UpgradeStandardShaderMaterials
|
|
{
|
|
static List<MaterialUpgrader> GetHDUpgraders()
|
|
{
|
|
var upgraders = new List<MaterialUpgrader>();
|
|
upgraders.Add(new StandardToHDLitMaterialUpgrader("Standard", "HDRenderPipeline/Lit", LitGUI.SetupMaterialKeywordsAndPass));
|
|
upgraders.Add(new StandardSpecularToHDLitMaterialUpgrader("Standard (Specular setup)", "HDRenderPipeline/Lit", LitGUI.SetupMaterialKeywordsAndPass));
|
|
return upgraders;
|
|
}
|
|
|
|
[MenuItem("RenderPipeline/HDRenderPipeline/Material Upgraders/Upgrade Standard Materials to Lit Materials - Project Folder", false, 1)]
|
|
static void UpgradeMaterialsProject()
|
|
{
|
|
MaterialUpgrader.UpgradeProjectFolder(GetHDUpgraders(), "Upgrade to HD Material");
|
|
}
|
|
|
|
[MenuItem("RenderPipeline/HDRenderPipeline/Material Upgraders/Upgrade Standard Materials to Lit Materials - Selection", false, 2)]
|
|
static void UpgradeMaterialsSelection()
|
|
{
|
|
MaterialUpgrader.UpgradeSelection(GetHDUpgraders(), "Upgrade to HD Material");
|
|
}
|
|
|
|
[MenuItem("RenderPipeline/HDRenderPipeline/Material Upgraders/Modify Light Intensity for Upgrade - Scene Only", false, 3)]
|
|
static void UpgradeLights()
|
|
{
|
|
Light[] lights = Light.GetLights(LightType.Directional, 0);
|
|
foreach (var l in lights)
|
|
{
|
|
l.intensity *= Mathf.PI;
|
|
}
|
|
}
|
|
}
|
|
}
|