LayaPBRSpecularGUI.cs 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561
  1. //#if UNITY_EDITOR
  2. using System;
  3. using UnityEngine;
  4. using UnityEditor;
  5. class LayaPBRSpecularGUI : ShaderGUI
  6. {
  7. public enum RenderMode
  8. {
  9. /**渲染状态_不透明。*/
  10. Opaque = 0,
  11. /**渲染状态_透明测试。*/
  12. Cutout = 1,
  13. /**渲染状态_透明混合_菲涅尔不影响透明度。*/
  14. Fade = 2,
  15. /**渲染状态_透明混合_物理上看似合理的透明。*/
  16. Transparent = 3,
  17. /**渲染状态_自定义。*/
  18. Custom = 4
  19. }
  20. public enum SrcBlendMode
  21. {
  22. //Blend factor is (0, 0, 0, 0).
  23. Zero = 0,
  24. //Blend factor is (1, 1, 1, 1).
  25. One = 1,
  26. //Blend factor is (Rd, Gd, Bd, Ad).
  27. DstColor = 2,
  28. //Blend factor is (Rs, Gs, Bs, As).
  29. SrcColor = 3,
  30. //Blend factor is (1 - Rd, 1 - Gd, 1 - Bd, 1 - Ad).
  31. OneMinusDstColor = 4,
  32. //Blend factor is (As, As, As, As).
  33. SrcAlpha = 5,
  34. //Blend factor is (1 - Rs, 1 - Gs, 1 - Bs, 1 - As).
  35. OneMinusSrcColor = 6,
  36. //Blend factor is (Ad, Ad, Ad, Ad).
  37. DstAlpha = 7,
  38. //Blend factor is (1 - Ad, 1 - Ad, 1 - Ad, 1 - Ad).
  39. OneMinusDstAlpha = 8,
  40. //Blend factor is (f, f, f, 1); where f = min(As, 1 - Ad).
  41. SrcAlphaSaturate = 9,
  42. //Blend factor is (1 - As, 1 - As, 1 - As, 1 - As).
  43. OneMinusSrcAlpha = 10
  44. }
  45. public enum DstBlendMode
  46. {
  47. //Blend factor is (0, 0, 0, 0).
  48. Zero = 0,
  49. //Blend factor is (1, 1, 1, 1).
  50. One = 1,
  51. //Blend factor is (Rd, Gd, Bd, Ad).
  52. DstColor = 2,
  53. //Blend factor is (Rs, Gs, Bs, As).
  54. SrcColor = 3,
  55. //Blend factor is (1 - Rd, 1 - Gd, 1 - Bd, 1 - Ad).
  56. OneMinusDstColor = 4,
  57. //Blend factor is (As, As, As, As).
  58. SrcAlpha = 5,
  59. //Blend factor is (1 - Rs, 1 - Gs, 1 - Bs, 1 - As).
  60. OneMinusSrcColor = 6,
  61. //Blend factor is (Ad, Ad, Ad, Ad).
  62. DstAlpha = 7,
  63. //Blend factor is (1 - Ad, 1 - Ad, 1 - Ad, 1 - Ad).
  64. OneMinusDstAlpha = 8,
  65. //Blend factor is (f, f, f, 1); where f = min(As, 1 - Ad).
  66. SrcAlphaSaturate = 9,
  67. //Blend factor is (1 - As, 1 - As, 1 - As, 1 - As).
  68. OneMinusSrcAlpha = 10
  69. }
  70. public enum CullMode
  71. {
  72. CULL_NONE = 0,
  73. CULL_FRONT = 1,
  74. CULL_BACK = 2,
  75. }
  76. public enum DepthWrite
  77. {
  78. OFF = 0,
  79. ON = 1
  80. }
  81. public enum DepthTest
  82. {
  83. OFF = 0,
  84. Never = 1,
  85. LESS = 2,
  86. EQUAL = 3,
  87. LEQUAL = 4,
  88. GREATER = 5,
  89. NOTEQUAL = 6,
  90. GEQUAL = 7,
  91. ALWAYS = 8
  92. }
  93. public enum RenderQueue
  94. {
  95. //Opaque geometry uses this queue.
  96. Geometry = 2000,
  97. //Alpha tested geometry uses this queue.
  98. AlphaTest = 2450,
  99. //This render queue is rendered after Geometry and AlphaTest, in back-to-front order.
  100. Transparent = 3000,
  101. }
  102. public enum SmoothnessTextureChannelMode
  103. {
  104. Specular_Alpha = 0,
  105. Albedo_Alpha = 1
  106. }
  107. MaterialProperty diffuseTexture = null;
  108. MaterialProperty diffuseColor = null;
  109. MaterialProperty specularColor = null;
  110. MaterialProperty specularTexture = null;
  111. MaterialProperty smoothness = null;
  112. MaterialProperty smoothnessScale = null;
  113. MaterialProperty smoothnessTextureChannel = null;
  114. MaterialProperty normalTexture = null;
  115. MaterialProperty normalScale = null;
  116. MaterialProperty parallaxTexture = null;
  117. MaterialProperty parallaxScale = null;
  118. MaterialProperty occlusionTexture = null;
  119. MaterialProperty occlusionStrength = null;
  120. MaterialProperty reflection = null;
  121. MaterialProperty emission = null;
  122. MaterialProperty emissionTexture = null;
  123. MaterialProperty emissionColor = null;
  124. MaterialProperty cullMode = null;
  125. MaterialProperty renderMode = null;
  126. MaterialProperty alphaTest = null;
  127. MaterialProperty alphaCutoff = null;
  128. MaterialProperty alphaBlend = null;
  129. MaterialProperty srcBlendMode = null;
  130. MaterialProperty dstBlendMode = null;
  131. MaterialProperty depthWrite = null;
  132. MaterialProperty depthTest = null;
  133. MaterialEditor m_MaterialEditor;
  134. bool m_FirstTimeApply = true;
  135. public void FindProperties(MaterialProperty[] props)
  136. {
  137. diffuseTexture = FindProperty("_MainTex", props);
  138. diffuseColor = FindProperty("_Color", props);
  139. specularColor = FindProperty("_SpecColor", props);
  140. specularTexture = FindProperty("_SpecGlossMap", props);
  141. smoothness = FindProperty("_Glossiness", props);
  142. smoothnessScale = FindProperty("_GlossMapScale", props);
  143. smoothnessTextureChannel = FindProperty("_SmoothnessTextureChannel", props);
  144. occlusionTexture = FindProperty("_OcclusionMap", props);
  145. occlusionStrength = FindProperty("_OcclusionStrength", props);
  146. normalTexture = FindProperty("_BumpMap", props);
  147. normalScale = FindProperty("_BumpScale", props);
  148. parallaxTexture = FindProperty("_ParallaxMap", props);
  149. parallaxScale = FindProperty("_Parallax", props);
  150. reflection = FindProperty("_Reflection", props);
  151. emission = FindProperty("_EnableEmission", props);
  152. emissionTexture = FindProperty("_EmissionMap", props);
  153. emissionColor = FindProperty("_EmissionColor", props);
  154. renderMode = FindProperty("_Mode", props);
  155. cullMode = FindProperty("_Cull", props);
  156. alphaTest = FindProperty("_AlphaTest", props, false);
  157. alphaCutoff = FindProperty("_Cutoff", props, false);
  158. alphaBlend = FindProperty("_AlphaBlend", props, false);
  159. srcBlendMode = FindProperty("_SrcBlend", props);
  160. dstBlendMode = FindProperty("_DstBlend", props);
  161. depthWrite = FindProperty("_ZWrite", props);
  162. depthTest = FindProperty("_ZTest", props);
  163. }
  164. public override void OnGUI(MaterialEditor materialEditor, MaterialProperty[] props)
  165. {
  166. // render the default gui
  167. FindProperties(props);
  168. m_MaterialEditor = materialEditor;
  169. Material material = materialEditor.target as Material;
  170. if (m_FirstTimeApply)
  171. {
  172. onChangeRender(material, (RenderMode)material.GetFloat("_Mode"));
  173. m_FirstTimeApply = false;
  174. }
  175. ShaderPropertiesGUI(material);
  176. }
  177. public void ShaderPropertiesGUI(Material material)
  178. {
  179. // Use default labelWidth
  180. EditorGUIUtility.labelWidth = 0f;
  181. // Detect any changes to the material
  182. EditorGUI.BeginChangeCheck();
  183. {
  184. //renderMode
  185. GUILayout.BeginHorizontal();
  186. GUILayout.Label(Styles.renderModeText, GUILayout.Width(120));
  187. var mode = (RenderMode)renderMode.floatValue;
  188. mode = (RenderMode)EditorGUILayout.Popup((int)mode, Styles.renderModeNames);
  189. GUILayout.EndHorizontal();
  190. //Primary properties
  191. GUILayout.Label(Styles.PrimaryText, EditorStyles.boldLabel);
  192. //Diffuse
  193. m_MaterialEditor.TexturePropertySingleLine(Styles.albedoText, diffuseTexture, diffuseColor);
  194. //specular
  195. bool hasSpecularMap = false;
  196. hasSpecularMap = specularTexture.textureValue != null;
  197. m_MaterialEditor.TexturePropertySingleLine(Styles.specularText, specularTexture, hasSpecularMap ? null : specularColor);
  198. //smoothness
  199. //m_MaterialEditor.ShaderProperty(smoothness, Styles.smoothnessText, MaterialEditor.kMiniTextureFieldLabelIndentLevel);
  200. bool showSmoothnessScale = hasSpecularMap;
  201. int smoothnessChannel = (int)smoothnessTextureChannel.floatValue;
  202. if (smoothnessChannel == (int)SmoothnessTextureChannelMode.Albedo_Alpha)
  203. {
  204. showSmoothnessScale = true;
  205. }
  206. int indentation = 2; // align with labels of texture properties
  207. m_MaterialEditor.ShaderProperty(showSmoothnessScale ? smoothnessScale : smoothness, showSmoothnessScale ? Styles.smoothnessScaleText : Styles.smoothnessText, indentation);
  208. //smoothnessTextureChannel
  209. GUILayout.BeginHorizontal();
  210. GUILayout.Label("", GUILayout.Width(26));
  211. GUILayout.Label(Styles.smoothnessTextureChannelText, GUILayout.Width(120));
  212. var smoothMode = (SmoothnessTextureChannelMode)smoothnessTextureChannel.floatValue;
  213. smoothMode = (SmoothnessTextureChannelMode)EditorGUILayout.Popup((int)smoothMode, Styles.smoothnessTextureChannelModeNames);
  214. GUILayout.EndHorizontal();
  215. //mormal
  216. bool hasNormalTexture = false;
  217. hasNormalTexture = normalTexture.textureValue != null;
  218. m_MaterialEditor.TexturePropertySingleLine(Styles.normalMapText, normalTexture, hasNormalTexture ? normalScale : null);
  219. //parallax
  220. bool hasparallaxTexture = false;
  221. hasparallaxTexture = parallaxTexture.textureValue != null;
  222. m_MaterialEditor.TexturePropertySingleLine(Styles.parallaxText, parallaxTexture, hasparallaxTexture ? parallaxScale : null);
  223. //occlusion
  224. bool hasOcclusion = false;
  225. hasOcclusion = occlusionTexture.textureValue != null;
  226. m_MaterialEditor.TexturePropertySingleLine(Styles.occlusionText, occlusionTexture, hasOcclusion ? occlusionStrength : null);
  227. //reflection
  228. m_MaterialEditor.ShaderProperty(reflection, Styles.reflectionText);
  229. //emission
  230. m_MaterialEditor.ShaderProperty(emission, Styles.emissionText);
  231. if (emission.floatValue == 1)
  232. {
  233. m_MaterialEditor.TexturePropertySingleLine(Styles.emissionMapText, emissionTexture, emissionColor);
  234. }
  235. //scaleAndOffset
  236. m_MaterialEditor.TextureScaleOffsetProperty(diffuseTexture);
  237. GUILayout.Box("", GUILayout.Height(1), GUILayout.ExpandWidth(true));
  238. //Advanced properties
  239. GUILayout.Label(Styles.AdvancedText, EditorStyles.boldLabel);
  240. //alphaTest
  241. m_MaterialEditor.ShaderProperty(alphaTest, Styles.alphaTest);
  242. if (alphaTest.floatValue == 1)
  243. {
  244. m_MaterialEditor.ShaderProperty(alphaCutoff, Styles.alphaCutoffText, MaterialEditor.kMiniTextureFieldLabelIndentLevel + 1);
  245. }
  246. //alphaBlend
  247. m_MaterialEditor.ShaderProperty(alphaBlend, Styles.alphaBlendText);
  248. var dstMode = (DstBlendMode)dstBlendMode.floatValue;
  249. var srcMode = (SrcBlendMode)srcBlendMode.floatValue;
  250. if (alphaBlend.floatValue == 1)
  251. {
  252. GUILayout.BeginHorizontal();
  253. GUILayout.Label("", GUILayout.Width(20));
  254. srcMode = (SrcBlendMode)EditorGUILayout.Popup((int)srcMode, Styles.srcBlendNames);
  255. dstMode = (DstBlendMode)EditorGUILayout.Popup((int)dstMode, Styles.dstBlendNames);
  256. GUILayout.EndHorizontal();
  257. }
  258. //depthWrite
  259. GUILayout.BeginHorizontal();
  260. GUILayout.Label(Styles.depthWriteText, GUILayout.Width(120));
  261. var depthW = (DepthWrite)depthWrite.floatValue;
  262. depthW = (DepthWrite)EditorGUILayout.Popup((int)depthW, Styles.depthWriteNames);
  263. GUILayout.EndHorizontal();
  264. //depthTest
  265. GUILayout.BeginHorizontal();
  266. GUILayout.Label(Styles.depthTestText, GUILayout.Width(120));
  267. var depthT = (DepthTest)depthTest.floatValue;
  268. depthT = (DepthTest)EditorGUILayout.Popup((int)depthT, Styles.depthTestNames);
  269. GUILayout.EndHorizontal();
  270. //cullMode
  271. GUILayout.BeginHorizontal();
  272. GUILayout.Label(Styles.cullModeText, GUILayout.Width(120));
  273. var cull = (CullMode)cullMode.floatValue;
  274. cull = (CullMode)EditorGUILayout.Popup((int)cull, Styles.cullModeNames);
  275. GUILayout.EndHorizontal();
  276. if (EditorGUI.EndChangeCheck())
  277. {
  278. m_MaterialEditor.RegisterPropertyChangeUndo("Rendering Mode");
  279. //renderMode
  280. renderMode.floatValue = (float)mode;
  281. onChangeRender(material, (RenderMode)material.GetFloat("_Mode"));
  282. //smoothnessTextureChannel
  283. smoothnessTextureChannel.floatValue = (float)smoothMode;
  284. material.SetInt("_SmoothnessTextureChannel", (int)smoothMode);
  285. if (smoothnessTextureChannel.floatValue == 1)
  286. {
  287. material.EnableKeyword("Smoothness_DiffuseTexture_Alpha");
  288. }
  289. else
  290. {
  291. material.DisableKeyword("Smoothness_DiffuseTexture_Alpha");
  292. }
  293. //cullMode
  294. cullMode.floatValue = (float)cull;
  295. material.SetInt("_Cull", (int)cull);
  296. if ((RenderMode)material.GetFloat("_Mode") == RenderMode.Custom)
  297. {
  298. //alphaTest
  299. if (alphaTest.floatValue == 1)
  300. {
  301. material.EnableKeyword("EnableAlphaCutoff");
  302. material.EnableKeyword("_ALPHATEST_ON");
  303. }
  304. else
  305. {
  306. material.DisableKeyword("EnableAlphaCutoff");
  307. material.DisableKeyword("_ALPHATEST_ON");
  308. }
  309. //alphaBlend
  310. if (alphaBlend.floatValue == 1)
  311. {
  312. srcBlendMode.floatValue = (float)srcMode;
  313. dstBlendMode.floatValue = (float)dstMode;
  314. material.SetInt("_SrcBlend", (int)srcMode);
  315. material.SetInt("_DstBlend", (int)dstMode);
  316. material.EnableKeyword("_ALPHABLEND_ON");
  317. material.SetInt("_AlphaBlend", 1);
  318. }
  319. else
  320. {
  321. material.DisableKeyword("_ALPHABLEND_ON");
  322. material.SetInt("_AlphaBlend", 0);
  323. material.SetInt("_SrcBlend", (int)1);
  324. material.SetInt("_DstBlend", (int)0);
  325. }
  326. //depthWrite
  327. depthWrite.floatValue = (float)depthW;
  328. material.SetInt("_ZWrite", (int)depthW);
  329. //depthTest
  330. depthTest.floatValue = (float)depthT;
  331. material.SetInt("_ZTest", (int)depthT);
  332. }
  333. if (parallaxTexture.textureValue != null)
  334. {
  335. material.EnableKeyword("ParallaxTexture");
  336. }
  337. else
  338. {
  339. material.DisableKeyword("ParallaxTexture");
  340. }
  341. if (specularTexture.textureValue != null)
  342. {
  343. material.EnableKeyword("SpecularTexture");
  344. }
  345. else
  346. {
  347. material.DisableKeyword("SpecularTexture");
  348. }
  349. if (reflection.floatValue == 1)
  350. {
  351. material.EnableKeyword("EnableReflection");
  352. }
  353. else
  354. {
  355. material.DisableKeyword("EnableReflection");
  356. }
  357. if (emission.floatValue == 1)
  358. {
  359. material.EnableKeyword("EnableEmission");
  360. }
  361. else
  362. {
  363. material.DisableKeyword("EnableEmission");
  364. }
  365. }
  366. }
  367. m_MaterialEditor.RenderQueueField();
  368. }
  369. public void onChangeRender(Material material, RenderMode mode)
  370. {
  371. switch (mode)
  372. {
  373. case RenderMode.Opaque:
  374. material.SetInt("_Mode", 0);
  375. material.SetInt("_AlphaTest", 0);
  376. material.SetInt("_AlphaBlend", 0);
  377. material.SetInt("_SrcBlend", (int)UnityEngine.Rendering.BlendMode.One);
  378. material.SetInt("_DstBlend", (int)UnityEngine.Rendering.BlendMode.Zero);
  379. material.SetInt("_ZWrite", 1);
  380. material.SetInt("_ZTest", 4);
  381. material.DisableKeyword("_ALPHATEST_ON");
  382. material.DisableKeyword("_ALPHABLEND_ON");
  383. material.DisableKeyword("ALPHAPREMULTIPLY_ON");
  384. material.DisableKeyword("EnableAlphaCutoff");
  385. material.renderQueue = (int)UnityEngine.Rendering.RenderQueue.Geometry;
  386. break;
  387. case RenderMode.Cutout:
  388. material.SetInt("_Mode", 1);
  389. material.SetInt("_AlphaTest", 1);
  390. material.SetInt("_AlphaBlend", 0);
  391. material.SetInt("_SrcBlend", (int)UnityEngine.Rendering.BlendMode.One);
  392. material.SetInt("_DstBlend", (int)UnityEngine.Rendering.BlendMode.Zero);
  393. material.SetInt("_ZWrite", 1);
  394. material.SetInt("_ZTest", 4);
  395. material.EnableKeyword("_ALPHATEST_ON");
  396. material.DisableKeyword("_ALPHABLEND_ON");
  397. material.DisableKeyword("ALPHAPREMULTIPLY_ON");
  398. material.EnableKeyword("EnableAlphaCutoff");
  399. material.renderQueue = (int)UnityEngine.Rendering.RenderQueue.AlphaTest;
  400. break;
  401. case RenderMode.Fade:
  402. material.SetInt("_Mode", 2);
  403. material.SetInt("_AlphaTest", 0);
  404. material.SetInt("_AlphaBlend", 1);
  405. material.SetInt("_SrcBlend", (int)UnityEngine.Rendering.BlendMode.SrcAlpha);
  406. material.SetInt("_DstBlend", (int)UnityEngine.Rendering.BlendMode.OneMinusSrcAlpha);
  407. material.SetInt("_ZWrite", 0);
  408. material.SetInt("_ZTest", 4);
  409. material.DisableKeyword("_ALPHATEST_ON");
  410. material.EnableKeyword("_ALPHABLEND_ON");
  411. material.DisableKeyword("ALPHAPREMULTIPLY_ON");
  412. material.DisableKeyword("EnableAlphaCutoff");
  413. material.renderQueue = (int)UnityEngine.Rendering.RenderQueue.Transparent;
  414. break;
  415. case RenderMode.Transparent:
  416. material.SetInt("_Mode", 3);
  417. material.SetInt("_AlphaTest", 0);
  418. material.SetInt("_AlphaBlend", 1);
  419. material.SetInt("_SrcBlend", (int)UnityEngine.Rendering.BlendMode.One);
  420. material.SetInt("_DstBlend", (int)UnityEngine.Rendering.BlendMode.OneMinusSrcAlpha);
  421. material.SetInt("_ZWrite", 0);
  422. material.SetInt("_ZTest", 4);
  423. material.DisableKeyword("_ALPHATEST_ON");
  424. material.EnableKeyword("_ALPHABLEND_ON");
  425. material.EnableKeyword("ALPHAPREMULTIPLY_ON");
  426. material.DisableKeyword("EnableAlphaCutoff");
  427. material.renderQueue = (int)UnityEngine.Rendering.RenderQueue.Transparent;
  428. break;
  429. case RenderMode.Custom:
  430. material.SetInt("_Mode", 4);
  431. material.renderQueue = material.GetInt("_RenderQueue");
  432. break;
  433. default:
  434. material.SetInt("_Mode", 0);
  435. material.SetInt("_AlphaTest", 0);
  436. material.SetInt("_AlphaBlend", 0);
  437. material.SetInt("_SrcBlend", (int)UnityEngine.Rendering.BlendMode.One);
  438. material.SetInt("_DstBlend", (int)UnityEngine.Rendering.BlendMode.Zero);
  439. material.SetInt("_ZWrite", 1);
  440. material.SetInt("_ZTest", 4);
  441. material.DisableKeyword("_ALPHATEST_ON");
  442. material.DisableKeyword("_ALPHABLEND_ON");
  443. material.DisableKeyword("ALPHAPREMULTIPLY_ON");
  444. material.DisableKeyword("EnableAlphaCutoff");
  445. material.renderQueue = (int)UnityEngine.Rendering.RenderQueue.Geometry;
  446. break;
  447. }
  448. }
  449. public static class Styles
  450. {
  451. public static GUIStyle optionsButton = "PaneOptions";
  452. public static GUIContent uvSetLabel = new GUIContent("UV Set");
  453. public static GUIContent[] uvSetOptions = new GUIContent[] { new GUIContent("UV channel 0"), new GUIContent("UV channel 1") };
  454. public static string emptyTootip = "";
  455. public static GUIContent albedoText = new GUIContent("Albedo", "Albedo (RGB) and Transparency (A)");
  456. public static GUIContent specularText = new GUIContent("Specular", "Specular (RGB) and Transparency (A)");
  457. public static GUIContent specularShininessText = new GUIContent("Shininess", "Specular Range");
  458. public static GUIContent smoothnessText = new GUIContent("Smoothness", "Smoothness");
  459. public static GUIContent smoothnessScaleText = new GUIContent("Smoothness Scale", "Smoothness scale factor");
  460. public static GUIContent smoothnessTextureChannelText = new GUIContent("Source", "Smoothness texture and channel");
  461. public static GUIContent normalMapText = new GUIContent("Normal Map", "Normal Map");
  462. public static GUIContent parallaxText = new GUIContent("Parallax Map", "Parallax Map");
  463. public static GUIContent occlusionText = new GUIContent("Occlusion Map", "Occlusion");
  464. public static GUIContent reflectionText = new GUIContent("Enable Reflection", "Enable Reflection");
  465. public static GUIContent emissionText = new GUIContent("Enable Emission", "Enable Emission");
  466. public static GUIContent emissionMapText = new GUIContent("Emission", "Emission");
  467. public static GUIContent cullModeText = new GUIContent("Cull", "CullMode");
  468. public static GUIContent renderModeText = new GUIContent("RenderMode", "RenderMode");
  469. public static GUIContent alphaTest = new GUIContent("AlphaTest", "AlphaTest");
  470. public static GUIContent alphaCutoffText = new GUIContent("Alpha Cutoff", "Threshold for alpha cutoff");
  471. public static GUIContent alphaBlendText = new GUIContent("AlphaBlend", "AlphaBlend");
  472. public static GUIContent depthWriteText = new GUIContent("DepthWrite", "DepthWrite");
  473. public static GUIContent depthTestText = new GUIContent("DepthTest", "DepthTest");
  474. public static string whiteSpaceString = " ";
  475. public static string PrimaryText = "Primary Properties";
  476. public static string AdvancedText = "Advanced Properties";
  477. public static readonly string[] srcBlendNames = Enum.GetNames(typeof(SrcBlendMode));
  478. public static readonly string[] dstBlendNames = Enum.GetNames(typeof(DstBlendMode));
  479. public static readonly string[] renderModeNames = Enum.GetNames(typeof(RenderMode));
  480. public static readonly string[] cullModeNames = Enum.GetNames(typeof(CullMode));
  481. public static readonly string[] depthWriteNames = Enum.GetNames(typeof(DepthWrite));
  482. public static readonly string[] depthTestNames = Enum.GetNames(typeof(DepthTest));
  483. public static readonly string[] smoothnessTextureChannelModeNames = Enum.GetNames(typeof(SmoothnessTextureChannelMode));
  484. }
  485. }
  486. //#endif