CalmWaterInspector.cs 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611
  1. using System;
  2. //using System.Reflection;
  3. using UnityEngine;
  4. namespace UnityEditor
  5. {
  6. public class CalmWaterInspector: ShaderGUI
  7. {
  8. //Color
  9. MaterialProperty shallowColor = null;
  10. MaterialProperty depthColor = null;
  11. MaterialProperty depthStart = null;
  12. MaterialProperty depthEnd = null;
  13. MaterialProperty enableDepthFog = null;
  14. //Scatter
  15. MaterialProperty enableScatter = null;
  16. MaterialProperty scatterColor = null;
  17. MaterialProperty scatterParams = null;
  18. MaterialProperty edgeFade = null;
  19. //Spec
  20. MaterialProperty specColor = null;
  21. MaterialProperty smoothness = null;
  22. MaterialProperty specFresnel = null;
  23. MaterialProperty specIntensity = null;
  24. //NormalMap
  25. MaterialProperty bumpMode = null;
  26. MaterialProperty bumpMap = null;
  27. MaterialProperty largeBump = null;
  28. MaterialProperty bumpStrength = null;
  29. MaterialProperty bumpLargeStrength = null;
  30. MaterialProperty worldSpace = null;
  31. //FlowMap
  32. MaterialProperty flowMap = null;
  33. MaterialProperty flowSpeed = null;
  34. MaterialProperty flowIntensity = null;
  35. //Animation
  36. MaterialProperty speeds = null;
  37. MaterialProperty speedsLarge = null;
  38. //Distortion
  39. MaterialProperty distortion = null;
  40. MaterialProperty distortionQuality = null;
  41. //Reflection
  42. MaterialProperty reflectionType = null;
  43. MaterialProperty cubeColor = null;
  44. MaterialProperty cubeMap = null;
  45. //MaterialProperty reflectionTex = null;
  46. MaterialProperty cubeDist = null;
  47. MaterialProperty reflection = null;
  48. MaterialProperty fresnel = null;
  49. MaterialProperty reflectionNormals = null;
  50. //Foam
  51. MaterialProperty foamToggle = null;
  52. MaterialProperty foamColor = null;
  53. MaterialProperty foamTex = null;
  54. MaterialProperty foamSize = null;
  55. MaterialProperty whiteCaps = null;
  56. MaterialProperty capsIntensity = null;
  57. MaterialProperty capsMask = null;
  58. MaterialProperty capsSpeed = null;
  59. MaterialProperty capsSize = null;
  60. // Caustics
  61. MaterialProperty caustics = null;
  62. MaterialProperty causticsTex = null;
  63. MaterialProperty causticsIntensity = null;
  64. MaterialProperty causticsStart = null;
  65. MaterialProperty causticsEnd = null;
  66. MaterialProperty causticsSpeed = null;
  67. //Displacement
  68. MaterialProperty displacementMode = null;
  69. MaterialProperty amplitude = null;
  70. MaterialProperty frequency = null;
  71. MaterialProperty speed = null;
  72. MaterialProperty steepness = null;
  73. MaterialProperty waveSpeed = null;
  74. MaterialProperty waveDirectionXY = null;
  75. MaterialProperty waveDirectionZW = null;
  76. MaterialProperty displacementTexture = null;
  77. MaterialProperty displacementSpeed = null;
  78. MaterialProperty smoothing = null;
  79. MaterialProperty tess = null;
  80. private bool _hasTess = false;
  81. MaterialEditor m_MaterialEditor;
  82. private bool _ShowColor = true;
  83. private bool _ShowScatter = true;
  84. private bool _ShowSpecular = true;
  85. private bool _ShowBump = true;
  86. private bool _ShowReflection = true;
  87. private bool _ShowFoam = true;
  88. private bool _ShowCaustics = true;
  89. private bool _ShowDisplacement = true;
  90. private bool _ShowTessellation = true;
  91. private bool _ShowOptions = true;
  92. GUIStyle _FoldoutStyle;
  93. private const string _cVersion = "1.10.0";
  94. public void FindProperties(MaterialProperty[] props)
  95. {
  96. //Color
  97. shallowColor = FindProperty ("_Color", props);
  98. depthColor = FindProperty ("_DepthColor", props);
  99. depthStart = FindProperty ("_DepthStart", props);
  100. depthEnd = FindProperty ("_DepthEnd", props);
  101. enableDepthFog = FindProperty ("_EnableFog",props);
  102. edgeFade = FindProperty ("_EdgeFade",props);
  103. //Scatter
  104. enableScatter = FindProperty("_Scatter", props);
  105. scatterColor = FindProperty("_ScatterColor", props);
  106. scatterParams = FindProperty("_ScatterParams", props);
  107. //Spec
  108. specColor = FindProperty ("_SpecColor", props);
  109. smoothness = FindProperty ("_Smoothness", props);
  110. specFresnel = FindProperty("_specFresnel", props);
  111. specIntensity = FindProperty("_specIntensity", props);
  112. //NormalMap
  113. bumpMode = FindProperty("_BumpMode", props);
  114. bumpMap = FindProperty ("_BumpMap", props);
  115. largeBump = FindProperty ("_BumpMapLarge", props);
  116. bumpStrength = FindProperty ("_BumpStrength", props);
  117. bumpLargeStrength = FindProperty ("_BumpLargeStrength", props);
  118. //FlowMap
  119. flowMap = FindProperty("_FlowMap", props);
  120. flowSpeed = FindProperty("_FlowSpeed", props);
  121. flowIntensity = FindProperty("_FlowIntensity", props);
  122. //Animation
  123. worldSpace = FindProperty ("_WorldSpace",props);
  124. speeds = FindProperty ("_Speeds", props);
  125. speedsLarge = FindProperty ("_SpeedsLarge", props);
  126. //Distortion
  127. distortion = FindProperty ("_Distortion", props);
  128. distortionQuality = FindProperty ("_DistortionQuality", props);
  129. //Reflection
  130. reflectionType = FindProperty ("_ReflectionType", props);
  131. cubeColor = FindProperty ("_CubeColor", props);
  132. cubeMap = FindProperty ("_Cube", props);
  133. cubeDist = FindProperty ("_CubeDist", props);
  134. reflection = FindProperty ("_Reflection", props);
  135. fresnel = FindProperty ("_RimPower", props);
  136. reflectionNormals = FindProperty("_ReflectionNormals", props);
  137. //Foam
  138. foamToggle = FindProperty ("_FOAM", props);
  139. foamColor = FindProperty ("_FoamColor", props);
  140. foamTex = FindProperty ("_FoamTex", props);
  141. foamSize = FindProperty ("_FoamSize", props);
  142. whiteCaps = FindProperty ("_WhiteCaps", props);
  143. capsIntensity = FindProperty ("_CapsIntensity", props);
  144. capsMask = FindProperty ("_CapsMask", props);
  145. capsSpeed = FindProperty ("_CapsSpeed", props);
  146. capsSize = FindProperty ("_CapsSize", props);
  147. // Caustics
  148. caustics = FindProperty("_Caustics", props);
  149. causticsTex = FindProperty("_CausticsTex", props);
  150. causticsIntensity = FindProperty("_CausticsIntensity", props);
  151. causticsStart = FindProperty("_CausticsStart", props);
  152. causticsEnd = FindProperty("_CausticsEnd", props);
  153. causticsSpeed = FindProperty("_CausticsSpeed", props);
  154. //Displacement
  155. displacementMode = FindProperty ("_DisplacementMode", props);
  156. amplitude = FindProperty ("_Amplitude", props);
  157. frequency = FindProperty ("_Frequency", props);
  158. speed = FindProperty ("_Speed",props);
  159. waveSpeed = FindProperty ("_WSpeed", props);
  160. steepness = FindProperty ("_Steepness", props);
  161. waveDirectionXY = FindProperty ("_WDirectionAB", props);
  162. waveDirectionZW = FindProperty ("_WDirectionCD", props);
  163. displacementTexture = FindProperty("_DisplacementTex", props);
  164. displacementSpeed = FindProperty("_DisplacementSpeed", props);
  165. smoothing = FindProperty ("_Smoothing", props);
  166. if(_hasTess){
  167. tess = FindProperty ("_Tess", props);
  168. }
  169. }
  170. public override void OnGUI(MaterialEditor materialEditor, MaterialProperty[] props)
  171. {
  172. _FoldoutStyle = new GUIStyle(EditorStyles.foldout);
  173. _FoldoutStyle.fontStyle = FontStyle.Bold;
  174. m_MaterialEditor = materialEditor;
  175. Material material = materialEditor.target as Material;
  176. if(material.HasProperty("_Tess")){
  177. _hasTess = true;
  178. }else{
  179. _hasTess = false;
  180. }
  181. Header();
  182. FindProperties(props); // MaterialProperties can be animated so we do not cache them but fetch them every event to ensure animated values are updated correctly
  183. ShaderPropertiesGUI(material);
  184. }
  185. public void Header()
  186. {
  187. // Use default labelWidth
  188. EditorGUIUtility.labelWidth = 0f;
  189. EditorGUIUtility.fieldWidth = 64f;
  190. Texture2D tex = Resources.Load("CalmWaterLogo") as Texture2D;
  191. GUILayout.BeginHorizontal();
  192. GUILayout.FlexibleSpace();
  193. GUILayout.Label(tex);
  194. GUILayout.FlexibleSpace();
  195. GUILayout.EndHorizontal();
  196. }
  197. public void ShaderPropertiesGUI(Material material)
  198. {
  199. // Detect any changes to the material
  200. EditorGUI.BeginChangeCheck();
  201. {
  202. DrawColor();
  203. DrawScatter();
  204. DrawSpecular();
  205. DrawBump();
  206. DrawReflection();
  207. DrawFoam();
  208. DrawCaustics();
  209. DrawDisplacement();
  210. DrawTessellation();
  211. DrawOptions();
  212. // Queue
  213. material.renderQueue = EditorGUILayout.IntField("Render Queue", material.renderQueue);
  214. // Version
  215. GUIStyle boldRight = new GUIStyle ();
  216. boldRight.alignment = TextAnchor.MiddleRight;
  217. boldRight.fontStyle = FontStyle.Bold;
  218. GUILayout.Label ("Version " + _cVersion,boldRight);
  219. GUILayout.Space (3f);
  220. }
  221. }
  222. void DrawColor()
  223. {
  224. GUILayout.BeginVertical("GroupBox");
  225. EditorGUI.indentLevel = 1;
  226. _ShowColor = EditorGUILayout.Foldout(_ShowColor, "Color", _FoldoutStyle);
  227. if (_ShowColor)
  228. {
  229. m_MaterialEditor.ShaderProperty(shallowColor, "Shallow Color");
  230. m_MaterialEditor.ShaderProperty(depthColor, "Depth Color");
  231. m_MaterialEditor.ShaderProperty(depthStart, "Depth Start");
  232. m_MaterialEditor.ShaderProperty(depthEnd, "Depth End");
  233. m_MaterialEditor.ShaderProperty(enableDepthFog, "Enable Depth Fog");
  234. m_MaterialEditor.ShaderProperty(edgeFade, "Edge Fade");
  235. }
  236. EditorGUI.indentLevel = 0;
  237. GUILayout.EndVertical();
  238. }
  239. void DrawScatter()
  240. {
  241. GUILayout.BeginVertical("GroupBox");
  242. EditorGUI.indentLevel = 1;
  243. _ShowScatter = EditorGUILayout.Foldout(_ShowScatter, "Scattering", _FoldoutStyle);
  244. if (_ShowScatter)
  245. {
  246. m_MaterialEditor.ShaderProperty(enableScatter, "Enable");
  247. }
  248. if (enableScatter.floatValue == 1f && _ShowScatter)
  249. {
  250. m_MaterialEditor.ShaderProperty(scatterColor, "Color");
  251. Vector4 scatterValues = scatterParams.vectorValue;
  252. float scatterIntensity = EditorGUILayout.FloatField("Intensity", scatterValues.x);
  253. float scatterHeight = 0f;
  254. if (displacementMode.floatValue != 0f)
  255. {
  256. scatterHeight = EditorGUILayout.FloatField("Height", scatterValues.y);
  257. }
  258. float scatterRange = EditorGUILayout.FloatField("Range", scatterValues.z);
  259. scatterParams.vectorValue = new Vector4(scatterIntensity, scatterHeight, scatterRange, 1f);
  260. }
  261. EditorGUI.indentLevel = 0;
  262. GUILayout.EndVertical();
  263. }
  264. void DrawSpecular()
  265. {
  266. GUILayout.BeginVertical("GroupBox");
  267. EditorGUI.indentLevel = 1;
  268. _ShowSpecular = EditorGUILayout.Foldout(_ShowSpecular, "Specular", _FoldoutStyle);
  269. if (_ShowSpecular)
  270. {
  271. m_MaterialEditor.ShaderProperty(specColor, "Specular Color");
  272. m_MaterialEditor.ShaderProperty(smoothness, "Smoothness");
  273. GUILayout.Label("Fresnel Specular", EditorStyles.boldLabel);
  274. m_MaterialEditor.ShaderProperty(specIntensity, "Intensity");
  275. m_MaterialEditor.ShaderProperty(specFresnel, "Fresnel");
  276. }
  277. EditorGUI.indentLevel = 0;
  278. GUILayout.EndVertical();
  279. }
  280. void DrawBump()
  281. {
  282. GUILayout.BeginVertical("GroupBox");
  283. EditorGUI.indentLevel = 1;
  284. _ShowBump = EditorGUILayout.Foldout(_ShowBump, "Normal Maps", _FoldoutStyle);
  285. if (_ShowBump)
  286. {
  287. m_MaterialEditor.ShaderProperty(bumpMode, "NormalMap Mode");
  288. if (bumpMode.floatValue == 0 || bumpMode.floatValue == 1)
  289. {
  290. m_MaterialEditor.ShaderProperty(bumpMap, "Micro Bump");
  291. m_MaterialEditor.ShaderProperty(bumpStrength, "Bump Strength");
  292. if (bumpMode.floatValue == 1)
  293. {
  294. m_MaterialEditor.ShaderProperty(largeBump, "Large Bump");
  295. m_MaterialEditor.ShaderProperty(bumpLargeStrength, "Bump Strength");
  296. }
  297. GUILayout.Label("Scroll Animation", EditorStyles.boldLabel);
  298. // Animation speeds
  299. Vector2 speeds1 = EditorGUILayout.Vector2Field("Micro Speed 1", new Vector2(speeds.vectorValue.x, speeds.vectorValue.y));
  300. Vector2 speeds2 = EditorGUILayout.Vector2Field("Micro Speed 2", new Vector2(speeds.vectorValue.z, speeds.vectorValue.w));
  301. speeds.vectorValue = new Vector4(speeds1.x, speeds1.y, speeds2.x, speeds2.y);
  302. if (bumpMode.floatValue == 1)
  303. {
  304. GUILayout.BeginHorizontal();
  305. Vector4 LargeSpeed = speedsLarge.vectorValue;
  306. Vector2 GUILargeSpeed = EditorGUILayout.Vector2Field("Large Speed", new Vector2(LargeSpeed.x, LargeSpeed.y));
  307. speedsLarge.vectorValue = new Vector4(GUILargeSpeed.x, GUILargeSpeed.y, LargeSpeed.z, LargeSpeed.w);
  308. GUILayout.EndHorizontal();
  309. }
  310. }
  311. //FlowMaps
  312. if (bumpMode.floatValue == 2)
  313. {
  314. m_MaterialEditor.ShaderProperty(bumpMap, "Normal Map");
  315. m_MaterialEditor.ShaderProperty(bumpStrength, "Normal Strength");
  316. m_MaterialEditor.ShaderProperty(flowMap, "FlowMap");
  317. m_MaterialEditor.ShaderProperty(flowSpeed, "Flow Speed");
  318. m_MaterialEditor.ShaderProperty(flowIntensity, "Flow Intensity");
  319. }
  320. //Distortion
  321. GUILayout.Label("Distortion", EditorStyles.boldLabel);
  322. m_MaterialEditor.ShaderProperty(distortion, "Distortion");
  323. m_MaterialEditor.ShaderProperty(distortionQuality, "Distortion Quality");
  324. }
  325. EditorGUI.indentLevel = 1;
  326. GUILayout.EndVertical();
  327. }
  328. void DrawReflection()
  329. {
  330. GUILayout.BeginVertical("GroupBox");
  331. EditorGUI.indentLevel = 1;
  332. _ShowReflection = EditorGUILayout.Foldout(_ShowReflection, "Reflections", _FoldoutStyle);
  333. if (_ShowReflection)
  334. {
  335. m_MaterialEditor.ShaderProperty(reflectionType, "Reflection Type");
  336. switch ((int)reflectionType.floatValue)
  337. {
  338. // Mixed Mode Reflections
  339. case 1:
  340. EditorGUILayout.HelpBox("You need to add MirrorReflection script to your object.", MessageType.Info);
  341. m_MaterialEditor.ShaderProperty(cubeColor, "Cube Color");
  342. m_MaterialEditor.ShaderProperty(cubeMap, "Cube Map");
  343. m_MaterialEditor.ShaderProperty(cubeDist, "Cube Map Distortion");
  344. m_MaterialEditor.ShaderProperty(reflection, "Reflection");
  345. m_MaterialEditor.ShaderProperty(fresnel, "Fresnel");
  346. m_MaterialEditor.ShaderProperty(reflectionNormals, "Normals");
  347. break;
  348. // RealTime Mode Reflections
  349. case 2:
  350. EditorGUILayout.HelpBox("You need to add MirrorReflection script to your object.", MessageType.Info);
  351. m_MaterialEditor.ShaderProperty(reflection, "Reflection");
  352. m_MaterialEditor.ShaderProperty(fresnel, "Fresnel");
  353. m_MaterialEditor.ShaderProperty(reflectionNormals, "Normals");
  354. break;
  355. // CubeMap Reflections
  356. case 3:
  357. m_MaterialEditor.ShaderProperty(cubeColor, "Cube Color");
  358. m_MaterialEditor.ShaderProperty(cubeMap, "Cube Map");
  359. m_MaterialEditor.ShaderProperty(cubeDist, "Cube Map Distortion");
  360. m_MaterialEditor.ShaderProperty(reflection, "Reflection");
  361. m_MaterialEditor.ShaderProperty(fresnel, "Fresnel");
  362. m_MaterialEditor.ShaderProperty(reflectionNormals, "Normals");
  363. break;
  364. case 4:
  365. break;
  366. }
  367. }
  368. EditorGUI.indentLevel = 0;
  369. GUILayout.EndVertical();
  370. }
  371. void DrawFoam()
  372. {
  373. GUILayout.BeginVertical("GroupBox");
  374. EditorGUI.indentLevel = 1;
  375. _ShowFoam = EditorGUILayout.Foldout(_ShowFoam, "Foam", _FoldoutStyle);
  376. if (_ShowFoam)
  377. {
  378. m_MaterialEditor.ShaderProperty(foamToggle, "Enable Foam");
  379. if (foamToggle.floatValue == 1)
  380. {
  381. m_MaterialEditor.ShaderProperty(foamColor, "Foam Color");
  382. m_MaterialEditor.ShaderProperty(foamTex, "Foam Texture");
  383. m_MaterialEditor.ShaderProperty(foamSize, "Foam Size");
  384. }
  385. // White Caps
  386. m_MaterialEditor.ShaderProperty(whiteCaps, "Enable White Caps");
  387. if (whiteCaps.floatValue == 1)
  388. {
  389. m_MaterialEditor.ShaderProperty(capsIntensity, "Caps Intensity");
  390. m_MaterialEditor.ShaderProperty(capsMask, "Caps Mask");
  391. m_MaterialEditor.ShaderProperty(capsSpeed, "Caps Speed");
  392. m_MaterialEditor.ShaderProperty(capsSize, "Caps Smooth");
  393. }
  394. }
  395. EditorGUI.indentLevel = 0;
  396. GUILayout.EndVertical();
  397. }
  398. void DrawCaustics()
  399. {
  400. GUILayout.BeginVertical("GroupBox");
  401. EditorGUI.indentLevel = 1;
  402. _ShowCaustics = EditorGUILayout.Foldout(_ShowCaustics, "Caustics", _FoldoutStyle);
  403. if (_ShowCaustics)
  404. {
  405. m_MaterialEditor.ShaderProperty(caustics, "Enable Caustics");
  406. if (caustics.floatValue == 1)
  407. {
  408. m_MaterialEditor.ShaderProperty(causticsTex, "Texture");
  409. m_MaterialEditor.ShaderProperty(causticsIntensity, "Intensity");
  410. m_MaterialEditor.ShaderProperty(causticsStart, "Depth Start");
  411. m_MaterialEditor.ShaderProperty(causticsEnd, "Depth End");
  412. m_MaterialEditor.ShaderProperty(causticsSpeed, "Speed");
  413. }
  414. }
  415. EditorGUI.indentLevel = 0;
  416. GUILayout.EndVertical();
  417. }
  418. void DrawDisplacement()
  419. {
  420. GUILayout.BeginVertical("GroupBox");
  421. EditorGUI.indentLevel = 1;
  422. _ShowDisplacement = EditorGUILayout.Foldout(_ShowDisplacement, "Displacement", _FoldoutStyle);
  423. if (_ShowDisplacement)
  424. {
  425. m_MaterialEditor.ShaderProperty(displacementMode, "Mode");
  426. if (displacementMode.floatValue != 0f)
  427. {
  428. EditorGUILayout.HelpBox("You need enough subdivisions in your Geometry.", MessageType.Info);
  429. EditorGUILayout.HelpBox("To get correct displaced normals, your model needs to be scaled [1,1,1].", MessageType.Info);
  430. }
  431. if (displacementMode.floatValue == 1f)
  432. {
  433. m_MaterialEditor.ShaderProperty(amplitude, "Amplitude");
  434. m_MaterialEditor.ShaderProperty(frequency, "Frequency");
  435. m_MaterialEditor.ShaderProperty(speed, "Waves Speed");
  436. m_MaterialEditor.ShaderProperty(smoothing, "Smoothing");
  437. }
  438. if (displacementMode.floatValue == 2f)
  439. {
  440. m_MaterialEditor.ShaderProperty(amplitude, "Amplitude");
  441. m_MaterialEditor.ShaderProperty(frequency, "Frequency");
  442. m_MaterialEditor.ShaderProperty(steepness, "Steepness");
  443. m_MaterialEditor.ShaderProperty(waveSpeed, "Waves Speed");
  444. m_MaterialEditor.ShaderProperty(waveDirectionXY, "Waves Directions 1");
  445. m_MaterialEditor.ShaderProperty(waveDirectionZW, "Waves Directions 2");
  446. m_MaterialEditor.ShaderProperty(smoothing, "Smoothing");
  447. }
  448. if (displacementMode.floatValue == 3f)
  449. {
  450. m_MaterialEditor.ShaderProperty(displacementTexture, "Displacement Texture");
  451. m_MaterialEditor.ShaderProperty(amplitude, "Amplitude");
  452. GUILayout.Label("Wave Speeds", EditorStyles.boldLabel);
  453. // Animation speeds
  454. Vector2 waveSpeeds1 = EditorGUILayout.Vector2Field("Speed 1", new Vector2(displacementSpeed.vectorValue.x, displacementSpeed.vectorValue.y));
  455. Vector2 waveSpeeds2 = EditorGUILayout.Vector2Field("Speed 2", new Vector2(displacementSpeed.vectorValue.z, displacementSpeed.vectorValue.w));
  456. displacementSpeed.vectorValue = new Vector4(waveSpeeds1.x, waveSpeeds1.y, waveSpeeds2.x, waveSpeeds2.y);
  457. m_MaterialEditor.ShaderProperty(smoothing, "Smoothing");
  458. }
  459. }
  460. EditorGUI.indentLevel = 0;
  461. GUILayout.EndVertical();
  462. }
  463. void DrawTessellation()
  464. {
  465. if (_hasTess)
  466. {
  467. GUILayout.BeginVertical("GroupBox");
  468. EditorGUI.indentLevel = 1;
  469. _ShowTessellation = EditorGUILayout.Foldout(_ShowTessellation, "Tessellation", _FoldoutStyle);
  470. if (_ShowTessellation)
  471. {
  472. m_MaterialEditor.ShaderProperty(tess, "Tessellation Level");
  473. }
  474. EditorGUI.indentLevel = 0;
  475. GUILayout.EndVertical();
  476. }
  477. }
  478. void DrawOptions()
  479. {
  480. GUILayout.BeginVertical("GroupBox");
  481. EditorGUI.indentLevel = 1;
  482. _ShowOptions = EditorGUILayout.Foldout(_ShowOptions, "Options", _FoldoutStyle);
  483. if (_ShowOptions)
  484. {
  485. m_MaterialEditor.ShaderProperty(worldSpace, "WorldSpace UV");
  486. }
  487. EditorGUI.indentLevel = 0;
  488. GUILayout.EndVertical();
  489. }
  490. }
  491. }