LayaPBRStandardGUI.cs 23 KB

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