浏览代码

Added Render queue support to lowend shader inspector.

/vr_sandbox
Felipe Lira 8 年前
当前提交
2c8a0775
共有 1 个文件被更改,包括 9 次插入0 次删除
  1. 9
      Assets/LowEndMobilePipeline/Editor/LowendMobilePipelineMaterialEditor.cs

9
Assets/LowEndMobilePipeline/Editor/LowendMobilePipelineMaterialEditor.cs


using System;
using UnityEditor;
using UnityEngine;
using UnityEngine.Rendering;
public class LowendMobilePipelineMaterialEditor : ShaderGUI
{

EditorGUILayout.Space();
EditorGUILayout.Space();
materialEditor.RenderQueueField();
EditorGUILayout.Space();
EditorGUILayout.Space();
if ((BlendMode)blendModeProp.floatValue == BlendMode.Cutout)
{
Styles.warningStyle.normal.textColor = Color.yellow;

material.SetInt("_ZWrite", 1);
SetKeyword(material, "_ALPHATEST_ON", false);
SetKeyword(material, "_ALPHABLEND_ON", false);
material.renderQueue = -1;
break;
case BlendMode.Cutout:

material.SetInt("_ZWrite", 1);
SetKeyword(material, "_ALPHATEST_ON", true);
SetKeyword(material, "_ALPHABLEND_ON", false);
material.renderQueue = (int)RenderQueue.AlphaTest;
break;
case BlendMode.Alpha:

material.SetInt("_ZWrite", 0);
SetKeyword(material, "_ALPHATEST_ON", false);
SetKeyword(material, "_ALPHABLEND_ON", true);
material.renderQueue = (int) RenderQueue.Transparent;
break;
}
}

正在加载...
取消
保存