yum-archive/Tooner

A toon shader for Unity's BIRP.

git clone https://git.yummers.dev/yum-archive/Tooner

yumAdd two rim lighting slots2814e9b

v0.0.0
21.3 KiB782 linesraw
1using System;
2using UnityEngine;
3using UnityEngine.Rendering;
4using UnityEditor;
5
6public class ToonerGUI : ShaderGUI {
7  Material target;
8  MaterialEditor editor;
9  MaterialProperty[] properties;
10
11  public override void OnGUI(
12      MaterialEditor editor,
13      MaterialProperty[] properties) {
14    this.target = editor.target as Material;
15    this.editor = editor;
16    this.properties = properties;
17    DoMain();
18  }
19
20  static GUIContent staticLabel = new GUIContent();
21
22  static GUIContent MakeLabel(string prop, string tooltip = null) {
23    staticLabel.text = prop;
24    staticLabel.tooltip = tooltip;
25    return staticLabel;
26  }
27
28  static GUIContent MakeLabel(MaterialProperty prop, string tooltip = null) {
29    staticLabel.text = prop.displayName;
30    staticLabel.tooltip = tooltip;
31    return staticLabel;
32  }
33
34  void RecordAction (string label) {
35    editor.RegisterPropertyChangeUndo(label);
36  }
37
38  MaterialProperty FindProperty(string label) {
39    return FindProperty(label, properties);
40  }
41
42  void SetKeyword(string keyword, bool state) {
43    if (state) {
44      target.EnableKeyword(keyword);
45    } else {
46      target.DisableKeyword(keyword);
47    }
48  }
49
50  void DoBaseColor() {
51      MaterialProperty bc = FindProperty("_BaseColor");
52      MaterialProperty bct = FindProperty("_BaseColorTex");
53      editor.TexturePropertySingleLine(
54          MakeLabel(bct, "Base color (RGBA)"),
55          bct,
56          bc);
57      SetKeyword("_BASECOLOR_MAP", bct.textureValue);
58  }
59
60  void DoNormal() {
61      MaterialProperty bct = FindProperty("_NormalTex");
62      editor.TexturePropertySingleLine(
63          MakeLabel(bct, "Normal"),
64          bct,
65          FindProperty("_Tex_NormalStr"));
66      SetKeyword("_NORMAL_MAP", bct.textureValue);
67  }
68
69  void DoMetallic() {
70      MaterialProperty bc = FindProperty("_Metallic");
71      MaterialProperty bct = FindProperty("_MetallicTex");
72      editor.TexturePropertySingleLine(
73          MakeLabel(bct, "Metallic (RGBA)"),
74          bct,
75          bc);
76      SetKeyword("_METALLIC_MAP", bct.textureValue);
77  }
78
79  void DoRoughness() {
80      MaterialProperty bc = FindProperty("_Roughness");
81      MaterialProperty bct = FindProperty("_RoughnessTex");
82      editor.TexturePropertySingleLine(
83          MakeLabel(bct, "Roughness (RGBA)"),
84          bct,
85          bc);
86      SetKeyword("_ROUGHNESS_MAP", bct.textureValue);
87  }
88
89  void DoPBROverlay() {
90    MaterialProperty bc = FindProperty("_PBR_Overlay_Enable");
91    bool enabled = bc.floatValue > 1E-6;
92    EditorGUI.BeginChangeCheck();
93    enabled = EditorGUILayout.Toggle("Enable", enabled);
94    EditorGUI.EndChangeCheck();
95    bc.floatValue = enabled ? 1.0f : 0.0f;
96    SetKeyword("_PBR_OVERLAY", enabled);
97
98    if (enabled) {
99      bc = FindProperty("_PBR_Overlay_BaseColor");
100      MaterialProperty bct = FindProperty("_PBR_Overlay_BaseColorTex");
101      editor.TexturePropertySingleLine(
102          MakeLabel(bct, "Base color (RGBA)"),
103          bct,
104          bc);
105      SetKeyword("_PBR_OVERLAY_BASECOLOR_MAP", bct.textureValue);
106
107      bct = FindProperty("_PBR_Overlay_NormalTex");
108      editor.TexturePropertySingleLine(
109          MakeLabel(bct, "Normal"),
110          bct,
111          FindProperty("_PBR_Overlay_Tex_NormalStr"));
112      SetKeyword("_PBR_OVERLAY_NORMAL_MAP", bct.textureValue);
113
114      bc = FindProperty("_PBR_Overlay_Metallic");
115      bct = FindProperty("_PBR_Overlay_MetallicTex");
116      editor.TexturePropertySingleLine(
117          MakeLabel(bct, "Metallic (RGBA)"),
118          bct,
119          bc);
120      SetKeyword("_PBR_OVERLAY_METALLIC_MAP", bct.textureValue);
121
122       bc = FindProperty("_PBR_Overlay_Roughness");
123       bct = FindProperty("_PBR_Overlay_RoughnessTex");
124      editor.TexturePropertySingleLine(
125          MakeLabel(bct, "Roughness (RGBA)"),
126          bct,
127          bc);
128      SetKeyword("_PBR_OVERLAY_ROUGHNESS_MAP", bct.textureValue);
129    }
130  }
131
132  void DoCubemap() {
133      MaterialProperty bc = FindProperty("_Cubemap");
134      editor.TexturePropertySingleLine(
135          MakeLabel(bc, "Cubemap"),
136          bc);
137      SetKeyword("_CUBEMAP", bc.textureValue);
138  }
139
140  void DoBrightness() {
141      MaterialProperty bc;
142
143      bc = FindProperty("_Min_Brightness");
144      editor.RangeProperty(
145          bc,
146          "Min brightness");
147
148      bc = FindProperty("_Max_Brightness");
149      editor.RangeProperty(
150          bc,
151          "Max brightness");
152  }
153
154  void DoEmission() {
155      MaterialProperty bc = FindProperty("_EmissionTex");
156      MaterialProperty bct = FindProperty("_EmissionStrength");
157      editor.TexturePropertySingleLine(
158          MakeLabel(bct, "Emission map"),
159          bc,
160          bct);
161      SetKeyword("_EMISSION", bc.textureValue);
162  }
163
164  enum MatcapMode {
165    Add,
166    Multiply,
167    Replace,
168    Subtract,
169    Min,
170    Max,
171  }
172
173  void DoMatcap() {
174    for (int i = 0; i < 2; i++) {
175      GUILayout.Label($"Matcap {i}", EditorStyles.boldLabel);
176      EditorGUI.indentLevel += 1;
177
178      MaterialProperty bc;
179
180      bc = FindProperty($"_Matcap{i}");
181      editor.TexturePropertySingleLine(
182          MakeLabel(bc, $"Matcap {i}"),
183          bc);
184      SetKeyword($"_MATCAP{i}", bc.textureValue);
185
186      if (!bc.textureValue) {
187        EditorGUI.indentLevel -= 1;
188        continue;
189      }
190
191      bc = FindProperty($"_Matcap{i}_Mask");
192      editor.TexturePropertySingleLine(
193          MakeLabel(bc, "Mask"),
194          bc);
195      SetKeyword($"_MATCAP{i}_MASK", bc.textureValue);
196
197      if (bc.textureValue) {
198        bc = FindProperty($"_Matcap{i}_Mask_Invert");
199        bool enabled = bc.floatValue > 1E-6;
200        EditorGUI.BeginChangeCheck();
201        enabled = EditorGUILayout.Toggle("Invert mask", enabled);
202        EditorGUI.EndChangeCheck();
203        bc.floatValue = enabled ? 1.0f : 0.0f;
204      }
205
206      EditorGUI.BeginChangeCheck();
207      bc = FindProperty($"_Matcap{i}Mode");
208      MatcapMode mode = (MatcapMode) Math.Round(bc.floatValue);
209      mode = (MatcapMode) EditorGUILayout.EnumPopup(
210          MakeLabel("Matcap mode"), mode);
211      if (EditorGUI.EndChangeCheck()) {
212        RecordAction($"Matcap {i}");
213        foreach (Material m in editor.targets) {
214          m.SetFloat($"_Matcap{i}Mode", (int) mode);
215        }
216      }
217
218      bc = FindProperty($"_Matcap{i}Str");
219      editor.FloatProperty(
220          bc,
221          "Matcap strength");
222      EditorGUI.indentLevel -= 1;
223    }
224  }
225
226  void DoRimLighting() {
227    for (int i = 0; i < 2; i++) {
228      GUILayout.Label($"Rim lighting {i}", EditorStyles.boldLabel);
229      EditorGUI.indentLevel += 1;
230
231      MaterialProperty bc;
232
233      bc = FindProperty($"_Rim_Lighting{i}_Enabled");
234      bool enabled = bc.floatValue > 1E-6;
235      EditorGUI.BeginChangeCheck();
236      enabled = EditorGUILayout.Toggle("Enable", enabled);
237      EditorGUI.EndChangeCheck();
238      bc.floatValue = enabled ? 1.0f : 0.0f;
239      SetKeyword($"_RIM_LIGHTING{i}", enabled);
240
241      if (!enabled) {
242        return;
243      }
244
245      bc = FindProperty($"_Rim_Lighting{i}_Color");
246      editor.ColorProperty(bc, "Color (RGB)");
247
248      bc = FindProperty($"_Rim_Lighting{i}_Mask");
249      editor.TexturePropertySingleLine(
250          MakeLabel(bc, "Mask"),
251          bc);
252      SetKeyword($"_RIM_LIGHTING{i}_MASK", bc.textureValue);
253
254      if (bc.textureValue) {
255        bc = FindProperty($"_Rim_Lighting{i}_Mask_Invert");
256        enabled = bc.floatValue > 1E-6;
257        EditorGUI.BeginChangeCheck();
258        enabled = EditorGUILayout.Toggle("Invert mask", enabled);
259        EditorGUI.EndChangeCheck();
260        bc.floatValue = enabled ? 1.0f : 0.0f;
261      }
262
263      EditorGUI.BeginChangeCheck();
264      bc = FindProperty($"_Rim_Lighting{i}_Mode");
265      MatcapMode mode = (MatcapMode) Math.Round(bc.floatValue);
266      mode = (MatcapMode) EditorGUILayout.EnumPopup(
267          MakeLabel("Rim lighting mode"), mode);
268      if (EditorGUI.EndChangeCheck()) {
269        RecordAction("Rim lighting mode");
270        foreach (Material m in editor.targets) {
271          m.SetFloat($"_Rim_Lighting{i}_Mode", (int) mode);
272        }
273      }
274
275      bc = FindProperty($"_Rim_Lighting{i}_Center");
276      editor.FloatProperty(
277          bc,
278          "Center");
279
280      bc = FindProperty($"_Rim_Lighting{i}_Power");
281      editor.FloatProperty(
282          bc,
283          "Power");
284
285      bc = FindProperty($"_Rim_Lighting{i}_Strength");
286      editor.FloatProperty(
287          bc,
288          "Strength");
289
290      EditorGUI.indentLevel -= 1;
291    }
292  }
293
294  enum NormalsMode {
295    Flat,
296    Spherical
297  };
298
299  void DoShadingMode() {
300    MaterialProperty bc;
301
302    bc = FindProperty($"_Mesh_Normals_Mode");
303    EditorGUI.BeginChangeCheck();
304    NormalsMode mode = (NormalsMode) Math.Round(bc.floatValue, 0);
305    mode = (NormalsMode) EditorGUILayout.EnumPopup(
306        MakeLabel("Normals mode"), mode);
307    if (EditorGUI.EndChangeCheck()) {
308      RecordAction("Rendering Mode");
309    }
310    bc.floatValue = (float) mode;
311
312    if (mode == NormalsMode.Flat) {
313      bc = FindProperty("_Flatten_Mesh_Normals_Str");
314      editor.FloatProperty(
315          bc,
316          "Flattening strength");
317    }
318
319    bc = FindProperty("_Confabulate_Normals");
320    bool enabled = bc.floatValue > 1E-6;
321    EditorGUI.BeginChangeCheck();
322    enabled = EditorGUILayout.Toggle("Confabulate normals", enabled);
323    EditorGUI.EndChangeCheck();
324    bc.floatValue = enabled ? 1.0f : 0.0f;
325  }
326
327  void DoOKLAB() {
328    MaterialProperty bc;
329
330    bc = FindProperty("_OKLAB_Enabled");
331    bool enabled = bc.floatValue > 1E-6;
332    EditorGUI.BeginChangeCheck();
333    enabled = EditorGUILayout.Toggle("Enable", enabled);
334    EditorGUI.EndChangeCheck();
335    bc.floatValue = enabled ? 1.0f : 0.0f;
336
337    SetKeyword("_OKLAB", enabled);
338
339    if (enabled) {
340      bc = FindProperty("_OKLAB_Mask");
341      editor.TexturePropertySingleLine(
342          MakeLabel(bc, "Mask"),
343          bc);
344
345      bc = FindProperty("_OKLAB_Lightness_Shift");
346      editor.RangeProperty(
347          bc,
348          "Lightness shift");
349      bc = FindProperty("_OKLAB_Chroma_Shift");
350      editor.RangeProperty(
351          bc,
352          "Chroma shift");
353      bc = FindProperty("_OKLAB_Hue_Shift");
354      editor.RangeProperty(
355          bc,
356          "Hue shift");
357    }
358  }
359
360  void DoClones() {
361    MaterialProperty bc;
362
363    bc = FindProperty("_Clones_Enabled");
364    bool enabled = bc.floatValue > 1E-6;
365    EditorGUI.BeginChangeCheck();
366    enabled = EditorGUILayout.Toggle("Enable", enabled);
367    EditorGUI.EndChangeCheck();
368    bc.floatValue = enabled ? 1.0f : 0.0f;
369
370    SetKeyword("_CLONES", enabled);
371
372    if (enabled) {
373      bc = FindProperty("_Clones_Count");
374      editor.RangeProperty(
375          bc,
376          "Number of clones");
377      bc = FindProperty("_Clones_dx");
378      editor.RangeProperty(
379          bc,
380          "x offset");
381    }
382  }
383
384  void DoOutlines() {
385      MaterialProperty bc;
386
387      bc = FindProperty("_Outline_Width");
388      editor.RangeProperty(
389          bc,
390          "Outline width");
391      SetKeyword("_OUTLINES", bc.floatValue > 1E-6);
392
393      if (bc.floatValue > 1E-6) {
394        bc = FindProperty("_Outline_Color");
395        editor.ColorProperty(
396            bc,
397            "Outline color (RGBA)");
398
399        bc = FindProperty("_Outline_Emission_Strength");
400        editor.RangeProperty(
401            bc,
402            "Outline emission strength");
403
404        bc = FindProperty("_Outline_Mask");
405        editor.TexturePropertySingleLine(
406            MakeLabel(bc, "Outline mask"),
407            bc);
408
409        bc = FindProperty("_Outline_Mask_Invert");
410        bool inverted = bc.floatValue > 1E-6;
411        EditorGUI.BeginChangeCheck();
412        inverted = EditorGUILayout.Toggle("Invert mask", inverted);
413        EditorGUI.EndChangeCheck();
414        bc.floatValue = inverted ? 1.0f : 0.0f;
415      }
416  }
417
418  void DoGlitter() {
419    MaterialProperty bc = FindProperty("_Glitter_Enabled");
420    bool enabled = bc.floatValue > 1E-6;
421
422    EditorGUI.BeginChangeCheck();
423    enabled = EditorGUILayout.Toggle("Enable", enabled);
424    EditorGUI.EndChangeCheck();
425    SetKeyword("_GLITTER", enabled);
426    bc.floatValue = enabled ? 1.0f : 0.0f;
427
428    if (enabled) {
429      bc = FindProperty("_Glitter_Mask");
430      editor.TexturePropertySingleLine(
431          MakeLabel(bc, "Glitter mask (RGBA)"),
432          bc);
433
434      bc = FindProperty("_Glitter_Density");
435      editor.FloatProperty(
436          bc,
437          "Glitter density");
438
439      bc = FindProperty("_Glitter_Amount");
440      editor.FloatProperty(
441          bc,
442          "Glitter amount");
443
444      bc = FindProperty("_Glitter_Speed");
445      editor.FloatProperty(
446          bc,
447          "Glitter speed");
448
449      bc = FindProperty("_Glitter_Brightness");
450      editor.FloatProperty(
451          bc,
452          "Glitter brightness");
453
454      bc = FindProperty("_Glitter_Angle");
455      editor.FloatProperty(
456          bc,
457          "Glitter angle");
458    }
459  }
460
461  void DoExplosion() {
462    MaterialProperty bc = FindProperty("_Explode_Toggle");
463    bool enabled = bc.floatValue > 1E-6;
464
465    EditorGUI.BeginChangeCheck();
466    enabled = EditorGUILayout.Toggle("Enable", enabled);
467    EditorGUI.EndChangeCheck();
468    SetKeyword("_EXPLODE", enabled);
469    bc.floatValue = enabled ? 1.0f : 0.0f;
470
471    bc = FindProperty("_Explode_Phase");
472    if (enabled) {
473      editor.RangeProperty(
474          bc,
475          "Explosion phase");
476    } else {
477      bc.floatValue = 0.0f;
478    }
479    bc = FindProperty("_OutlinesCull");
480    bc.floatValue = (float) UnityEngine.Rendering.CullMode.Front;
481
482    /*
483    if (enabled) {
484      bc = FindProperty("_Explode_Phase");
485      editor.RangeProperty(
486          bc,
487          "Explosion phase");
488      if (bc.floatValue > 1E-3) {
489        bc = FindProperty("_Cull");
490        bc.floatValue = (float) UnityEngine.Rendering.CullMode.Back;
491      } else {
492        bc = FindProperty("_Cull");
493        bc.floatValue = (float) UnityEngine.Rendering.CullMode.Front;
494      }
495    } else {
496      bc = FindProperty("_Explode_Phase");
497      bc.floatValue = 0.0f;
498      bc = FindProperty("_Cull");
499      bc.floatValue = (float) UnityEngine.Rendering.CullMode.Front;
500    }
501    */
502  }
503
504  void DoGeoScroll() {
505    MaterialProperty bc = FindProperty("_Scroll_Toggle");
506    bool enabled = bc.floatValue > 1E-6;
507
508    EditorGUI.BeginChangeCheck();
509    enabled = EditorGUILayout.Toggle("Enable", enabled);
510    EditorGUI.EndChangeCheck();
511    SetKeyword("_SCROLL", enabled);
512    bc.floatValue = enabled ? 1.0f : 0.0f;
513
514    if (enabled) {
515      bc = FindProperty("_Scroll_Top");
516      editor.RangeProperty(
517          bc,
518          "Scroll top");
519
520      bc = FindProperty("_Scroll_Bottom");
521      editor.RangeProperty(
522          bc,
523          "Scroll bottom");
524
525      bc = FindProperty("_Scroll_Width");
526      editor.RangeProperty(
527          bc,
528          "Scroll width");
529
530      bc = FindProperty("_Scroll_Strength");
531      editor.RangeProperty(
532          bc,
533          "Scroll strength");
534
535      bc = FindProperty("_Scroll_Speed");
536      editor.RangeProperty(
537          bc,
538          "Scroll speed");
539    }
540  }
541
542  void DoUVScroll() {
543    MaterialProperty bc = FindProperty("_UVScroll_Enabled");
544    bool enabled = bc.floatValue > 1E-6;
545
546    EditorGUI.BeginChangeCheck();
547    enabled = EditorGUILayout.Toggle("Enable", enabled);
548    EditorGUI.EndChangeCheck();
549    SetKeyword("_UVSCROLL", enabled);
550    bc.floatValue = enabled ? 1.0f : 0.0f;
551
552    if (enabled) {
553      bc = FindProperty("_UVScroll_Mask");
554      editor.TexturePropertySingleLine(
555          MakeLabel(bc, "Mask"),
556          bc);
557
558      bc = FindProperty("_UVScroll_U_Speed");
559      editor.FloatProperty(
560          bc,
561          "U speed");
562
563      bc = FindProperty("_UVScroll_V_Speed");
564      editor.FloatProperty(
565          bc,
566          "V speed");
567
568      bc = FindProperty("_UVScroll_Alpha");
569      editor.TexturePropertySingleLine(
570          MakeLabel(bc, "Alpha"),
571          bc);
572    }
573  }
574
575  void DoTessellation() {
576    MaterialProperty bc = FindProperty("_Enable_Tessellation");
577    bool enabled = bc.floatValue > 1E-6;
578
579    EditorGUI.BeginChangeCheck();
580    enabled = EditorGUILayout.Toggle("Enable", enabled);
581    EditorGUI.EndChangeCheck();
582    SetKeyword("_TESSELLATION", enabled);
583    bc.floatValue = enabled ? 1.0f : 0.0f;
584
585    if (enabled) {
586      bc = FindProperty("_Tess_Factor");
587      editor.RangeProperty(
588          bc,
589          "Tessellation factor");
590
591      bc = FindProperty("_Tess_Dist_Cutoff");
592      editor.FloatProperty(
593          bc,
594          "Activation distance (negative=always on)");
595    }
596  }
597
598  enum RenderingMode {
599    Opaque,
600    Cutout,
601    Fade
602  }
603
604  void DoRendering() {
605    RenderingMode mode = RenderingMode.Opaque;
606    if (target.IsKeywordEnabled("_RENDERING_CUTOUT")) {
607      mode = RenderingMode.Cutout;
608    } else if (target.IsKeywordEnabled("_RENDERING_FADE")) {
609      mode = RenderingMode.Fade;
610    }
611
612    EditorGUI.BeginChangeCheck();
613    mode = (RenderingMode) EditorGUILayout.EnumPopup(
614        MakeLabel("Rendering Mode"), mode);
615    BlendMode src_blend = BlendMode.One;
616    BlendMode dst_blend = BlendMode.Zero;
617    bool zwrite = false;
618
619    if (EditorGUI.EndChangeCheck()) {
620      RecordAction("Rendering Mode");
621      SetKeyword("_RENDERING_CUTOUT", mode == RenderingMode.Cutout);
622      SetKeyword("_RENDERING_FADE", mode == RenderingMode.Fade);
623
624      RenderQueue queue = RenderQueue.Geometry;
625      string render_type = "";
626      switch (mode) {
627        case RenderingMode.Opaque:
628          queue = RenderQueue.Geometry;
629          render_type = "";
630          src_blend = BlendMode.One;
631          dst_blend = BlendMode.Zero;
632          zwrite = true;
633          break;
634        case RenderingMode.Cutout:
635          queue = RenderQueue.AlphaTest;
636          render_type = "TransparentCutout";
637          src_blend = BlendMode.One;
638          dst_blend = BlendMode.Zero;
639          zwrite = true;
640          break;
641        case RenderingMode.Fade:
642          queue = RenderQueue.Transparent;
643          render_type = "Transparent";
644          src_blend = BlendMode.SrcAlpha;
645          dst_blend = BlendMode.OneMinusSrcAlpha;
646          zwrite = false;
647          break;
648      }
649      foreach (Material m in editor.targets) {
650        m.renderQueue = (int) queue;
651        m.SetOverrideTag("RenderType", render_type);
652        m.SetInt("_SrcBlend", (int) src_blend);
653        m.SetInt("_DstBlend", (int) dst_blend);
654        m.SetInt("_ZWrite", zwrite ? 1 : 0);
655      }
656    }
657
658    MaterialProperty bc;
659    if (mode == RenderingMode.Cutout) {
660      bc = FindProperty("_Alpha_Cutoff");
661      editor.ShaderProperty(bc, MakeLabel(bc));
662    }
663
664    bc = FindProperty("_Cull");
665    UnityEngine.Rendering.CullMode cull_mode = (UnityEngine.Rendering.CullMode) bc.floatValue;
666    EditorGUI.BeginChangeCheck();
667    cull_mode = (UnityEngine.Rendering.CullMode) EditorGUILayout.EnumPopup(
668        MakeLabel("Culling mode"), cull_mode);
669    if (EditorGUI.EndChangeCheck()) {
670      RecordAction("Culling mode");
671      bc.floatValue = (float) cull_mode;
672    }
673  }
674
675  void DoLTCGI() {
676#if LTCGI_INCLUDED
677    GUILayout.Label($"Available: yes");
678
679    MaterialProperty bc = FindProperty("_LTCGI_Enabled");
680    bool enabled = bc.floatValue > 1E-6;
681    EditorGUI.BeginChangeCheck();
682    enabled = EditorGUILayout.Toggle("Enable", enabled);
683    EditorGUI.EndChangeCheck();
684    bc.floatValue = enabled ? 1.0f : 0.0f;
685    SetKeyword("_LTCGI", enabled);
686
687    bc = FindProperty("_LTCGI_SpecularColor");
688    editor.ColorProperty(bc, "Specular color (RGB)");
689
690    bc = FindProperty("_LTCGI_DiffuseColor");
691    editor.ColorProperty(bc, "Diffuse color (RGB)");
692#else
693    GUILayout.Label($"Available: no");
694#endif  // LTCGI_INCLUDED
695  }
696
697  void DoMain() {
698    GUILayout.Label("PBR", EditorStyles.boldLabel);
699    EditorGUI.indentLevel += 1;
700    DoBaseColor();
701    DoNormal();
702    DoMetallic();
703    DoRoughness();
704    EditorGUI.indentLevel -= 1;
705
706    GUILayout.Label("PBR overlay", EditorStyles.boldLabel);
707    EditorGUI.indentLevel += 1;
708    DoPBROverlay();
709    EditorGUI.indentLevel -= 1;
710
711    GUILayout.Label("Lighting", EditorStyles.boldLabel);
712    EditorGUI.indentLevel += 1;
713    DoCubemap();
714    DoBrightness();
715    EditorGUI.indentLevel -= 1;
716
717    GUILayout.Label("Emission", EditorStyles.boldLabel);
718    EditorGUI.indentLevel += 1;
719    DoEmission();
720    EditorGUI.indentLevel -= 1;
721
722    GUILayout.Label("Shading", EditorStyles.boldLabel);
723    EditorGUI.indentLevel += 1;
724    DoShadingMode();
725    EditorGUI.indentLevel -= 1;
726
727    DoMatcap();
728    DoRimLighting();
729
730    GUILayout.Label("Outlines", EditorStyles.boldLabel);
731    EditorGUI.indentLevel += 1;
732    DoOutlines();
733    EditorGUI.indentLevel -= 1;
734
735    GUILayout.Label("Glitter", EditorStyles.boldLabel);
736    EditorGUI.indentLevel += 1;
737    DoGlitter();
738    EditorGUI.indentLevel -= 1;
739
740    GUILayout.Label("Explosion", EditorStyles.boldLabel);
741    EditorGUI.indentLevel += 1;
742    DoExplosion();
743    EditorGUI.indentLevel -= 1;
744
745    GUILayout.Label("Geometry scroll", EditorStyles.boldLabel);
746    EditorGUI.indentLevel += 1;
747    DoGeoScroll();
748    EditorGUI.indentLevel -= 1;
749
750    GUILayout.Label("UV scroll", EditorStyles.boldLabel);
751    EditorGUI.indentLevel += 1;
752    DoUVScroll();
753    EditorGUI.indentLevel -= 1;
754
755    GUILayout.Label("Tessellation", EditorStyles.boldLabel);
756    EditorGUI.indentLevel += 1;
757    DoTessellation();
758    EditorGUI.indentLevel -= 1;
759
760    GUILayout.Label("Hue shift", EditorStyles.boldLabel);
761    EditorGUI.indentLevel += 1;
762    DoOKLAB();
763    EditorGUI.indentLevel -= 1;
764
765    GUILayout.Label("Clones", EditorStyles.boldLabel);
766    EditorGUI.indentLevel += 1;
767    DoClones();
768    EditorGUI.indentLevel -= 1;
769
770    GUILayout.Label("Rendering", EditorStyles.boldLabel);
771    EditorGUI.indentLevel += 1;
772    DoRendering();
773    EditorGUI.indentLevel -= 1;
774
775    GUILayout.Label("LTCGI", EditorStyles.boldLabel);
776    EditorGUI.indentLevel += 1;
777    DoLTCGI();
778    EditorGUI.indentLevel -= 1;
779  }
780}
781
782