您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
76 行
1.3 KiB
76 行
1.3 KiB
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class ShaderPerfTests : MonoBehaviour {
|
|
|
|
public Material mat;
|
|
|
|
public void ToggleVert(bool toggle)
|
|
{
|
|
string key = "_PERF_VERT";
|
|
if(toggle)
|
|
mat.EnableKeyword(key);
|
|
else
|
|
mat.DisableKeyword(key);
|
|
}
|
|
|
|
public void ToggleRef(bool toggle)
|
|
{
|
|
string key = "_PERF_REF";
|
|
if(toggle)
|
|
mat.EnableKeyword(key);
|
|
else
|
|
mat.DisableKeyword(key);
|
|
}
|
|
|
|
public void ToggleCol(bool toggle)
|
|
{
|
|
string key = "_PERF_COL";
|
|
if(toggle)
|
|
mat.EnableKeyword(key);
|
|
else
|
|
mat.DisableKeyword(key);
|
|
}
|
|
public void ToggleDepth(bool toggle)
|
|
{
|
|
string key = "_PERF_DEPTH";
|
|
if(toggle)
|
|
mat.EnableKeyword(key);
|
|
else
|
|
mat.DisableKeyword(key);
|
|
}
|
|
public void ToggleLight(bool toggle)
|
|
{
|
|
string key = "_PERF_LIGHTING";
|
|
if(toggle)
|
|
mat.EnableKeyword(key);
|
|
else
|
|
mat.DisableKeyword(key);
|
|
}
|
|
public void ToggleFresnel(bool toggle)
|
|
{
|
|
string key = "_PERF_FRESNEL";
|
|
if(toggle)
|
|
mat.EnableKeyword(key);
|
|
else
|
|
mat.DisableKeyword(key);
|
|
}
|
|
public void ToggleGerstner(bool toggle)
|
|
{
|
|
string key = "_PERF_GERSTNER";
|
|
if(toggle)
|
|
mat.EnableKeyword(key);
|
|
else
|
|
mat.DisableKeyword(key);
|
|
}
|
|
public void ToggleFoam(bool toggle)
|
|
{
|
|
string key = "_PERF_FOAM";
|
|
if(toggle)
|
|
mat.EnableKeyword(key);
|
|
else
|
|
mat.DisableKeyword(key);
|
|
}
|
|
|
|
}
|