Exemple #1
0
        public Rect DRAW_MASK_PANEL_CB(Rect r, string name, string help, string FEATURE,
                                       string[] _texture,
                                       POP_CLASS texture_SWITCHER,
                                       string tile,
                                       string offset,
                                       string contrast,
                                       string brightnes,
                                       string maskDebug,
                                       ref bool enable, POP_CLASS pop)
        {
            if (!target.compiler.material)
            {
                return(r);
            }

            //   amountClamp = amountClamp ?? new Vector2(0, 5);

            var S       = 0;
            var usemask = DRAW_TOGGLE(r, name, FEATURE, enable, out tV) & enable;  r.y += 31;
            var og      = GUI.enabled;

            GUI.enabled = usemask;
            enable      = usemask;

            var oc = GUI.color;

            GUI.color *= new Color32(255, 255, 211, 255);

            r = DrawTextureWIthChannelAndSwitcher(r, usemask, _texture, texture_SWITCHER, pop);

            if (help != null)
            {
                var h = EditorStyles.helpBox.CalcHeight(new GUIContent(help), r.width);
                r.height = h;
                EditorGUI.HelpBox(r, help, MessageType.None); r.y += r.height;
            }


            //string maskTexture;



            r = DRAW_SLIDER(r, "Tile X/Y", tile, 0, 100, usemask, div: 10); r.y += r.height + S;
            r = DRAW_VECTOR(r, "Offset X/Y", offset, -100, 100, enable, div: 100); r.y += r.height + S;
            r = DRAW_SLIDER(r, "Contrast", contrast, 0, 100, usemask); r.y += r.height + S;
            r = DRAW_SLIDER(r, "Brightnes", brightnes, -100, 100, usemask); r.y += r.height + S;
            //  r = DRAW_DOUBLEFIELDS(r, "Brightnes", new[] { min, max }, new[] { -1, 0.0f }, new[] { 2f, 10 }, usemask); r.y += r.height + S;

            DRAW_TOGGLE(r, "Debug Mask", maskDebug, enable, out tV);
            r.y += 31;



            GUI.enabled = og;

            GUI.color = oc;
            return(r);
            //r = target.DRAW_SLIDER( r, "Mask Clamp", FIELDS._ReflectionMask_UpClamp, 0.5f, 10, usemask ); r.y += r.height + S;
        }
Exemple #2
0
        public Rect DrawTextureWIthChannelAndSwitcher(Rect r, bool enable,
                                                      string[] _texture,
                                                      POP_CLASS texture_SWITCHER, POP_CLASS pop)
        {
            int index = 0;

            if (texture_SWITCHER != null)
            {
                r.height = FastWaterModel20ControllerEditor.H;
                texture_SWITCHER.DrawPop(null, r); r.y += r.height;
                index = texture_SWITCHER.VALUE;
            }
            string texture = _texture[index];

            // maskTexture = FIELDS._MainTex;

            //Color c = new Color(1, 0, 0, 0);

            //r.height = FastWaterModel20ControllerEditor.H * 2;
            // EditorGUI.HelpBox(r, "Used MainTexture (R)", MessageType.None); r.y += r.height;
            // r = DRAW_GRAPHIC(r, 40, target.compiler.GetTexture(maskTexture) as Texture2D, usemask, c); r.y += r.height;



            if (index == texture_SWITCHER.defaultIndex)
            {
                r = DRAW_BG_TEXTURE(r, "Texture", texture, enable, out tV, null); r.y += r.height;
            }
            else
            {
                r = DRAW_GRAPHIC(r, 50, target.compiler.GetTexture(texture) as Texture2D, enable); r.y += r.height;
                //  r = DRAW_BG_TEXTURE(r, "Texture", texture, usemask, out tV, null); r.y += r.height;
            }
            Color c = new Color(1, 0, 0, 0);

            if (pop != null)
            { //r.height = FastWaterModel20ControllerEditor.H * 2;
              // EditorGUI.HelpBox(r, "Used MainTexture", MessageType.None);
              //r.y += r.height;
                r.height = FastWaterModel20ControllerEditor.H;
                pop.DrawPop(null, r); r.y += r.height;
                c = GET_COLOR(pop.VALUE);
            }
            else
            {
                r.height = FastWaterModel20ControllerEditor.H * 2;
                EditorGUI.HelpBox(r, "Used MainTexture (R)", MessageType.None); r.y += r.height;
            }
            r = DRAW_GRAPHIC(r, 30, target.compiler.GetTexture(texture) as Texture2D, enable, c); r.y += r.height;
            return(r);
        }
Exemple #3
0
            override public void Draw(Rect input, out Vector2[] output)
            {
                output = new Vector2[1];
                if (!target.target.compiler || !target.target.compiler.material)
                {
                    return;
                }

                for (int i = 0; i < output.Length; i++)
                {
                    output[i] = Vector2.zero;
                }
                LAST_GROUP_R = new Rect(input.x, input.y, 390, target.MENU_CURRENT_HEIGHT());
                GUI.BeginGroup(LAST_GROUP_R);
                var r = new Rect(0, 0, BOTTOM_W, 0);
                // r.x += BOTTOM_W + 10;

                var og = GUI.enabled;

                var  S       = 0;
                bool useBlur = false;

                target.DRAW_TOGGLE(r, "images_reflection", null, target.pop_reflection.VALUE != 0, out tV); r.y += 31;
                r.height = FastWaterModel20ControllerEditor.H;
                EditorGUI.HelpBox(r, "Reflection", MessageType.None);
                target.pop_reflection.DrawPop(null, r); r.y += r.height;
                var use_refl = target.pop_reflection.VALUE != 0;

                GUI.enabled = use_refl;

                if (target.MODE_MINIMUM && target.pop_reflection.VALUE != 0)
                {
                    r.height = FastWaterModel20ControllerEditor.H * 12;
                    EditorGUI.HelpBox(r, "Reflection not awaliable in Minimum Mode", MessageType.Info); r.y += r.height;

                    GUI.enabled  = og;
                    LAST_GROUP_R = Rect.zero;
                    GUI.EndGroup();
                    return;
                }



                if (target.pop_reflection.VALUE == 0)
                { //  EditorGUI.HelpBox(r, "None", MessageType.None);
                    r.y += FastWaterModel20ControllerEditor.H;
                    r.y += FastWaterModel20ControllerEditor.H;

                    r.y += FastWaterModel20ControllerEditor.H;
                }
                else
                {
                    bool useCreateBrobe = false;
                    if (target.pop_reflection.keys[target.pop_reflection.VALUE] == FIELDS.REFLECTION_2D)
                    {
                        r       = target.DRAW_BAKED_TEXTURE(r, FIELDS.baked_ReflectionTex, use_refl, BakeOrUpdateType.Reflection);
                        useBlur = target.MODE_ADVANCEPC;
                    }
                    else if (target.pop_reflection.keys[target.pop_reflection.VALUE] == FIELDS.REFLECTION_USER)
                    {
                        r = target.DRAW_BG_TEXTURE(r, "Cubemap Texture", FIELDS._ReflectionUserCUBE, use_refl, out tV, null, true); r.y += r.height;
                        // r = target.DRAW_SLIDER( r, "Cubemap LOD", FIELDS._ReflectionLOD, 0f, 4, use_refl ); r.y += r.height + S;
                        r       = target.DRAW_SLIDER(r, "Y Offset", FIELDS._ReflectionYOffset, -0.4f, 0.4f, use_refl); r.y += r.height + S;
                        useBlur = true;
                    }
                    else if (target.pop_reflection.keys[target.pop_reflection.VALUE] == FIELDS.REFLECTION_PROBE)
                    { // r = target.DRAW_SLIDER( r, "Cubemap LOD", FIELDS._ReflectionLOD, 0f, 4, use_refl ); r.y += r.height + S;
                        r = target.DRAW_SLIDER(r, "Y Offset", FIELDS._ReflectionYOffset, -0.4f, 0.4f, use_refl); r.y += r.height + S;
                        useCreateBrobe = true;
                        useBlur        = true;
                    }
                    else if (target.pop_reflection.keys[target.pop_reflection.VALUE] == FIELDS.REFLECTION_PROBE_AND_INTENSITY)
                    { // r = target.DRAW_SLIDER( r, "Cubemap LOD", FIELDS._ReflectionLOD, 0f, 4, use_refl ); r.y += r.height + S;
                        r = target.DRAW_SLIDER(r, "Y Offset", FIELDS._ReflectionYOffset, -0.4f, 0.4f, use_refl); r.y += r.height + S;
                        useCreateBrobe = true;
                        useBlur        = true;
                    }
                    else if (target.pop_reflection.keys[target.pop_reflection.VALUE] == FIELDS.REFLECTION_PLANAR)
                    {
                        r        = target.DRAW_RESOLUTION(r, FIELDS.baked_ReflectionTex_temp + "_size"); r.y += r.height;
                        r.height = FastWaterModel20ControllerEditor.H * 2;
                        EditorGUI.HelpBox(r, "Obj with same Y using one pass", MessageType.None); r.y += r.height;
                        r       = target.DRAW_KAYERMASK(r, "Render Layers", "_ReflectionBakeLayers", () => { }); r.y += r.height;
                        useBlur = target.MODE_ADVANCEPC;
                        useBlur = true;

                        var     oldValue = target.target.compiler.PlanarReflectionClipPlaneOffset;
                        var     newValue = oldValue;
                        Vector2 ov;
                        r = target.DRAW_SLIDER(r, "Y Offset", null, compilerValue: ref newValue, leftValue: -10, rightValue: 10, enable: GUI.enabled, output: out ov);
                        GUI_TOOLTIP(r, "Use this to offset reflectioin camera");
                        r.y += r.height;
                        if (oldValue != newValue)
                        {
                            target.target.Undo();
                            target.target.compiler.PlanarReflectionClipPlaneOffset = newValue;
                            target.target.SetDirty();
                        }

                        var oldValue2 = target.target.compiler.PlanarReflectionSkipEveryFrame;
                        var newValue2 = (float)oldValue2;
                        r = target.DRAW_SLIDER(r, "SkipEveryFrame", null, compilerValue: ref newValue2, leftValue: 0, rightValue: 30, enable: GUI.enabled, output: out ov, integer: true);
                        GUI_TOOLTIP(r, "Use this to improve performance by skip reflection's render in every n frame");
                        r.y += r.height;
                        if (oldValue2 != newValue2)
                        {
                            target.target.Undo();
                            target.target.compiler.PlanarReflectionSkipEveryFrame = (int)newValue2;
                            target.target.SetDirty();
                        }
                    }
                    else if (target.pop_reflection.keys[target.pop_reflection.VALUE] == "REFLECTION_JUST_COLOR")
                    {
                        r = target.DRAW_COLOR(r, "Color", "_ReflectionJustColor", true, out tV, false); r.y += r.height;
                    }
                    if (useCreateBrobe)
                    {
                        r.height = FastWaterModel20ControllerEditor.H * 2;
                        if (GUI.Button(r, "Create Probe"))
                        {
                            if (target.target.gameObject.GetComponentInChildren <ReflectionProbe>())
                            {
                                Selection.objects = new[] { (UnityEngine.Object)target.target.gameObject.GetComponentInChildren <ReflectionProbe>().gameObject };
                            }
                            else
                            {
                                var o  = new GameObject("Reflection Probe");
                                var rp = o.AddComponent <ReflectionProbe>();
                                rp.refreshMode        = UnityEngine.Rendering.ReflectionProbeRefreshMode.OnAwake;
                                rp.timeSlicingMode    = UnityEngine.Rendering.ReflectionProbeTimeSlicingMode.AllFacesAtOnce;
                                rp.mode               = UnityEngine.Rendering.ReflectionProbeMode.Realtime;
                                rp.resolution         = 256;
                                rp.size               = new Vector3(5, 5, 5);
                                rp.hdr                = false;
                                rp.shadowDistance     = 100;
                                rp.farClipPlane       = 1000;
                                rp.cullingMask        = FastWaterModel20Controller.CulMask;
                                rp.transform.position = target.target.transform.position;
                                rp.transform.SetParent(target.target.transform);
                                Undo.RegisterCreatedObjectUndo(o, "Create Reflection Probe");
                            }
                        }

                        r.y += r.height;
                    }
                    if (target.MODE_ULTRA_FAST)
                    {
                        r.y += FastWaterModel20ControllerEditor.H;
                        target.d_D_Foam.LowDistortion(ref r, target);
                        r.x = 100;
                        r.y = 0;
                    }
                    else
                    {
                        r.y += FastWaterModel20ControllerEditor.H;
                    }

                    var ur = target.DRAW_TOGGLE(r, "Use Color", "COLORIZE_REFLECTION", use_refl, out tV) & use_refl; r.y += 31;
                    r = target.DRAW_COLOR(r, null, "_ReflectColor", ur, out tV, false); r.y += r.height;


                    r = target.DRAW_SLIDER(r, "Amount", FIELDS._ReflectionAmount, 0f, 10, use_refl); r.y += r.height + S;
                    if (!target.MODE_ULTRA_FAST)
                    {
                        var desat = target.DRAW_TOGGLE(r, "DeSaturate", "DESATURATE_REFL", use_refl, out tV) & use_refl; r.y += 31;
                        if (desat)
                        {
                            r = target.DRAW_SLIDER(r, null, "_ReflectionDesaturate", 0f, 1f, desat); r.y += r.height + S;
                        }
                    }
                    r = target.DRAW_SLIDER(r, "Distortion", FIELDS.baked_ReflectionTex_distortion, 0f, 200, use_refl); r.y += r.height + S;
                    r = target.DRAW_SLIDER(r, "Low Distortion", "LOW_ReflectionTex_distortion", 0f, 100, use_refl, div: 10); r.y += r.height + S;


                    if (target.MODE_ULTRA_FAST)
                    {
                        r.y     += FastWaterModel20ControllerEditor.H;
                        r.height = FastWaterModel20ControllerEditor.H;
                        EditorGUI.HelpBox(r, "Blend Type", MessageType.None); r.y += r.height;
                        target.pop_rrfastblend.DrawPop(null, r); r.y += r.height;
                        { r = target.DRAW_SLIDER(r, "Blend Amount", "_ReflectionBlendAmount", 0f, 1f, use_refl); r.y += r.height + S; }

                        // var ff = target.DRAW_TOGGLE(r, "Use Fast Fresnel", "USE_FAST_FRESNEL", use_refl); r.y += 31;
                        { r = target.DRAW_SLIDER(r, "Fresnel Amount", "_FastFresnelAmount", 0f, 20, target.pop_rrfastblend.VALUE == 2 && use_refl); r.y += r.height + S;
                          r = target.DRAW_SLIDER(r, "Fresnel Pow", "_FastFresnelPow", 0f, 20, target.pop_rrfastblend.VALUE == 2 && use_refl); r.y += r.height + S; }



                        r.y += FastWaterModel20ControllerEditor.H;
                        target.DRAW_TOGGLE(r, "Debug Reflect", "REFLECTION_DEBUG_RGB", use_refl); r.y += 31;

                        r.x = 300;
                        r.y = 0;
                    }
                    else
                    {
                        r.y += FastWaterModel20ControllerEditor.H;
                    }

                    var  bb      = GUI.enabled;
                    bool en_blur = true;
                    if (useBlur)
                    {
                        en_blur     = target.DRAW_TOGGLE(r, "Blur", FIELDS.REFLECTION_BLUR, useBlur, out tV) & GUI.enabled & useBlur; r.y += 31;
                        GUI.enabled = en_blur;

                        if (target.MODE_ADVANCEPC)
                        {
                            r.height = FastWaterModel20ControllerEditor.H;
                            target.pop_reflection_blur.DrawPop(null, r); r.y += r.height;

                            if (target.MODE_ULTRA_FAST && target.pop_reflection_blur.VALUE > 0)
                            {
                                r.height = FastWaterModel20ControllerEditor.H * 6;
                                EditorGUI.HelpBox(r, "Ultra Fast Mode only 1 Interation awaliable", MessageType.Error); r.y += r.height;
                            }
                        }
                    }
                    else
                    { // r.height = FastWaterModel20ControllerEditor.H;
                      //GUI.Label(r, "Blur");
                      // r.y += r.height;
                    }

                    if (useBlur)
                    {
                        r = target.DRAW_SLIDER(r, "Radius", FIELDS._ReflectionBlurRadius, 0, 10, en_blur); r.y += r.height + S;
                        if (target.MODE_ADVANCEPC)
                        {
                            var skip_zd = target.DRAW_TOGGLE(r, "Depth Affect", FIELDS.SKIP_REFLECTION_BLUR_ZDEPENDS, en_blur, out tV) & en_blur;
                            GUI_TOOLTIP(r, "Water Reflection will be blurred depending on the depth"); r.y += 31;
                            if (skip_zd && !target.ZEnabled())
                            {
                                r.height = FastWaterModel20ControllerEditor.H * 2;
                                EditorGUI.HelpBox(r, "Requests ZDepth", MessageType.Error); r.y += r.height;
                            }
                            r = target.DRAW_SLIDER(r, "Depth Offset", "_ReflectionBlurZOffset", -10, 3, skip_zd); r.y += r.height + S;
                        }
                    }
                    GUI.enabled = bb;


                    if (!target.MODE_ULTRA_FAST)
                    {
                        r.y += FastWaterModel20ControllerEditor.H;
                        target.d_D_Foam.LowDistortion(ref r, target);
                        r.x = 100;
                        r.y = 0;

                        //////////////////////////////
                        string    FEATURE = FIELDS.SKIP_REFLECTION_MASK;
                        string    tile    = FIELDS._ReflectionMask_Tile;
                        string    amount  = FIELDS._ReflectionMask_Amount;
                        string    min     = FIELDS._ReflectionMask_Offset;
                        string    max     = FIELDS._ReflectionMask_UpClamp;
                        string    offset  = "_ReflectionMask_TexOffsetF";
                        bool      enable  = use_refl;
                        POP_CLASS pop     = target.pop_reflectmaskb;
                        //////////////////////////////
                        r = target.DRAW_MASK_PANEL(r, "Mask", null, FEATURE, tile, offset, amount, min, max, "REFL_MASK_DEBUG", ref enable, pop);
                        //////////////////////////////
                        ///
                        r.y += FastWaterModel20ControllerEditor.H;
                        target.DRAW_TOGGLE(r, "Debug Reflect", "REFLECTION_DEBUG_RGB", GUI.enabled); r.y += 31;
                    }



                    if (!target.MODE_ULTRA_FAST)
                    {
                        r.x = 200;
                        r.y = 0;


                        GUI.enabled = use_refl || target.pop_reflection.VALUE == 4 || target.pop_refraction.VALUE == 5 ||
                                      target.target.compiler.IsKeywordEnabled("RIM") ||
                                      target.target.compiler.IsKeywordEnabled("RRFRESNEL") ||
                                      target.target.compiler.IsKeywordEnabled("HAS_REFRACTION_Z_BLEND_AND_RRFRESNEL")
                        ;
                        var usefr = target.DRAW_TOGGLE(r, "Use Fresnel", FIELDS.SKIP_FRESNEL_CALCULATION, GUI.enabled, out tV) & GUI.enabled; r.y += 31;
                        var
                            oldC = GUI.color;
                        GUI.color *= new Color32(176, 216, 255, 225);
                        /*if (pow)*/
                        { r = target.DRAW_SLIDER(r, "F Amount", "_FresnelAmount", 0.6f, 5.8f, usefr && !target.target.compiler.IsKeywordEnabled("REFLECTION_DEBUG_RGB")); r.y += r.height + S; }
                        //var grad = DRAW_TOGGLE(r, "Gradient (R)", FIELDS.SKIP_FRESNEL_GRADIENT, usefr, out tV) & usefr; r.y += 31;
                        //if (grad) { r = DRAW_GRAPHIC(r, 40, compiler.GetTexture(FIELDS._Utility) as Texture2D, use_refl, new Color(1, 0, 0, 0)); r.y += r.height; }
                        // var pow = DRAW_TOGGLE(r, "Use Pow", FIELDS.USE_FRESNEL_POW, usefr, out tV) & usefr; r.y += 31;
                        /*if (pow)*/
                        { r = target.DRAW_SLIDER(r, "F Pow", FIELDS._FresnelPow, 0f, 100, usefr); r.y += r.height + S;
                          { r = target.DRAW_SLIDER(r, "F Fade", "_FresnelFade", 0.0f, 1, usefr); r.y += r.height + S; } }


                        var ben = target.DRAW_TOGGLE(r, "Fresnel to Blur", "SKIP_FRES_BLUR",
                                                     usefr & target.target.compiler.IsKeywordEnabled(FIELDS.REFLECTION_BLUR)) & usefr & target.target.compiler.IsKeywordEnabled(FIELDS.REFLECTION_BLUR); r.y += 31;
                        if (ben)
                        { //  { r = DRAW_SLIDER(r, "Amount", "", 1f, 10, usefr); r.y += r.height + S; }
                            r = target.DRAW_DOUBLEFIELDS(r, "Amount/Offset", new[] { "FRES_BLUR_AMOUNT", "FRES_BLUR_OFF" }, new[] { 0, 0.05f }, new[] { 10f, 0.95f }, usefr); r.y += r.height + S;
                        }
                        target.DRAW_TOGGLE(r, "Inverse", "FRESNEL_INVERCE", usefr, out tV); r.y += 31;



                        r.y += FastWaterModel20ControllerEditor.H;
                        target.DRAW_TOGGLE(r, "Debug Fresnel", "DEBUG_FRESNEL", usefr); r.y += 31;
                        GUI.color = oldC;


                        /* var usemask = target.DRAW_TOGGLE( r, "Mask", FIELDS.SKIP_REFLECTION_MASK, use_refl, out tV ) & use_refl; r.y += 31;
                        *  GUI.enabled = usemask;
                        *  string maskTexture;
                        *  r.height = FastWaterModel20ControllerEditor.H * 2;
                        *
                        *  // if (!target.target.material.IsKeywordEnabled( FIELDS.SKIP_MAINTEXTURE )) {
                        *  EditorGUI.HelpBox( r, "Used Main Texture", MessageType.Info ); r.y += r.height;
                        *  maskTexture = FIELDS._MainTex;
                        *
                        *  r.height = FastWaterModel20ControllerEditor.H;
                        *  target.pop_reflectmaskb.DrawPop( null, r ); r.y += r.height;
                        *  r = DRAW_GRAPHIC( r, 40, target.target.material.GetTexture( maskTexture ) as Texture2D, usemask, GET_COLOR( target.pop_reflectmaskb.VALUE ) ); r.y += r.height;
                        *  r = target.DRAW_SLIDER( r, "Tile XY", FIELDS._ReflectionMask_Tile, 0, 2, usemask ); r.y += r.height + S;
                        *  r = target.DRAW_SLIDER( r, "Mask Amount", FIELDS._ReflectionMask_Amount, 1, 5, usemask ); r.y += r.height + S;
                        *  r = target.DRAW_DOUBLEFIELDS( r, "Min/Max", new[] { FIELDS._ReflectionMask_Offset, FIELDS._ReflectionMask_UpClamp }, new[] { 0, 0.5f }, new[] { 2f, 10 }, usemask ); r.y += r.height + S;
                        *  //r = target.DRAW_SLIDER( r, "Mask Clamp", FIELDS._ReflectionMask_UpClamp, 0.5f, 10, usemask ); r.y += r.height + S;*/


                        r.x = 300;
                        r.y = 0;

                        target.DRAW_RRBLEND(r);
                    }
                }

                GUI.enabled  = og;
                LAST_GROUP_R = Rect.zero;
                GUI.EndGroup();
            }
Exemple #4
0
            override public void Draw(Rect input, out Vector2[] output)
            {
                output = new Vector2[1];
                if (!target.target.compiler || !target.target.compiler.material)
                {
                    return;
                }

                for (int i = 0; i < output.Length; i++)
                {
                    output[i] = Vector2.zero;
                }
                LAST_GROUP_R = new Rect(input.x, input.y, 400, target.MENU_CURRENT_HEIGHT());
                GUI.BeginGroup(LAST_GROUP_R);
                var r  = new Rect(0, 0, BOTTOM_W, 0);
                var og = GUI.enabled;

                var S = 0;

                target.DRAW_TOGGLE(r, "images_refraction", null, true, out tV); r.y += 31;

                r.height = FastWaterModel20ControllerEditor.H;
                EditorGUI.HelpBox(r, "Refraction", MessageType.None); r.y += r.height;
                var oldV = target.pop_refraction.VALUE;

                target.pop_refraction.DrawPop(null, r); r.y += r.height;
                var wasChanged = target.pop_refraction.VALUE != oldV;

                if (target.pop_refraction.VALUE == 0)
                {
                    r.height = FastWaterModel20ControllerEditor.H;
                    EditorGUI.HelpBox(r, "None", MessageType.None); r.y += r.height;
                }
                else
                {
                    var haveMask = false;
                    if (target.pop_refraction.VALUE == 2)
                    { //REFRACTION_BAKED_FROM_TEXTURE
                        target.target.compiler.SetTexture(FIELDS.baked_RefractionTex, target.target.backed_refraction);
                        r = target.DRAW_BAKED_TEXTURE(r, FIELDS.baked_RefractionTex, true, BakeOrUpdateType.Refraction);
                        if (target.target.backed_refraction != target.target.compiler.GetTexture(FIELDS.baked_RefractionTex))
                        {
                            target.target.Undo();
                            target.target.backed_refraction = target.target.compiler.GetTexture(FIELDS.baked_RefractionTex) as Texture2D;
                            target.target.SetDirty();
                        }

                        r.height = FastWaterModel20ControllerEditor.H * 4;
                        EditorGUI.HelpBox(r, "Different objects with same material may use different textures", MessageType.None); r.y += r.height;
                        r.y += r.height;
                    }
                    else if (target.pop_refraction.VALUE == 3)
                    { //REFRACTION_BAKED_VIA_SCRIPT
                        r        = target.DRAW_RESOLUTION(r, FIELDS.baked_RefractionTex_temp_size); r.y += r.height;
                        r.height = FastWaterModel20ControllerEditor.H * 7;
                        EditorGUI.HelpBox(r, "Use BakeOrUpdateTexture( BakeOrUpdateType.ZDepth );", MessageType.None); r.y += r.height;
                        haveMask = true;
                    }
                    else if (target.pop_refraction.VALUE == 4)
                    { //REFRACTION_BAKED_ONAWAKE
                        bool rc;
                        r = target.DRAW_RESOLUTION(r, FIELDS.baked_RefractionTex_temp_size, out rc); r.y += r.height;
                        if (wasChanged || rc)
                        {
                            target.target.m_BakeOrUpdateTexture(BakeOrUpdateType.Refraction, target.LastResolution);
                        }
                        r.height = FastWaterModel20ControllerEditor.H * 3;
                        EditorGUI.HelpBox(r, "Texture will baking OnEnable once", MessageType.None); r.y += r.height;
                        haveMask = true;
                    }
                    else if (target.pop_refraction.VALUE == 5)
                    { //GRABPASS
                        r.height = FastWaterModel20ControllerEditor.H * 3;
                        EditorGUI.HelpBox(r, "Material will use Realtime GrabPass", MessageType.None); r.y += r.height;

                        if (target.IS_OPAQUE)
                        {
                            r.height = FastWaterModel20ControllerEditor.H * 6;
                            EditorGUI.HelpBox(r, "GrabPass not working with opaque shader", MessageType.Error); r.y += r.height;
                        }
                    }
                    else
                    {
                        GUI.enabled = target.pop_refraction.VALUE != 0;
                    }

                    if (haveMask)
                    {
                        r = target.DRAW_KAYERMASK(r, "Render Layers", "_RefractionBakeLayers", () => target.target.m_BakeOrUpdateTexture(BakeOrUpdateType.Refraction, target.LastResolution)); r.y += r.height;
                    }


                    var venable = true;
                    if (target.pop_refraction.VALUE == 2 || target.pop_refraction.VALUE == 3 || target.pop_refraction.VALUE == 4)
                    {
                        var     oldValue = target.target.compiler.BakedRefractionCameraOffset;
                        var     newValue = oldValue;
                        Vector2 ov;
                        r = target.DRAW_SLIDER(r, "Baking Offset", null, compilerValue: ref newValue, leftValue: 0, rightValue: 200, enable: GUI.enabled, output: out ov);
                        GUI_TOOLTIP(r, "Use this to fix artifacts near the shore, but be careful, so far as another objects can be baked als, use culling mask layers to exlude them");
                        r.y += r.height;
                        if (oldValue != newValue)
                        {
                            target.target.Undo();
                            target.target.compiler.BakedRefractionCameraOffset = newValue;
                            target.target.SetDirty();
                            target.target.m_BakeOrUpdateTexture(BakeOrUpdateType.Refraction, target.LastResolution);
                        }

                        r.y    += FastWaterModel20ControllerEditor.H;
                        venable = target.DRAW_TOGGLE(r, "Volume Calc Refr", "SKIP_REFRACTION_CALC_DEPTH_FACTOR", GUI.enabled && target.ZEnabled(), out tV) & GUI.enabled && target.ZEnabled();
                        GUI_TOOLTIP(r, "Additional calculations to give the volume to flat refraction texture");
                        r.y += 31;
                        if (venable)
                        {
                            r = target.DRAW_SLIDER(r, "Volume Factor", "_RefrDeepFactor", 16, 4096, GUI.enabled, div: 0.01f); r.y += r.height;
                        }
                    }
                    if (!target.MODE_ULTRA_FAST)
                    {
                        if (venable && !target.pop_depth.IS(FIELDS.ALLOW_MANUAL_DEPTH))
                        {
                            r.y += FastWaterModel20ControllerEditor.H;
                            target.DRAW_TOGGLE(r, "Deep Color Fine", "SKIP_ADDITIONAL_DEEP_COLOR_CALC", GUI.enabled && target.ZEnabled(), out tV);
                            GUI_TOOLTIP(r, "Additional calculations for deep color, it take double z depth texture unpacking");
                            r.y += 31;
                        }
                    }



                    if (target.MODE_ULTRA_FAST)
                    {
                        r.y += FastWaterModel20ControllerEditor.H;
                        target.d_D_Foam.LowDistortion(ref r, target);

                        r.x = 100;
                        r.y = 0;

                        r.height = FastWaterModel20ControllerEditor.H;
                        EditorGUI.HelpBox(r, "Deep Settings", MessageType.None); r.y += r.height + S;
                        r    = target.DRAW_SLIDER(r, "Z Offset", FIELDS._RefrZOffset, -30, 10, GUI.enabled); r.y += r.height + S;
                        r    = target.DRAW_SLIDER(r, "Z FallOff", FIELDS._RefrZFallOff, 1, 100, GUI.enabled); r.y += r.height + S;
                        r.y += 10;
                        r    = target.DRAW_SLIDER_WITHTOGGLE(r, "Distor ZDepth", "_RefrDistortionZ", 0, 600, GUI.enabled, "USE_ZD_DISTOR"); r.y += r.height + S;
                        target.DRAW_TOGGLE(r, "Fix Distortion", "FIX_DISTORTION", target.target.compiler.IsKeywordEnabled("USE_ZD_DISTOR")); r.y += 31;
                        r = target.DRAW_SLIDER_WITHTOGGLE(r, "Distor Texture", FIELDS._RefrDistortion, 0, 600, GUI.enabled, "USE_REFR_DISTOR"); r.y += r.height + S;



                        var haveDist = target.target.compiler.IsKeywordEnabled("USE_REFR_DISTOR") && ((target.pop_refraction.VALUE != 1) || target.pop_refraction.VALUE == 1);
                        var enen     = GUI.enabled;
                        GUI.enabled = haveDist;
                        r           = target.DRAW_SLIDER_WITHTOGGLE(r, "Low Distortion", "_RefrLowDist", 0, 1, GUI.enabled, "USE_REFR_LOW_DISTOR", div: 10); r.y += r.height + S;
                        var usezf = haveDist & target.DRAW_TOGGLE(r, "Depth to Distor", "HAS_REFR_Z_AFFECT_BUMP", haveDist); r.y += 31;
                        GUI.enabled = usezf;
                        r           = target.DRAW_SLIDER(r, null, "_TexRefrDistortFix", 0, 1, usezf, div: 100); r.y += r.height + S;
                        r.y        += FastWaterModel20ControllerEditor.H;
                        GUI.enabled = enen;
                        r.height    = FastWaterModel20ControllerEditor.H * 5;


                        var sha = target.DRAW_TOGGLE(r, "Shore Alpha Override", "SKIP_FOAM_ALPHA_OVERRIDE", usezf, out tV); r.y += 31;

                        var warningFlat = sha && !target.pop_refraction.IS(FIELDS.REFRACTION_GRABPASS) &&
                                          !target.IS_OPAQUE &&
                                          target.target.compiler.IsKeywordEnabled("FOAM_ALPHA_FLAT");
                        var oc = GUI.color;
                        target.DRAW_TOGGLE(r, "Flat Shore Alpha", "FOAM_ALPHA_FLAT", target.target.compiler.IsKeywordEnabled("UFAST_SHORE_1") && sha, out tV); r.y += 31;
                        GUI.enabled = sha;
                        EditorGUI.HelpBox(r, "Use 'Flat Shore Alpha' to fix unwanted distortions near the shore", MessageType.None); r.y += r.height + S;
                        if (warningFlat)
                        {
                            if (warningFlat && target.target.compiler.IsKeywordEnabled("UFAST_SHORE_1"))
                            {
                                GUI.color *= Color.yellow;
                            }
                            r.height = FastWaterModel20ControllerEditor.H * 8;
                            EditorGUI.HelpBox(r, "You are using flat refraction and transparent shader both, if you wanna have transparent affect the coastline you have to disable flat refraction", MessageType.None);
                            r.y += r.height;
                        }
                        GUI.enabled = enen;
                        GUI.color   = oc;

                        r.x = 200;
                        r.y = 0;


                        var usefog = target.DRAW_TOGGLE(r, "Use Deep Fog", "USE_DEPTH_FOG", target.pop_refraction.VALUE != 1) || target.pop_refraction.VALUE == 1; r.y += 31;
                        r = target.DRAW_SLIDER(r, "Top Amount", "_RefrTopAmount", 0, 16, GUI.enabled); r.y += r.height + S;
                        r = target.DRAW_COLOR(r, "Top Fog", "_RefrTopZColor", usefog, out tV, false); r.y += r.height;
                        r = target.DRAW_SLIDER(r, "Deep Amount", "_RefrDeepAmount", 0, 16, GUI.enabled); r.y += r.height + S;
                        r = target.DRAW_COLOR(r, "Deep Fog", FIELDS._RefrZColor, usefog, out tV, false); r.y += r.height;
                    }
                    else
                    {
                        r.y += FastWaterModel20ControllerEditor.H;


                        r = target.DRAW_SLIDER(r, "Amount", "_RefrAmount", 0, 16, GUI.enabled); r.y += r.height + S;
                        var desat = target.DRAW_TOGGLE(r, "DeSaturate", "DESATURATE_REFR", GUI.enabled, out tV) & GUI.enabled; r.y += 31;
                        if (desat)
                        {
                            r = target.DRAW_SLIDER(r, null, "_RefractionDesaturate", 0f, 1f, desat); r.y += r.height + S;
                        }

                        r = target.DRAW_SLIDER_WITHTOGGLE(r, "Distor ZDepth", "_RefrDistortionZ", 0, 600, GUI.enabled, "USE_ZD_DISTOR"); r.y += r.height + S;


                        r = target.DRAW_SLIDER_WITHTOGGLE(r, "Distor Texture", FIELDS._RefrDistortion, 0, 600, GUI.enabled, "USE_REFR_DISTOR"); r.y += r.height + S;
                        target.DRAW_TOGGLE(r, "Angle Distor", "ADDITIONAL_ANGLE_DISTORTION", GUI.enabled, out tV);
                        GUI_TOOLTIP(r, "Additional distortion if the camera top to water"); r.y += 31;
                        var fde = target.DRAW_TOGGLE(r, "Foam Distor", "ADDITIONAL_FOAM_DISTORTION", GUI.enabled, out tV); r.y += 31;
                        if (fde)
                        {
                            r = target.DRAW_SLIDER(r, "Amount", "ADDITIONAL_FOAM_DISTORTION_AMOUNT", 0, 50, GUI.enabled); r.y += r.height + S;
                        }

                        r.y += FastWaterModel20ControllerEditor.H;
                        DRAW_R_BLUR(ref r);


                        r.y += FastWaterModel20ControllerEditor.H;
                        target.d_D_Foam.LowDistortion(ref r, target);

                        r.x = 100;
                        r.y = 0;


                        GUI.enabled = target.pop_refraction.VALUE >= 2;
                        r.height    = FastWaterModel20ControllerEditor.H;
                        //  GUI.Label( r, "Fog" ); r.y += r.height;
                        r           = target.DRAW_SLIDER(r, "Top Fog", "_RefrTextureFog", 0, 1, GUI.enabled); r.y += r.height;
                        r           = target.DRAW_SLIDER(r, "Deep Fog", "_RefrRecover", 0, 1, GUI.enabled, inverce: true); r.y += r.height;
                        GUI.enabled = target.pop_refraction.VALUE >= 1;
                        r.height    = FastWaterModel20ControllerEditor.H;
                        GUI.Label(r, "Deep"); r.y += r.height;
                        r = target.DRAW_COLOR(r, "Top Color", "_RefrTopZColor", GUI.enabled, out tV, false); r.y += r.height;
                        r = target.DRAW_COLOR(r, "Deep Color", FIELDS._RefrZColor, GUI.enabled, out tV, false); r.y += r.height;
                        // r.height = FastWaterModel20ControllerEditor.H;
                        //EditorGUI.HelpBox( r, "Depth", MessageType.None ); r.y += r.height;
                        //target.DRAW_TOGGLE( r, "HQ Y-Depth calc", FIELDS.SKIP_Z_WORLD_CALCULATION, true, out tV ); r.y += 31;
                        r = target.DRAW_SLIDER(r, "Offset", FIELDS._RefrZOffset, -30, 10, GUI.enabled); r.y += r.height + S;
                        r = target.DRAW_SLIDER(r, "FallOff", FIELDS._RefrZFallOff, 1, 100, GUI.enabled); r.y += r.height + S;


                        //GUI_TOOLTIP( r, "Set 1 if you want the depth color not to overlap the texture" ); r.y += r.height + S;
                    }
                    target.DRAW_SPEC_DISOVE(ref r);

                    r.y += 10;
                    target.DRAW_TOGGLE(r, "Debug Depth", "REFRACTION_DEBUG", GUI.enabled); r.y          += 31;
                    target.DRAW_TOGGLE(r, "Debug Refraction", "REFRACTION_DEBUG_RGB", GUI.enabled); r.y += 31;

                    //if (!target.MODE_MINIMUM)
                    { r.y += FastWaterModel20ControllerEditor.H;
                      var rbl = target.DRAW_TOGGLE(r, "Fresnel Blend", "USE_REFRACTION_BLEND_FRESNEL", true, out tV); r.y += 31;
                      r = target.DRAW_SLIDER(r, "Amount", "_RefractionBLendAmount", 0f, 1, rbl); r.y += r.height + S;
                      target.DRAW_TOGGLE(r, "Inverse", "SKIP_REFRACTION_BLEND_FRESNEL_INVERCE", rbl, out tV); r.y += 31;
                      target.DRAW_TOGGLE(r, "Debug Blend Val", "DEBUG_REFR_BLEND", rbl); r.y += 31; }


                    if (!target.MODE_ULTRA_FAST)
                    {
                        r.y += FastWaterModel20ControllerEditor.H;

                        //////////////////////////////
                        string    FEATURE = "REFR_MASK";
                        string    tile    = "_REFR_MASK_Tile";
                        string    amount  = "_REFR_MASK_Amount";
                        string    min     = "_REFR_MASK_min";
                        string    max     = "_REFR_MASK_max";
                        string    offset  = "_REFR_MASK_offset";
                        bool      enable  = GUI.enabled;
                        POP_CLASS pop     = target.pop_refrmaskb;
                        //////////////////////////////
                        r = target.DRAW_MASK_PANEL(r, "Mask", null, FEATURE, tile, offset, amount, min, max, "REFR_MASK_DEBUG", ref enable, pop);
                        //////////////////////////////

                        r.x = 200;
                        r.y = 0;



                        GUI.enabled = target.DRAW_TOGGLE(r, "Fast Caustic", "USE_CAUSTIC", GUI.enabled, out tV); r.y += 31;
                        //r = target.DRAW_BG_TEXTURE(r, null, "_NoiseHQ", GUI.enabled, out tV, null); r.y += r.height;
                        r.height = FastWaterModel20ControllerEditor.H;

                        var og22 = GUI.enabled;
                        GUI.enabled = !target.target.compiler.IsKeywordEnabled("SKIP_C_NOISE") && GUI.enabled;
                        EditorGUI.HelpBox(r, "Noise", MessageType.None); r.y += r.height;

                        r = DRAW_GRAPHIC(r, 40, target.target.compiler.GetTexture(FIELDS._NoiseHQ) as Texture2D, GUI.enabled); r.y += r.height;

                        r = target.DRAW_VECTOR(r, "Tiling / Aspect", "_CAUSTIC_Tiling", 0.1f, 100, GUI.enabled); r.y += r.height;
                        r = target.DRAW_SLIDER(r, "Speed", "_CAUSTIC_Speed", 0, 3, GUI.enabled, div: 10); r.y += r.height;
                        r = target.DRAW_VECTOR(r, "Noise -Y / Y", "_CAUSTIC_Offset", -100f, 1000, GUI.enabled); r.y += r.height;
                        // r.height = FastWaterModel20ControllerEditor.H * 2;
                        //  EditorGUI.HelpBox(r, "Green Y offset Red X offset", MessageType.None); r.y += r.height;
                        target.DRAW_TOGGLE(r, "Debug Noise", "DEBUG_CAUSTIC_NOISE", GUI.enabled, out tV); r.y += 31;
                        GUI.enabled = og22;

                        var oldT = target.target.compiler.GetVector("_CAUSTIC_Offset").z;
                        r = target.DRAW_VECTOR(r, "Noise Affect", "_CAUSTIC_Offset", 0, 2, GUI.enabled, true, 1, div: 100); r.y += r.height;
                        var newT = target.target.compiler.GetVector("_CAUSTIC_Offset").z;
                        if (oldT != newT && (oldT == 0 || newT == 0))
                        {
                            target.target.Undo();
                            if (newT == 0)
                            {
                                target.target.compiler.EnableKeyword("SKIP_C_NOISE");
                            }
                            else
                            {
                                target.target.compiler.DisableKeyword("SKIP_C_NOISE");
                            }
                            target.target.SetDirty();
                        }


                        r        = target.DRAW_BG_TEXTURE(r, null, "_CAUSTIC_MAP", GUI.enabled, out tV, null); r.y += r.height;
                        r        = target.DRAW_VECTOR(r, "Tiling X / Y", "_CAUSTIC_Tiling", 0.1f, 1000, GUI.enabled, true); r.y += r.height;
                        r.height = FastWaterModel20ControllerEditor.H;
                        EditorGUI.HelpBox(r, "Placement", MessageType.None); r.y += r.height;
                        target.pop_caustintop.DrawPop(null, r); r.y += r.height;
                        r = target.DRAW_SLIDER(r, "Amount", "_CAUSTIC_FOG_Amount", 0, 50, GUI.enabled, div: 10); r.y += r.height;
                        r = target.DRAW_SLIDER(r, "Pow", "_CAUSTIC_FOG_Pow", 1, 50, GUI.enabled); r.y += r.height;
                        target.DRAW_TOGGLE(r, "Colorize", "USE_COLOR_CAUSTIC", GUI.enabled, out tV); r.y += 31;
                        target.DRAW_TOGGLE(r, "Fix Y Lines", "USE_FIXV_CAUSTIC", GUI.enabled, out tV);
                        GUI_TOOLTIP(r, "You may use this little fix, to improve drawing along Y axe");
                        r.y += 31;

                        r.height = FastWaterModel20ControllerEditor.H;
                        EditorGUI.HelpBox(r, "Effect", MessageType.None); r.y += r.height;
                        target.pop_causteffect.DrawPop(null, r); r.y          += r.height;
                        if (target.pop_causteffect.VALUE == 1)
                        { //var cblur = target.DRAW_TOGGLE(r, "Blur", "C_BLUR", GUI.enabled, out tV) & GUI.enabled; r.y += 31;
                            r = target.DRAW_SLIDER(r, "Blur Radius", "_C_BLUR_R", 0, 0.2f, true, div: 1000); r.y += r.height;
                        }
                        else if (target.pop_causteffect.VALUE == 2)
                        {
                            r = target.DRAW_SLIDER(r, "Anim Speed", "_C_BLUR_S", 0, 3f, true, div: 100); r.y += r.height;
                        }

                        // r = target.DRAW_SLIDER(r, "Tiling", "_CAUSTIC_Tiling", 0.01f, 100, GUI.enabled); r.y += r.height;
                        //   r = target.DRAW_VECTOR(r, "Offset", "_CAUSTIC_Offset", -100f, 100, GUI.enabled,true,1); r.y += r.height;

                        /*
                         * r = target.DRAW_VECTOR(r, "Tiling X / Y", "_CAUSTIC_PROC_Tiling", 0.1f, 1000, GUI.enabled, true); r.y += r.height;
                         * r = target.DRAW_SLIDER(r, "Speed", "_CAUSTIC_PROC_GlareSpeed", 0, 10, GUI.enabled, div: 10); r.y += r.height;
                         * r = target.DRAW_DOUBLEFIELDS(r, "Min/Max", new[] { "_CAUSTIC_PROC_Contrast", "_CAUSTIC_PROC_BlackOffset" }, new[] { -1, -1f }, new[] { 1f, 1 }, GUI.enabled); r.y += r.height + S;
                         */

                        target.DRAW_TOGGLE(r, "Debug Caustic", "DEBUG_CAUSTIC", GUI.enabled, out tV); r.y += 31;
                    }



                    if (target.MODE_ULTRA_FAST)
                    {
                        r.x = 300;
                        r.y = 0;
                    }
                    else
                    {
                        r.y += FastWaterModel20ControllerEditor.H;
                    }

                    DRAW_R_BLUR(ref r);


                    if (!target.MODE_ULTRA_FAST)
                    {
                        r.x = 300;
                        r.y = 0;
                        // GUI.enabled = foam_enable;

                        target.DRAW_RRBLEND(r);
                    }

                    //r.height = FastWaterModel20ControllerEditor.H;
                    // GUI.Label( r, "Settings" ); r.y += r.height;



                    if (target.pop_depth.VALUE != 0)
                    { //if (target.pop_depth.IS( FIELDS.ALLOW_MANUAL_DEPTH )) {
                      //r = target.DRAW_IMMRESED_WATER( r );
                      // r.height = FastWaterModel20ControllerEditor.H * 6;
                      // EditorGUI.HelpBox( r, "If you have accuracy problems with the foam near the shoreю Try to change ZDepth settings", MessageType.None );
                    }
                }

                GUI.enabled  = og;
                LAST_GROUP_R = Rect.zero;
                GUI.EndGroup();
            }
Exemple #5
0
            override public void Draw(Rect input, out Vector2[] output)
            {
                output = new Vector2[1];
                if (!target.target.compiler || !target.target.compiler.material)
                {
                    return;
                }

                for (int i = 0; i < output.Length; i++)
                {
                    output[i] = Vector2.zero;
                }
                LAST_GROUP_R = new Rect(input.x, input.y, input.width, target.MENU_CURRENT_HEIGHT());
                GUI.BeginGroup(LAST_GROUP_R);
                var r  = new Rect(0, 0, BOTTOM_W * 1.333333f, 0);
                var og = GUI.enabled;



                // r.y += 10;


                GUI.enabled = target.DRAW_TOGGLE(r, "ZDepth Colorize", "USE_lerped_post", true, out tV); r.y += 31;
                target.DRAW_TOGGLE(r, "Use Deep Z Depth", "lerped_post_USE_depthZ", GUI.enabled, out tV); r.y += 31;

                r = target.DRAW_SLIDER(r, "Offset", "lerped_post_offset", -80, 80, GUI.enabled); r.y += r.height;
                r = target.DRAW_SLIDER(r, "Fallof", "lerped_post_offset_falloff", 0, 80, GUI.enabled); r.y += r.height;
                target.DRAW_TOGGLE(r, "Debug Offset", "lerped_post_Debug", GUI.enabled, out tV); r.y += 31;
                var oe = GUI.enabled;
                var c1 = target.DRAW_TOGGLE(r, "Color A", "USE_lerped_post_Color_1", oe, out tV) && oe; r.y += 31;

                GUI.enabled = c1;
                r.height    = FastWaterModel20ControllerEditor.H;
                target.pop_zcolorize1.DrawPop(null, r); r.y += r.height;
                r = target.DRAW_COLOR(r, null, "lerped_post_color1", GUI.enabled, out tV, false); r.y += r.height;

                var c2 = target.DRAW_TOGGLE(r, "Color B", "USE_lerped_post_Color_2", oe, out tV) && oe; r.y += 31;

                GUI.enabled = c2;
                r.height    = FastWaterModel20ControllerEditor.H;
                target.pop_zcolorize2.DrawPop(null, r); r.y += r.height;
                r = target.DRAW_COLOR(r, null, "lerped_post_color2", GUI.enabled, out tV, false); r.y += r.height;

                GUI.enabled = true;

                r.y += FastWaterModel20ControllerEditor.H;


                var ent = target.DRAW_TOGGLE(r, "Texture Colorize", "POST_TEXTURE_TINT", true, out tV); r.y += 31;

                GUI.enabled = ent;


                /*  var foam = false;
                 * if (target.MODE_ULTRA_FAST)foam =  target.DRAW_TOGGLE(r, "Use Foam Texture", "POST_FOAM_TEXTURE", GUI.enabled, out tV) && GUI.enabled; r.y += 31;
                 * var own =  target.DRAW_TOGGLE(r, "Use Own Texture", "POST_OWN_TEXTURE", !foam && GUI.enabled, out tV) && !foam && GUI.enabled; r.y += 31;
                 * GUI.enabled = ent;
                 * if (foam) { r = target.DRAW_BG_TEXTURE(r, null, "_ShoreWavesGrad", foam, out tV, null); r.y += r.height; }
                 * else if (own) { r = target.DRAW_BG_TEXTURE(r, null, "_MM_Texture", own, out tV, null); r.y += r.height; }
                 * else { r = DRAW_GRAPHIC(r, 40, target.target.compiler.GetTexture(FIELDS._MainTex) as Texture2D, GUI.enabled, null); r.y += r.height; }*/


                string[]  texture          = new[] { "_MainTex", "_UF_NMASK_Texture", "_ShoreWavesGrad", "_MM_Texture" };
                POP_CLASS texture_SWITCHER = target.pop_postTExtureSwitcher;
                POP_CLASS pop_channel      = target.pop_postTextureChannel;
                bool      enable           = GUI.enabled;

                //////////////////////////////
                r = target.DrawTextureWIthChannelAndSwitcher(r, GUI.enabled, texture, texture_SWITCHER, pop_channel);



                /*r.height = FastWaterModel20ControllerEditor.H;
                 * target.pop_mmchannel.DrawPop(null, r); r.y += r.height;*/
                r = target.DRAW_VECTOR(r, "Tile X/Y", "_MM_Tile", 0, 10000, GUI.enabled, div: 100); r.y += r.height;
                r = target.DRAW_VECTOR(r, "Offset X/Y", "_MM_offset", 0, 10000, GUI.enabled, div: 100); r.y += r.height;

                r.height = FastWaterModel20ControllerEditor.H;
                target.pop_mmcolorize.DrawPop(null, r); r.y += r.height;
                if (target.pop_mmcolorize.VALUE == 2)
                {
                    r = target.DRAW_SLIDER(r, "Multy Offset", "_MM_MultyOffset", 0, 1, GUI.enabled); r.y += r.height;
                }
                r = target.DRAW_COLOR(r, "Color", "_MM_Color", GUI.enabled, out tV, false); r.y += r.height;


                GUI.enabled = true;

                /*  GUI.enabled = true;
                 * var use_sg = GUI.enabled = target.DRAW_TOGGLE(r, "Surface Gradient", "USE_SURFACE_GRADS", GUI.enabled, out tV); r.y += 31;
                 * r = target.DRAW_SLIDER(r, "Offset Top", "_WaveGradTopOffset", 0, 100, GUI.enabled); r.y += r.height;
                 * target.DRAW_TOGGLE(r, "Debug Gradient", "DEBUG_TOP_GRAD", use_sg, out tV); r.y += 31;
                 * r = target.DRAW_COLOR(r, null, "_WaveGrad0", use_sg, out tV, false); r.y += r.height;
                 * r = target.DRAW_COLOR(r, null, "_WaveGrad1", use_sg, out tV, false); r.y += r.height;
                 * r = target.DRAW_COLOR(r, null, "_WaveGrad2", use_sg, out tV, false); r.y += r.height;
                 * r = target.DRAW_SLIDER(r, "Offset Mid", "_WaveGradMidOffset", 0, 1, GUI.enabled); r.y += r.height;
                 *
                 */

                GUI.enabled = true;



                r.y += 10;
                r.x += r.width + 14;
                r.y  = 0;

                GUI.enabled = og;
                GUI.enabled = target.DRAW_TOGGLE(r, "images_postrize", "POSTRIZE", true, out tV); r.y += 31;
                r           = target.DRAW_SLIDER(r, "Posterize", "POSTRIZE_Colors", 1, 24, GUI.enabled); r.y += r.height;
                GUI.enabled = og;


                r.y += FastWaterModel20ControllerEditor.H;



                GUI.enabled = target.DRAW_TOGGLE(r, "Convert Colors", "USE_OUTPUT_GRADIENT", true, out tV); r.y += 31;
                target.DRAW_TOGGLE(r, "images_cc", null, GUI.enabled, out tV); r.y += 31;
                r.height = FastWaterModel20ControllerEditor.H;
                //EditorGUI.HelpBox( r, "Utils (RGB:y>0.5)", MessageType.None ); r.y += r.height;
                r = target.DRAW_BG_TEXTURE(r, "Gradient Texture", "_GradTexture", GUI.enabled, out tV, null); r.y += r.height;
                // r = DRAW_GRAPHIC( r, 40, target.target.material.GetTexture( FIELDS._Utility ) as Texture2D, GUI.enabled, new Color( 1, 1, 1, 1 ), YUP: 0.5f ); r.y += r.height;

                r.height = FastWaterModel20ControllerEditor.H;
                target.pop_gradientoutput.DrawPop(null, r); r.y           += r.height;
                EditorGUI.HelpBox(r, "Blend Mode", MessageType.None); r.y += r.height;
                target.pop_outputblend.DrawPop(null, r); r.y += r.height;
                r = target.DRAW_SLIDER(r, "Blend", "_OutGradBlend", 0, 1, GUI.enabled); r.y += r.height;
                if (target.pop_outputblend.VALUE != 2)
                {
                    if (target.__pop_depth != null && target.__pop_depth.VALUE == 0)
                    {
                        r.height = FastWaterModel20ControllerEditor.H * 3;
                        EditorGUI.HelpBox(r, "Request ZDepth", MessageType.Error); r.y += r.height;
                    }
                    r = target.DRAW_SLIDER(r, "ZDepth Affect", "_OutGradZ", 1, 100, GUI.enabled); r.y += r.height;
                }

                if (target.pop_outputblend.VALUE != 0)
                {
                    var fhl = target.DRAW_TOGGLE(r, "Fix Highlights", "FIX_HL", GUI.enabled, out tV) & GUI.enabled; r.y += 31;
                    if (fhl)
                    {
                        r = target.DRAW_SLIDER(r, "Clamp Value", "_FixHLClamp", 0.1f, 1, fhl); r.y += r.height;
                    }
                }


                /*GUI.enabled = target.DRAW_TOGGLE(r, "Additional Shadows", "USE_OUTPUT_SHADOWS", GUI.enabled, out tV); r.y += 31;
                 * if (GUI.enabled) r = target.DRAW_SLIDER(r, "Amount", "_OutShadowsAmount", 0, 2, GUI.enabled); r.y += r.height;*/

                GUI.enabled = og;



                r.y += FastWaterModel20ControllerEditor.H;

                GUI.enabled = target.DRAW_TOGGLE(r, "images_rim", "RIM", true, out tV); r.y += 31;
                r           = target.DRAW_BG_TEXTURE(r, "Gradient", "_RimGradient", GUI.enabled, out tV, null); r.y += r.height;
                r           = target.DRAW_SLIDER_WITHTOGGLE(r, "Blend", "_RIM_BLEND", 0, 1, GUI.enabled, "USE_RIM_BLEND"); r.y += r.height;
                r.height    = FastWaterModel20ControllerEditor.H * 2;
                if (target.target.compiler.IsKeywordEnabled("SKIP_FRESNEL_CALCULATION"))
                {
                    EditorGUI.HelpBox(r, "Fresnel Disabled", MessageType.None);
                }
                else
                {
                    EditorGUI.HelpBox(r, "Using Fresnel Channel", MessageType.None);
                }
                r.y += r.height;
                r    = target.DRAW_SLIDER(r, "Rim Blend", "RIM_Plus", 0, 1, GUI.enabled, div: 100); r.y += r.height;
                r    = target.DRAW_SLIDER(r, "Rim Pow", "RIM_Minus", 0, 256, GUI.enabled); r.y += r.height;
                //  target.DRAW_TOGGLE(r, "Inverse", "RIM_INVERSE", GUI.enabled, out tV); r.y += 31;
                target.DRAW_TOGGLE(r, "Shore Affect", "RIM_SCHORE_SKIP", GUI.enabled, out tV); r.y += 31;


                target.DRAW_TOGGLE(r, "Rim Debug", "RIM_DEBUG", GUI.enabled, out tV); r.y += 31;

                GUI.enabled = true;

                r.y += 10;
                r.x += r.width + 14;
                r.y  = 0;

                GUI.enabled = target.target.compiler.IsKeywordEnabled("USE_SHADOWS") && target.IS_OPAQUE;
                target.DRAW_TOGGLE(r, "Shadows", null, GUI.enabled, out tV); r.y += 31;
                r           = target.DRAW_SLIDER(r, "Shadows Amount", "_ShadorAmount", 0, 1, GUI.enabled); r.y += r.height;
                GUI.enabled = true;

                r.y     += FastWaterModel20ControllerEditor.H;
                r.height = FastWaterModel20ControllerEditor.H * 3;
                EditorGUI.HelpBox(r, "Is case, if you don't use fullscreen effects, you may apply LUT gradient here", MessageType.None); r.y += r.height;
                GUI.enabled = target.DRAW_TOGGLE(r, "Use LUT's", "USE_LUT", GUI.enabled, out tV); r.y += 31;
                r           = target.DRAW_BG_TEXTURE(r, null, "_Lut2D", GUI.enabled, out tV, null); r.y += r.height;
                if (GUI.enabled)
                {
                    var t = target.target.compiler.GetTexture("_Lut2D");
                    if (!t)
                    {
                        t = ASSIGN_LUT();
                        if (t)
                        {
                            target.target.Undo();
                            target.target.compiler.SetTexture("_Lut2D", t);
                            target.target.SetDirty();
                        }
                    }
                    if (t)
                    {
                        var tp = new Vector4(1f / t.width, 1f / t.height, t.height - 1f, 0);
                        if (tp != target.target.compiler.GetVector("_Lut2D_params"))
                        {
                            target.target.Undo();
                            target.target.compiler.SetVector("_Lut2D_params", tp);
                            target.target.SetDirty();
                        }
                    }
                }


                r = target.DRAW_SLIDER(r, "Amount", "_LutAmount", 0, 1, GUI.enabled); r.y += r.height;
                target.DRAW_TOGGLE(r, "HQ Mode", "LUT_HQ_MODE", GUI.enabled, out tV); r.y           += 31;
                target.DRAW_TOGGLE(r, "Fix Overexposure", "FIX_OVEREXPO", GUI.enabled, out tV); r.y += 31;
                r.height = FastWaterModel20ControllerEditor.H * 3;
                EditorGUI.HelpBox(r, "Enable Fix if there're wrong colors near the overexposured pixels", MessageType.None);



                GUI.enabled  = og;
                LAST_GROUP_R = Rect.zero;
                GUI.EndGroup();
            }
Exemple #6
0
            bool DrawShore(ref Rect r, int index)
            {
#pragma warning disable
                string _ShoreWavesGrad = "_ShoreWavesGrad";
                // string _UFSHORE_Texture_1 = "_UFSHORE_Texture_" + index;

                string _UFSHORE_Amount_1     = "_UFSHORE_Amount_" + index;
                string _UFSHORE_Color_1      = "_UFSHORE_Color_" + index;
                string _UFSHORE_Length_1     = "_UFSHORE_Length_" + index;
                string _UFSHORE_Tile_1       = "_UFSHORE_Tile_" + index;
                string _UFSHORE_Distortion_1 = "_UFSHORE_Distortion_" + index;

                string _UFSHORE_Speed1     = "_UFSHORE_Speed_" + index;
                string _UFSHORE_ShadowV1_1 = "_UFSHORE_ShadowV1_" + index;
                string _UFSHORE_ShadowV2_1 = "_UFSHORE_ShadowV2_" + index;
                //string NEED_SHORE_WAVES_UNPACK = "NEED_SHORE_WAVES_UNPACK";
                //string _FoamLShoreWavesTileY_SW = "_FoamLShoreWavesTileY_SW";
                //string _FoamDistortionFade_SW = "_FoamDistortionFade_SW";
                string _UFSHORE_AlphaAmount_1 = "_UFSHORE_AlphaAmount_" + index;
                string _UFSHORE_AlphaMax_1    = "_UFSHORE_AlphaMax_" + index;
                //string _FoamTextureTiling_SW = "_FoamTextureTiling_SW";
                //string _FoamWavesSpeed_SW = "_FoamWavesSpeed_SW";
                //string _FoamDirection_SW = "_FoamDirection_SW";
                //string _FoamTexture_SW = "_FoamTexture_SW";
#pragma warning restore

                target.DRAW_TOGGLE(r, "images_shorefoam", null, true, out tV); r.y += 31;

                var waves_enable = target.DRAW_TOGGLE(r, "Use Shore " + index, "UFAST_SHORE_" + index, true, out tV); r.y += 31;
                var og           = GUI.enabled;
                GUI.enabled = waves_enable;
                var oc = GUI.color;
                GUI.color *= new Color32(234, 255, 235, 255);
                var hasAddPass = target.DRAW_TOGGLE(r, "Second Z Pass", "SKIP_SECOND_DEPTH_" + index, waves_enable, out tV) && waves_enable; r.y += 31;
                GUI.color = oc;
                // target.DRAW_TOGGLE(r, "Debug Z Pass " + index, "DEGUB_Z_SHORE_" + index, waves_enable); r.y += 31;


                r.y += FastWaterModel20ControllerEditor.H;

                //   r = target.DRAW_SLIDER(r, "Length", _UFSHORE_Length_1, 0.001, hasAddPass ? 1 : 50, waves_enable); r.y += r.height;
                r = target.DRAW_SLIDER(r, "Length", _UFSHORE_Length_1, 0.000001f, hasAddPass ? 1 : 50, waves_enable); r.y += r.height;
                r = target.DRAW_COLOR(r, "Color", _UFSHORE_Color_1, waves_enable, out tV, false); r.y += r.height;
                r = target.DRAW_SLIDER(r, "Amount", _UFSHORE_Amount_1, 0, 1000f, waves_enable); r.y += r.height;
                r = target.DRAW_SLIDER(r, "Normal Distor", _UFSHORE_Distortion_1, 0, 1000f, waves_enable);
                GUI_TOOLTIP(r, @"- depends on the normals'"); r.y += r.height;
                // r = target.DRAW_SLIDER(r, "Vertex Y Distortion", , 0, 100f, waves_enable); r.y += r.height;
                r = target.DRAW_SLIDER_WITHTOGGLE(r, "Vertex Distor", "VERTEX_H_DISTORT", 0, 10, waves_enable, "USE_VERTEX_H_DISTORT", div: 10);
                GUI_TOOLTIP(r, @"- depends on the y vertices pos'"); r.y += r.height;


                //  r.y += FastWaterModel20ControllerEditor.H;
                r.height = FastWaterModel20ControllerEditor.H;
                EditorGUI.HelpBox(r, "Shore Alpha", MessageType.None); r.y += r.height;
                r = target.DRAW_DOUBLEFIELDS(r, "Grow/Shrink", new[] { _UFSHORE_AlphaAmount_1, _UFSHORE_AlphaMax_1 }, new[] { 0.01f, 0f }, new[] { 1, 1f }, waves_enable); r.y += r.height;
                //r = target.DRAW_SLIDER(r, "Fade Offset", "_FoamMaskOffset_SW", 0, 1f, waves_enable); r.y += r.height + S;

                var vol = !target.target.compiler.IsKeywordEnabled("SKIP_REFRACTION_CALC_DEPTH_FACTOR");


                target.DRAW_TOGGLE(r, "Flat Shore Alpha", "FOAM_ALPHA_FLAT", waves_enable && vol && LastHaveMask_ZDepth, out tV);
                GUI_TOOLTIP(r, @"- You can turn this on if you use a 'Baked Refraction Texture'.
- If the option is turned on, next to the shore in the places where the waves began to splash, the shore 'Baked Texture' will be flat, if you use 'Volume Calc For Refraction', this is necessary to avoid a visual gap between the waves and the virtual depth");
                r.y += 31;
                target.DRAW_TOGGLE(r, "Alpha as Transparent", "APPLY_FOAM_OUTALPHA_" + index, waves_enable && !target.target.compiler.IS_OPAQUE, out tV); r.y += 31;

                r.y += FastWaterModel20ControllerEditor.H;
                var ushh = target.DRAW_TOGGLE(r, "Drop Shadows", "SHORE_SHADDOW_" + index, waves_enable) & waves_enable; r.y += 31;
                r = target.DRAW_SLIDER(r, "Color Offset", _UFSHORE_ShadowV1_1, 0, 100f, ushh); r.y += r.height;
                r = target.DRAW_SLIDER(r, "Alpha Offset", _UFSHORE_ShadowV2_1, -100, 100f, ushh); r.y += r.height;


                r.height = FastWaterModel20ControllerEditor.H;
                //  EditorGUI.HelpBox(r, "Shore Waves", MessageType.None);
                r.y += r.height;

                r.y = 0;
                r.x = 100;

                r.y += 31;
                r.y += 31;
                r.y += 31;
                r.y += FastWaterModel20ControllerEditor.H;

                var use_tex = target.DRAW_TOGGLE(r, "Use Texture", "SKIP_UNWRAP_TEXTURE", waves_enable) & waves_enable; r.y += 31;
                // r = target.DRAW_BG_TEXTURE(r, null, _ShoreWavesGrad, waves_enable, out tV, null); r.y += r.height;
                GUI.enabled = use_tex;

                string[]  texture          = new[] { "_ShoreWavesGrad", "_UF_NMASK_Texture", FIELDS._MainTex };
                POP_CLASS texture_SWITCHER = target.pop_shoreTExtureSwitcher;
                POP_CLASS pop_channel      = target.pop_shoreTextureChannel;
                bool      enable           = GUI.enabled;
                //////////////////////////////
                r = target.DrawTextureWIthChannelAndSwitcher(r, use_tex, texture, texture_SWITCHER, pop_channel);


                GUI.enabled = use_tex;
                r           = target.DRAW_SLIDER(r, "Transparency", "_UFSHORE_UNWRAP_Transparency", -1, 1f, use_tex); r.y += r.height;
                r           = target.DRAW_SLIDER_WITHTOGGLE(r, "Low Distortion", "_UFSHORE_UNWRAP_LowDistortion_1", 0, 10, use_tex, "_UFSHORE_UNWRAP_Low", div: 10); r.y += r.height;

                if (!target.MODE_MINIMUM)
                {
                    r.height = FastWaterModel20ControllerEditor.H;
                    EditorGUI.HelpBox(r, "Unwrap", MessageType.None); r.y += r.height;
                    target.pop_shoreunwrap.DrawPop(null, r); r.y          += r.height;

                    if (target.__pop_shoreunwrap.VALUE == 1)
                    {
                        EditorGUI.HelpBox(r, "Mode", MessageType.None); r.y += r.height;
                        target.pop_unrapmove.DrawPop(null, r); r.y          += r.height;

                        //  r = target.DRAW_SLIDER(r, "Waves Tile", _UFSHORE_Tile_1, 0.00001f, 2000, waves_enable); r.y += r.height;
                        r = target.DRAW_VECTOR(r, "Waves Tile", _UFSHORE_Tile_1, 0.00001f, 2000, use_tex, false, 1); r.y += r.height;
                    }
                    else
                    {
                        r = target.DRAW_VECTOR(r, "Waves Tile", _UFSHORE_Tile_1, 0.00001f, 2000, use_tex); r.y += r.height;
                    }

                    r.height = FastWaterModel20ControllerEditor.H;
                    EditorGUI.HelpBox(r, "X Animation", MessageType.None); r.y += r.height;
                    target.pop_shorexanim.DrawPop(null, r); r.y += r.height;
                    if (target.pop_shorexanim.VALUE == 1)
                    {
                        r = target.DRAW_SLIDER(r, "Speed", _UFSHORE_Speed1, 0, 100f, use_tex); r.y += r.height;
                    }
                }
                else
                {
                    r = target.DRAW_VECTOR(r, "Waves Tile", _UFSHORE_Tile_1, 0.00001f, 2000, use_tex); r.y += r.height;
                }

                // target.DRAW_TOGGLE(r, "Y Sin Wiggle", "SHORE_ANIM_YSIN_" + index, use_tex); r.y += 31;
                GUI.enabled = waves_enable;

                r.y += FastWaterModel20ControllerEditor.H;
                var usewaves_Gradient = target.DRAW_TOGGLE(r, "Waves Gradient", "SHORE_USE_WAVES_GRADIENT_" + index, waves_enable) & waves_enable; r.y += 31;
                GUI.enabled = usewaves_Gradient;
                r           = DRAW_GRAPHIC(r, 40, target.target.compiler.GetTexture(FIELDS._Utility) as Texture2D, usewaves_Gradient, null); r.y += r.height;
                r           = target.DRAW_DOUBLEFIELDS(r, "Waves Tile", new[] { "MAIN_TEX_FoamGradTile_1", "MAIN_TEX_FoamGradTileYYY_1" }
                                                       , new[] { 0.0001f, 0f }, new[] { 100, 100f }, usewaves_Gradient, firstDiv: 10, seconddiv: 10); r.y += r.height;
                // r = target.DRAW_SLIDER(r, "Waves Tile", "MAIN_TEX_FoamGradTile_1", 0, 100f, usewaves_Gradient, div: 10); r.y += r.height;
                r        = target.DRAW_SLIDER(r, "Speed", "MAIN_TEX_FoamGradWavesSpeed_1", 0, 100f, usewaves_Gradient, div: 100); r.y += r.height;
                r        = target.DRAW_SLIDER_WITHTOGGLE(r, "Low Distortion", "_UFSHORE_LowDistortion_" + index, 0, 10, usewaves_Gradient, "SHORE_USE_LOW_DISTORTION_" + index); r.y += r.height;
                r.height = FastWaterModel20ControllerEditor.H;
                EditorGUI.HelpBox(r, "Direction", MessageType.None); r.y += r.height;
                r = target.DIRECTION(r, "MAIN_TEX_FoamGradDirection_1", usewaves_Gradient, VECTOR: false, leftClamp: -1f, rightClamp: 1f); r.y += r.height;
                // target.DRAW_TOGGLE(r, "Global Direction", "SHORE_USE_GLOB_DIR_" + index, usewaves_Gradient, out tV) ; r.y += 31;
                GUI.enabled = waves_enable;


                r.y = 0;
                r.x = 200;

                r.y += 31;
                r.y += 31;
                r.y += 31;
                r.y += FastWaterModel20ControllerEditor.H;


                if (!target.MODE_MINIMUM)
                {
                    var useac = target.DRAW_TOGGLE(r, "Additional Contour", "SHORE_USE_ADDITIONALCONTUR_" + index, waves_enable, out tV) & waves_enable; r.y += 31;
                    GUI.enabled = useac;
                    r           = target.DRAW_SLIDER(r, "Length", "_UFSHORE_ADDITIONAL_Length_1", 0.00001f, 100f, useac); r.y += r.height;
                    target.DRAW_TOGGLE(r, "Inverse Length", "SHORE_ADDITIONALCONTUR_INVERSE", useac, out tV); r.y += 31;
                    //target.DRAW_TOGGLE(r, "Separate Pass", "SHORE_USE_ADDITIONALCONTUR_SEPARATE", useac, out tV) ; r.y += 31;
                    var lp = target.DRAW_TOGGLE(r, "Length Pow", "SHORE_USE_ADDITIONALCONTUR_POW_1", useac, out tV) & useac; r.y += 31;
                    if (lp)
                    {
                        r = target.DRAW_SLIDER(r, null, "SHORE_USE_ADDITIONALCONTUR_POW_Amount_1", 0, 100f, useac); r.y += r.height;
                    }
                    r.height = FastWaterModel20ControllerEditor.H;
                    EditorGUI.HelpBox(r, "Texture", MessageType.None); r.y += r.height;
                    target.pop_add_texturetype.DrawPop(null, r); r.y       += r.height;
                    r        = DRAW_GRAPHIC(r, 40, target.target.compiler.GetTexture(target.pop_add_texturetype.VALUE == 0 ? FIELDS._MainTex : _ShoreWavesGrad) as Texture2D, useac, null); r.y += r.height;
                    r.height = FastWaterModel20ControllerEditor.H;
                    EditorGUI.HelpBox(r, "Channel", MessageType.None); r.y += r.height;
                    target.pop_add_texturechannel.DrawPop(null, r); r.y    += r.height;

                    //r = target.DRAW_VECTOR(r, "Tex Tile", "_UFSHORE_ADD_Tile_1", 0.00001f, 100, useac, div: 10); r.y += r.height;
                    r = target.DRAW_SLIDER(r, "Tex Tile", "_UFSHORE_ADD_Tile_1", 0, 100f, useac, div: 10); r.y += r.height;
                    // r = target.DRAW_COLOR(r, "Color", "_UFSHORE_ADD_Color_1", useac, out tV, false); r.y += r.height;
                    r = target.DRAW_SLIDER(r, "Amount", "_UFSHORE_ADD_Amount_1", 0, 100f, useac); r.y += r.height;
                    target.DRAW_TOGGLE(r, "No Coast Line", "SKIP_SHORE_ADDITIONALCONTUR_USE_Z", useac, out tV); r.y += 31;

                    r = target.DRAW_SLIDER(r, "Distortion", "_UFSHORE_ADD_Distortion_1", 0, 100f, useac); r.y += r.height;
                    r = target.DRAW_SLIDER(r, "Low Distortion", "_UFSHORE_ADD_LowDistortion_1", 0, 10f, useac); r.y += r.height;
                }


                //  r = target.DRAW_DOUBLEFIELDS(r, "Waves Tile", new[] { _FoamLShoreWavesTileX_SW, _FoamLShoreWavesTileY_SW }, new[] { 0.00001f, 0.00001f }, new[] { 25, 25f }, waves_enable, firstDiv: 10, seconddiv: 10); r.y += r.height;
                // r = target.DRAW_DOUBLEFIELDS(r, "Amount/Speed", new[] { _FoamAmount_SW, _FoamWavesSpeed_SW }, new[] { 0f, 0f }, new[] { 100, 10f }, waves_enable); r.y += r.height + S;

                // if (target.target.compiler.GetFloat(_FoamWavesSpeed_SW) == 0) { r = target.DRAW_SLIDER(r, "Offset", "_FoamOffset", 0, 1f, waves_enable); r.y += r.height + S; }

                GUI.enabled = og;



                return(hasAddPass);
            }
Exemple #7
0
        public Rect DRAW_MASK_PANEL(Rect r, string name, string help, string FEATURE,
                                    string tile,
                                    string offset,
                                    string amount,
                                    string min,
                                    string max,
                                    string maskDebug,
                                    ref bool enable,
                                    POP_CLASS pop, Vector2?amountClamp = null)
        {
            if (!target.compiler.material)
            {
                return(r);
            }

            amountClamp = amountClamp ?? new Vector2(0, 5);

            var S       = 0;
            var usemask = DRAW_TOGGLE(r, name, FEATURE, enable, out tV) & enable;

            var oc = GUI.color;

            GUI.color *= new Color32(255, 255, 211, 255);

            r.y += 31;
            if (help != null)
            {
                var h = EditorStyles.helpBox.CalcHeight(new GUIContent(help), r.width);
                r.height = h;
                EditorGUI.HelpBox(r, help, MessageType.None); r.y += r.height;
            }

            var og = GUI.enabled;

            GUI.enabled = usemask;
            enable      = usemask;
            string maskTexture;


            maskTexture = FIELDS._MainTex;

            Color c = new Color(1, 0, 0, 0);

            if (pop != null)
            {
                r.height = FastWaterModel20ControllerEditor.H * 2;
                EditorGUI.HelpBox(r, "Used MainTexture", MessageType.None);
                r.y     += r.height;
                r.height = FastWaterModel20ControllerEditor.H;
                pop.DrawPop(null, r); r.y += r.height;
                c = GET_COLOR(pop.VALUE);
            }
            else
            {
                r.height = FastWaterModel20ControllerEditor.H * 2;
                EditorGUI.HelpBox(r, "Used MainTexture (R)", MessageType.None); r.y += r.height;
            }
            r = DRAW_GRAPHIC(r, 40, target.compiler.GetTexture(maskTexture) as Texture2D, usemask, c); r.y += r.height;
            // r = DRAW_SLIDER( r, "Tile XY", tile, 0, 2, usemask ); r.y += r.height + S;
            //  r = DRAW_SLIDER( r, "Mask Amount", amount, amountClamp.Value.x, amountClamp.Value.y, usemask ); r.y += r.height + S;
            r    = DRAW_DOUBLEFIELDS(r, "Amount/Tile", new[] { amount, tile }, new[] { amountClamp.Value.x, 0f }, new[] { amountClamp.Value.y, 5 }, usemask, new Color32(255, 230, 180, 255), 10, seconddiv: 10);
            r.y += r.height + S;
            r    = DRAW_VECTOR(r, "Offset X/Y", offset, -20, 20, enable, div: 100); r.y += r.height + S;
            r    = DRAW_DOUBLEFIELDS(r, "Min/Max", new[] { min, max }, new[] { -1, 0.0f }, new[] { 2f, 10 }, usemask); r.y += r.height + S;

            DRAW_TOGGLE(r, "Debug Mask", maskDebug, enable, out tV);
            r.y += 31;



            GUI.enabled = og;

            GUI.color = oc;
            return(r);
            //r = target.DRAW_SLIDER( r, "Mask Clamp", FIELDS._ReflectionMask_UpClamp, 0.5f, 10, usemask ); r.y += r.height + S;
        }
Exemple #8
0
            void DRAW_ADVANCE_MODE(ref Rect r)
            {
                GUI.enabled = true;
                GUI.enabled = target.DRAW_TOGGLE(r, "Surface Foam", "SKIP_SURFACE_FOAMS", GUI.enabled, out tV); r.y += 31;
                target.DRAW_TOGGLE(r, "images_surfacefoam", null, true, out tV); r.y += 31;
                r = target.DRAW_SLIDER(r, "Amount", "_SurfaceFoamAmount", 0, 30, GUI.enabled); r.y += r.height;
                r = target.DRAW_SLIDER(r, "Contrast", "_SurfaceFoamContrast", 1, 600, GUI.enabled); r.y += r.height;


                r.height = FastWaterModel20ControllerEditor.H;
                EditorGUI.HelpBox(r, "Offset", MessageType.None); r.y += r.height;
                var refV   = new Vector3(0.12065329648999294186660041025867f, 0.98533525466827569191057001711249f, 0.12065329648999294186660041025867f);
                var rightV = new Vector3(0, 1, 0);
                var leftV  = (refV - rightV) * 2 + rightV;
                var leng   = (rightV - leftV).magnitude;

                var current = (Vector3)target.target.compiler.GetVector("_SUrfaceFoamVector");
                var oldV    = (rightV - current).magnitude / leng - 0.5f;

                oldV *= 4;
                r     = target.DIRECTION(r, null, GUI.enabled, VECTOR: false, leftClamp: -0.5f, rightClamp: 0.5f, value: oldV); r.y += r.height;
                if (target.LAST_DIRECTION_VALUE != oldV)
                {
                    target.target.Undo();
                    target.LAST_DIRECTION_VALUE /= 4;
                    var result = Vector3.Lerp(rightV, leftV, target.LAST_DIRECTION_VALUE + 0.5f).normalized;
                    target.target.compiler.SetVector("_SUrfaceFoamVector", result.normalized);
                    target.target.SetDirty();
                }



                r.y        += FastWaterModel20ControllerEditor.H;
                GUI.enabled = true;
                GUI.enabled = target.DRAW_TOGGLE(r, "Surface Waves", "SURFACE_WAVES", true, out tV); r.y += 31;
                target.DRAW_TOGGLE(r, "images_surfacewaves", null, GUI.enabled, out tV); r.y += 31;
                r = target.DRAW_VECTOR(r, "Tile X / Y", "_SFW_Tile", 0.001f, 100, GUI.enabled); r.y += r.height;
                r = target.DRAW_SLIDER(r, "Amount", "_SFW_Amount", 0, 50, GUI.enabled); r.y += r.height;
                r = target.DRAW_VECTOR(r, "Speed X / Y", "_SFW_Speed", -10, 10, GUI.enabled, div: 1000); r.y += r.height;
                //  r = target.DRAW_SLIDER(r, "Speed", "_SFW_Speed", -10, 10, GUI.enabled, div:10); r.y += r.height;
                r        = target.DIRECTION(r, "_SFW_Dir", GUI.enabled); r.y += r.height;
                r        = target.DIRECTION(r, "_SFW_Dir1", GUI.enabled); r.y += r.height;
                r.height = FastWaterModel20ControllerEditor.H;
                EditorGUI.HelpBox(r, "Main Texture", MessageType.None); r.y += r.height;
                r = DRAW_GRAPHIC(r, 40, target.target.compiler.GetTexture(FIELDS._MainTex) as Texture2D, GUI.enabled); r.y += r.height;
                r = target.DRAW_VECTOR(r, "Texture Tile", "_SFW_Tile", 0.001f, 100, GUI.enabled, true); r.y += r.height;
                r = target.DRAW_SLIDER(r, "Distort", "_SFW_Distort", 0, 50, GUI.enabled); r.y += r.height;

                // r = target.DIRECTION(r, "_FoamDirection", foam_enable, VECTOR: false, leftClamp: -1f, rightClamp: 1f); r.y += r.height;
                GUI.enabled = target.DRAW_TOGGLE(r, "Normal Affect", "SKIP_SURFACE_WAVES_NORMALEFFECT", GUI.enabled, out tV); r.y += 31;
                if (GUI.enabled)
                {
                    r = target.DRAW_SLIDER(r, null, "_SFW_NrmAmount", 0, 10, GUI.enabled);
                }
                r.y        += r.height;
                GUI.enabled = target.DRAW_TOGGLE(r, "Debug Surf Waves", "DEBUG_SURFACE_WAVES", GUI.enabled, out tV); r.y += 31;


                r.y        += FastWaterModel20ControllerEditor.H;
                GUI.enabled = true;
                GUI.enabled = target.DRAW_TOGGLE(r, "Surface Fog", "SURFACE_FOG", true, out tV); r.y += 31;
                r           = target.DRAW_SLIDER(r, "Tiling", "_SURFACE_FOG_Tiling", 0.01f, 100, GUI.enabled); r.y += r.height;
                r           = target.DRAW_SLIDER(r, "Amount", "_SURFACE_FOG_Amount", 0, 50, GUI.enabled); r.y += r.height;
                r           = target.DRAW_SLIDER(r, "Speed", "_SURFACE_FOG_Speed", 0, 3, GUI.enabled); r.y += r.height;



                r.x = 0;
                r.y = 0;

                GUI.enabled = true;

                r.height = FastWaterModel20ControllerEditor.H;
                //EditorGUI.HelpBox(r, "Apply Texture", MessageType.None); r.y += r.height;
                var mt_enable = target.DRAW_TOGGLE(r, "Apply Texture", FIELDS.SKIP_MAINTEXTURE, true, out tV); r.y += 31;

                target.DRAW_TOGGLE(r, "images_waves", null, true, out tV);
                //r.x = tV.x;
                r.y += 31;
                // r.x = DrawArrowedLine(  tV , Offset_X( tV, 10 ), 2, mt_enable ).p2.x;

                r = DRAW_GRAPHIC(r, 40, target.target.compiler.GetTexture(FIELDS._MainTex) as Texture2D, mt_enable, new Color(1, 1, 1, 1)); r.y += r.height;
                r = target.DRAW_VECTOR(r, "Tile X / Y", FIELDS._MainTexTile, 0, 100, mt_enable); r.y += r.height;
                r = target.DRAW_SLIDER(r, "Amount", FIELDS._MainTexColor, 0, 20, mt_enable, useColor: true); r.y += r.height;
                r = target.DRAW_SLIDER(r, "Distortion", "_MTDistortion", 0, 6, mt_enable); r.y += r.height;


                r.height    = FastWaterModel20ControllerEditor.H;
                GUI.enabled = mt_enable;
                EditorGUI.HelpBox(r, "Blend", MessageType.None); r.y += r.height;
                target.pop_mainblend.DrawPop(null, r); r.y           += r.height;
                if (target.pop_mainblend.VALUE == 1)
                {
                    r = target.DRAW_SLIDER(r, "Blend Amount", "_MAINTEXMASK_Blend", 0, 2, mt_enable); r.y += r.height;
                }
                r = target.DRAW_VECTOR(r, "Move X / Y", FIELDS._MainTexTile, -2, 2, mt_enable, true, div: 100); r.y += r.height;
                // r = target.DRAW_SLIDER( r, "Speed", "MainTexSpeed", 0, 20, mt_enable ); r.y += r.height;
                r.y += FastWaterModel20ControllerEditor.H;

                GUI.enabled = true;
                string    FEATURE = "MAINTEXMASK";
                string    tile    = "_MAINTEXMASK_Tile";
                string    amount  = "_MAINTEXMASK_Amount";
                string    min     = "_MAINTEXMASK_min";
                string    max     = "_MAINTEXMASK_max";
                string    offset  = "_MAINTEXMASK_offset";
                bool      enable  = mt_enable;
                POP_CLASS pop     = null;

                //////////////////////////////
                r = target.DRAW_MASK_PANEL(r, "Mask", null, FEATURE, tile, offset, amount, min, max, "MAINTEX_MASK_DEBUG", ref enable, pop);

                //////////////////////////////
                // var v2 = DrawLine( tV, Offset_X( tV, 15 ), 3, mt_enable );
                // r = DRAW_TEXTURE_ALIGNY( "i_RGB", V_to_R( v2 ), mt_enable );
                // tV.x = r.x + r.width;
                // r.x = DrawArrowedLine( tV, Offset_X( tV, VL.x - tV.x ), 3, mt_enable ).x;
                // r.y = LINE_R.y;


                r.x = 300;
                r.y = 0;
            }
Exemple #9
0
            public override void Draw(Rect input, out Vector2[] output)
            {
                output = new Vector2[1];
                if (!target.target.compiler || !target.target.compiler.material)
                {
                    return;
                }

                for (int i = 0; i < output.Length; i++)
                {
                    output[i] = Vector2.zero;
                }
                LAST_GROUP_R = new Rect(input.x, input.y, input.width, target.MENU_CURRENT_HEIGHT());
                GUI.BeginGroup(LAST_GROUP_R);
                var r  = new Rect(0, 0, BOTTOM_W, 0);
                var og = GUI.enabled;

                var S           = 0;
                var foam_enable = target.DRAW_TOGGLE(r, "images_vertices", FIELDS.SKIP_3DVERTEX_ANIMATION, true, out tV); r.y += 31;

                GUI.enabled = foam_enable;
                r.height    = FastWaterModel20ControllerEditor.H;
                EditorGUI.HelpBox(r, "3D Vertices", MessageType.None); r.y += r.height;

                // r = target.DRAW_DOUBLEFIELDS(r, "Tile Z", new[] { "_3DWavesTileZ", "_3DWavesTileZAm" }, new[] { 0.01f, 0f }, new[] { 2, 2f }, foam_enable); r.y += r.height;
                r    = target.DRAW_DOUBLEFIELDS(r, "Height/Wind", new[] { FIELDS._3DWavesHeight, FIELDS._3DWavesWind }, new[] { 0, -64f }, new[] { 256, 64f }, foam_enable, firstDiv: 100, seconddiv: 100);
                r.y += r.height;

                r = target.DRAW_DOUBLEFIELDS(r, "Speed X/Y", new[] { "_3DWavesSpeed", "_3DWavesSpeedY" },
                                             new[] { -4f, -4 }, new[] { 4f, 4 }, foam_enable, firstDiv: 50, seconddiv: 50); r.y += r.height;

                r.y += FastWaterModel20ControllerEditor.H;

                r = target.DRAW_VECTOR(r, "Detile Y Clamp", "_VERTEX_ANIM_DETILE_YOFFSET", -10, 10, foam_enable); r.y += r.height;
                r = target.DRAW_VECTOR(r, "Detile Y Offset", "_VERTEX_ANIM_DETILE_YOFFSET", -10, 10, foam_enable, useOneIndex: 1, useSecondPair: true); r.y += r.height;

                r.y += FastWaterModel20ControllerEditor.H;

                r = target.DRAW_SLIDER(r, "UV Amount", "_VertexToUv", 0, 1, foam_enable); r.y += r.height;


                if (target.MODE_ULTRA_FAST)
                {
                    r.x = 100;
                    r.y = 0;
                }

                r = target.DRAW_VECTOR(r, "Tile X / Y", FIELDS._3DWavesTile, 0, 2000, foam_enable); r.y += r.height + S;

                // var detileEnalbe = foam_enable && ( target.target.compiler.IsKeywordEnabled("DETILE_LQ") || target.target.compiler.IsKeywordEnabled("DETILE_HQ" ));
                var detileEnalbe = foam_enable && target.DRAW_TOGGLE(r, "Detailed Tile", "HAS_WAVES_DETILE", foam_enable, out tV); r.y += 31;

                r = target.DRAW_DOUBLEFIELDS(r, "Detile/Tile", new[] { "_VERTEX_ANIM_DETILEAMOUNT", "_VERTEX_ANIM_DETILEFRIQ" }, new[] { 0, 0.001f }, new[] { 256, 64f },
                                             detileEnalbe, seconddiv: 10); r.y += r.height;
                //  r = target.DRAW_SLIDER(r, "Detile Offset", "_VERTEX_ANIM_DETILE_YOFFSET", -10, 10, detileEnalbe); r.y += r.height;
                r = target.DRAW_SLIDER(r, "Detile Speed", "_VERTEX_ANIM_DETILESPEED", 0, 64, detileEnalbe, div: 100); r.y += r.height;


                r.height = FastWaterModel20ControllerEditor.H;
                EditorGUI.HelpBox(r, "Direction", MessageType.None); r.y += r.height;
                var oldT = target.target.compiler.GetFloat("_WavesDirAngle");

                r = target.DIRECTION(r, "_WavesDirAngle", foam_enable, VECTOR: false, leftClamp: 0, rightClamp: 6.2834f); r.y += r.height;
                var newT = target.target.compiler.GetFloat("_WavesDirAngle");

                if (oldT != newT && (oldT == 0 || newT == 0))
                {
                    target.target.Undo();
                    if (newT != 0)
                    {
                        target.target.compiler.EnableKeyword("HAS_WAVES_ROTATION");
                    }
                    else
                    {
                        target.target.compiler.DisableKeyword("HAS_WAVES_ROTATION");
                    }
                    target.target.SetDirty();
                }

                if (target.MODE_ULTRA_FAST)
                {
                    r.x = 200;
                    r.y = 0;
                }
                if (!target.MODE_MINIMUM)
                {
                    r.height = FastWaterModel20ControllerEditor.H;
                    EditorGUI.HelpBox(r, "Animating Area", MessageType.None); r.y += r.height;
                    target.pop_3dwavesborders.DrawPop(null, r); r.y += r.height;
                    // var bf = target.DRAW_TOGGLE( r, "Border Fading", "SKIP_3DVERTEX_ANIMATION_BORDER_FADE", foam_enable, out tV ) & foam_enable; r.y += 31;
                    if (target.pop_3dwavesborders != null && target.pop_3dwavesborders.VALUE == 3 && target.pop_depth != null)
                    {
                        r.height = FastWaterModel20ControllerEditor.H * 3;
                        if (target.__pop_depth.VALUE == 0)
                        {
                            EditorGUI.HelpBox(r, "Request ZDepth", MessageType.Error);
                            r.y += r.height + S;
                        }
                        if (target.__pop_depth.IS(FIELDS.ALLOW_MANUAL_DEPTH) && target.target.compiler.IsKeywordEnabled("SKIP_SECOND_DEPTH"))
                        {
                            EditorGUI.HelpBox(r, "Request Backed ZDepth", MessageType.Error);
                            r.y += r.height + S;
                        }
                        r = target.DRAW_SLIDER(r, "Clamp Amount", "_3Dwaves_BORDER_FACE", -4, 4f, foam_enable, div: 50); r.y += r.height + S;
                    }
                    //  _BAKED_DEPTH_EXTERNAL_TEXTURE_Amount
                }
                //r = target.DRAW_VECTOR(r, "Speed X/Y", FIELDS._3DWavesSpeed, -4, 4, foam_enable, div: 50); r.y += r.height + S;
                // r = target.DRAW_SLIDER(r, "Speed X/Y", "_3DWavesSpeed", -4, 4f, foam_enable, div: 50); r.y += r.height + S;

                r.y += FastWaterModel20ControllerEditor.H;
                if (!target.MODE_MINIMUM)
                { //r = target.DRAW_SLIDER( r, "Wind Amount", , 0.1f, 32, foam_enable ); r.y += r.height + S;
                  //r = target.DRAW_COLOR( r, "Color", FIELDS._3d, true, out tV ); r.y += r.height + S;
                    var nrmmrm = target.DRAW_TOGGLE(r, "Calc Normals", FIELDS.WAW3D_NORMAL_CALCULATION, foam_enable) & foam_enable; r.y += 31;
                    r = target.DRAW_SLIDER(r, "Amount", "_3dwanamnt", -1000f, 1000, nrmmrm); r.y += r.height;
                }

                r.y += FastWaterModel20ControllerEditor.H;
                if (target.MODE_ULTRA_FAST)
                {
                    r.x = 300;
                    r.y = 0;
                }
                var SimpleColorize = target.DRAW_TOGGLE(r, "Simple Colorize", "USE_SIMPLE_VHEIGHT_FADING", foam_enable, out tV) & foam_enable; r.y += 31;

                r = target.DRAW_SLIDER(r, "Color Amount", "SIMPLE_VHEIGHT_FADING_AFFECT", 0, 5f, SimpleColorize, div: 10); r.y += r.height + S;


                if (!target.MODE_MINIMUM)
                { /*uniform MYFIXED _3DWavesYFoamAmount;
                   * uniform MYFIXED _WaveGradTopOffset;
                   * uniform MYFIXED _VERT_Tile;
                   * uniform MYFIXED3 _VERT_Color;*/
                    r.y += FastWaterModel20ControllerEditor.H;
                    var Colorize = target.DRAW_TOGGLE(r, "Add Texture", FIELDS.SKIP_3DVERTEX_HEIGHT_COLORIZE, foam_enable, out tV) & foam_enable; r.y += 31;
                    if (Colorize)
                    {
                        r    = target.DRAW_SLIDER(r, "Y Multiply", FIELDS._3DWavesYFoamAmount, 0, 10f, Colorize, div: 100); r.y += r.height + S;
                        r    = target.DRAW_SLIDER(r, "Y Offset", "_WaveGradTopOffset", 0, 100f, Colorize); r.y += r.height + S;
                        r.y += FastWaterModel20ControllerEditor.H;
                        r    = target.DRAW_SLIDER(r, "Amount", "_VERT_Amount", 0, 10f, Colorize); r.y += r.height + S;
                        r    = target.DRAW_COLOR(r, null, "_VERT_Color", Colorize, out tV, false); r.y += r.height;
                        target.DRAW_TOGGLE(r, "Multiply MainTex", "VERT_USE_MULTIPLUOUT", Colorize, out tV); r.y += 31;
                        target.DRAW_TOGGLE(r, "Camera Angle", "USE_VERT_FRESNEL", Colorize, out tV); r.y         += 31;

                        string[]  texture          = new[] { FIELDS._MainTex, "_ShoreWavesGrad", "_UF_NMASK_Texture" };
                        POP_CLASS texture_SWITCHER = target.vertTExtureSwitcher;
                        POP_CLASS pop_channel      = target.pop_vertTextureChannel;
                        bool      enable           = GUI.enabled;
                        //////////////////////////////
                        r = target.DrawTextureWIthChannelAndSwitcher(r, Colorize, texture, texture_SWITCHER, pop_channel);

                        r = target.DRAW_VECTOR(r, "Tile", "_VERT_Tile", 0.1f, 10, Colorize, div: 10); r.y += r.height;
                        //  r = target.DRAW_SLIDER(r, "Tile", "_VERT_Tile", 0.0001f, 10f, Colorize, div: 10); r.y += r.height + S;
                        r.y += FastWaterModel20ControllerEditor.H;
                        target.DRAW_TOGGLE(r, "Debug Gradient", "DEBUG_TOP_GRAD", Colorize, out tV); r.y += 31;
                    }


                    /*
                     * if (Colorize)
                     * {   // var use_sg = GUI.enabled = target.DRAW_TOGGLE(r, "Surface Gradient", "USE_SURFACE_GRADS", GUI.enabled, out tV); r.y += 31;
                     *   r = target.DRAW_SLIDER(r, "Offset Top", "_WaveGradTopOffset", 0, 100, Colorize); r.y += r.height;
                     *   target.DRAW_TOGGLE(r, "Debug Gradient", "DEBUG_TOP_GRAD", Colorize, out tV); r.y += 31;
                     *   r = target.DRAW_COLOR(r, null, "_WaveGrad0", Colorize, out tV, false); r.y += r.height;
                     *   r = target.DRAW_COLOR(r, null, "_WaveGrad1", Colorize, out tV, false); r.y += r.height;
                     *   r = target.DRAW_COLOR(r, null, "_WaveGrad2", Colorize, out tV, false); r.y += r.height;
                     *   // r = target.DRAW_SLIDER(r, "Offset Mid", "_WaveGradMidOffset", 0, 1, Colorize); r.y += r.height;
                     * }*/
                }

                GUI.enabled  = og;
                LAST_GROUP_R = Rect.zero;
                GUI.EndGroup();
            }
Exemple #10
0
            public override void Draw(Rect input, out Vector2[] output)
            {
                output = new Vector2[1];
                if (!target.target.compiler || !target.target.compiler.material)
                {
                    return;
                }
                for (int i = 0; i < output.Length; i++)
                {
                    output[i] = Vector2.zero;
                }
                LAST_GROUP_R = new Rect(input.x, input.y, 390, target.MENU_CURRENT_HEIGHT());
                GUI.BeginGroup(LAST_GROUP_R);
                var r = new Rect(0, 0, BOTTOM_W, 0);

                //DrawArrowedLine( fullRect.x, fullRect.y, fullRect.x + 100, fullRect.y + 100, ACTIVE_COLOR );
                // DrawArrowedLine( fullRect.x, fullRect.y, fullRect.x + 100, fullRect.y + 100 , PASSIVE_COLOR );
                // DRAW_TEXTURE("i_RGB", fullRect);



                r = target.DRAW_COLOR(r, "Main Tint", FIELDS._MainTexColor, true, out tV, false); r.y += r.height;
                // r = target.DRAW_SLIDER( r, "Alpha", FIELDS._Transparency, 0, 1, true ); r.y += r.height;
                var enableAlpha = !target.IS_OPAQUE;

                var a = target.DRAW_TOGGLE(r, "Alpha Pow", "TRANSPARENT_POW", enableAlpha); r.y += 31;

                if (a)
                {
                    target.DRAW_TOGGLE(r, "Inverse Pow", "TRANSPARENT_POW_INV", enableAlpha); r.y += 31;
                    r = target.DRAW_SLIDER(r, "Transparency", "_TransparencyPow", -1, 1, true); r.y += r.height;
                }
                a = target.DRAW_TOGGLE(r, "Alpha Luminosity", "TRANSPARENT_LUMINOSITY", enableAlpha); r.y += 31;
                if (a)
                {
                    r = target.DRAW_SLIDER(r, "Transparency", "_TransparencyLuminosity", 0, 5, true); r.y += r.height;
                }
                a = target.DRAW_TOGGLE(r, "Alpha Simple", "TRANSPARENT_SIMPLE", enableAlpha); r.y += 31;
                if (a)
                {
                    r    = target.DRAW_SLIDER(r, "Transparency", "_TransparencySimple", 0, 1, true);
                    r.y += r.height;
                }


                r.y += FastWaterModel20ControllerEditor.H;

                //var VL = DrawLine( tV , Offset_X( tV, 160 ), 3 );
                // DrawLine( VL, Offset_Y( VL, 300 ), 3 );

                if (target.MODE_ULTRA_FAST)
                {
                    r.x = 100;
                    r.y = 0;
                }

                r.height = FastWaterModel20ControllerEditor.H;
                EditorGUI.HelpBox(r, "Style", MessageType.None); r.y += r.height;
                target.pop_waves.DrawPop(null, r); r.y += r.height;
                if (target.pop_waves.VALUE == 2)
                {
                    if (target.MODE_ULTRA_FAST && !target.MODE_MINIMUM)
                    {
                    }
                    else
                    {
                        r.height = FastWaterModel20ControllerEditor.H * 6;
                        EditorGUI.HelpBox(r, "Only Ultra Fast Mode Support", MessageType.Error); r.y += r.height;
                    }
                }
                //  if (target.pop_waves.VALUE < 2)
                { r.height = FastWaterModel20ControllerEditor.H;
                  r        = target.DRAW_SLIDER(r, "Waves Amount", FIELDS._BumpAmount, 0, 100, true); r.y += r.height;
                  if (!target.MODE_MINIMUM)
                  {
                      var am = target.DRAW_TOGGLE(r, "Alternative Mix", "ALTERNATIVE_NORMALS_MIX", true); r.y += 31;
                      if (am)
                      {
                          r = target.DRAW_SLIDER(r, null, "_BumpMixAmount", 0, 1, true, div: 100); r.y += r.height;
                      }
                  }

                  r = DRAW_GRAPHIC(r, 40, target.target.compiler.GetTexture(FIELDS._BumpMap) as Texture2D, true, null); r.y += r.height;
                  r = target.DRAW_VECTOR(r, "Tile X/Y", FIELDS._WaterTextureTile, 0, 10000, true);
                  GUI_TOOLTIP(r, "This Tile affects all child Tile");
                  r.y += r.height;
                  r    = target.DRAW_VECTOR(r, "Speed Cross", FIELDS._WaterTextureTile, -10, 10, true, true, div: 10);
                  GUI_TOOLTIP(r, "Two textures will scroll towards each other, and will make a simple animation ");
                  r.y += r.height;
                  r    = target.DRAW_VECTOR(r, "Move Direction", "_AnimMove", -10, 10, true, false, div: 100);
                  GUI_TOOLTIP(r, "This option in order to create common flow direction ");
                  r.y += r.height;
                  if (!target.MODE_MINIMUM)
                  {
                      var ba = target.DRAW_TOGGLE(r, "Use Blend Animation", "SKIP_BLEND_ANIMATION", true); r.y += 31;
                      if (ba)
                      {
                          r = target.DRAW_SLIDER(r, "Speed Blend", "_BlendAnimSpeed", 0.001f, 4, true); r.y += r.height;
                          target.DRAW_TOGGLE(r, "Smooth Animation", "SMOOTH_BLEND_ANIMATION", true); r.y += 31;

                        #if MOBILE_TARGET
                          /*  r.height = FastWaterModel20ControllerEditor.H * 6;
                           * EditorGUI.HelpBox(r, "Note that, Blend Animation does not work on the openGLES 2.0, you may make a separate material for different platforms", MessageType.None); r.y += r.height;*/
                        #endif
                      }
                  }

                  r.y += FastWaterModel20ControllerEditor.H;
                  a    = target.DRAW_TOGGLE(r, "Debug Normals", "DEBUG_NORMALS", true); r.y += 31; }

                r.y += 10;


                if (target.MODE_ADVANCEPC)
                {
                    var classicnoise = target.DRAW_TOGGLE(r, "Procedure Pass Test", "WAVES_GERSTNER", true); r.y += 31;
                    // else
                    if (classicnoise)
                    {
                        r = target.DRAW_SLIDER(r, "LOD Distance", "_CN_DISTANCE", 1, 1000, true);
                        GUI_TOOLTIP(r, "At what distance will the noise");
                        r.y += r.height;
                        target.DRAW_TOGGLE(r, "Debug Noise", "_CN_DEBUG", true); r.y += 31;
                        r = DRAW_GRAPHIC(r, 40, target.target.compiler.GetTexture(FIELDS._NoiseHQ) as Texture2D, GUI.enabled); r.y += r.height;
                        r = target.DRAW_VECTOR(r, "P Tile X/Y", "_CN_TILING", 0.001f, 100, true, false); r.y += r.height;
                        r = target.DRAW_SLIDER(r, "P Add Amount", "_CN_AMOUNT", 0, 100, true); r.y += r.height;
                        r = target.DRAW_SLIDER(r, "P Pow Blend", "_CLASNOISE_PW", 0, 1, true, div: 10); r.y += r.height;
                        r = target.DRAW_SLIDER(r, "P Texel Size", "_CN_TEXEL", 0.0001f, 0.1f, true, div: 100); r.y += r.height;
                        r = target.DRAW_SLIDER(r, "P Speed", "_CN_SPEED", 0, 10, true); r.y += r.height;


                        /* r = target.DRAW_SLIDER(r, "Waves Amount", FIELDS._BumpAmount, 0, 2, true); r.y += r.height;
                         * target.VECTOR_FIELD(ref r, "_GAmplitude", "_GAmplitude");
                         * target.VECTOR_FIELD(ref r, "_GFrequency", "_GFrequency");
                         * // target.VECTOR_FIELD(ref r, "_GSteepness", "_GSteepness");
                         * target.VECTOR_FIELD(ref r, "_GSpeed", "_GSpeed");
                         * target.VECTOR_FIELD(ref r, "_GDirectionAB", "_GDirectionAB");
                         * target.VECTOR_FIELD(ref r, "_GDirectionCD", "_GDirectionCD");*/
                    }

                    r.y += 10;



                    // r.y += r.height + FastWaterModel20ControllerEditor.H;

                    //////////////////////////////
                }

                if (target.MODE_ULTRA_FAST)
                {
                    r.x = 200;
                    r.y = 0;
                }
                else
                {
                    r.y = 0;
                    r.x = 100;
                }

                if (!target.MODE_MINIMUM)
                {
                    target.DRAW_TOGGLE(r, "Normalize wNormal", "SKIP_WNN", !target.target.compiler.IsKeywordEnabled("HAS_Z_AFFECT_BUMP"), out tV);
                    GUI_TOOLTIP(r, "If enabled, normal will normalize for each pixel. You may disable this, if you're using mega old device"); r.y += 31;
                    r.y += FastWaterModel20ControllerEditor.H;

                    var zfade = target.DRAW_TOGGLE(r, "Normals Z Fade", "Z_AFFECT_BUMP", true, out tV); r.y += 31;
                    if (zfade)
                    {
                        r = target.DRAW_SLIDER(r, "Offset", "_BumpZFade", -30f, 10, true); r.y += r.height;
                        r = target.DRAW_SLIDER(r, "Fade", "_BumpZOffset", 1f, 30, true); r.y += r.height;
                        target.DRAW_TOGGLE(r, "Inverse", "INVERT_Z_AFFECT_BUMP", true, out tV); r.y += 31;
                    }
                }


                if (target.MODE_ADVANCEPC)
                {
                    r.y += FastWaterModel20ControllerEditor.H;
                    var oct = target.DRAW_TOGGLE(r, "Multi Octaves", "MULTI_OCTAVES", true, out tV); r.y += 31;
                    if (oct)
                    {
                        r        = target.DRAW_SLIDER(r, "Count", "_MultyOctaveNormals", 1f, 8, true, integer: true); r.y += r.height;
                        r.height = FastWaterModel20ControllerEditor.H;
                        r        = target.DRAW_SLIDER(r, "Blend Amount", "_FadingFactor", 0f, 1, true); r.y += r.height;
                        r.height = FastWaterModel20ControllerEditor.H;
                        target.pop_waves_blend.DrawPop(null, r); r.y += r.height;

                        target.DRAW_TOGGLE(r, "Toward Moving", "SKIP_MO_TOWARD", true, out tV);
                        GUI_TOOLTIP(r, "If enabled, then two same normals will mix together moving towards each other (I do not think that this is useful, but and did not remove)");
                        r.y += 31;
                        r    = target.DRAW_VECTOR(r, "Tile Offset", "_MultyOctavesTileOffset", 0.1f, 10, true); r.y += r.height;
                        GUI_TOOLTIP(r, "Offset means that each new octave will be offset by a given coefficient relative to the base value");
                        r = target.DRAW_SLIDER(r, "Speed Offset", "_MultyOctavesSpeedOffset", 0.1f, 3f, true); r.y += r.height;
                        GUI_TOOLTIP(r, "Offset means that each new octave will be offset by a given coefficient relative to the base value");

                        var rotenable = target.DRAW_TOGGLE(r, "Rotate by Time", "MULTI_OCTAVES_ROTATE", true, out tV);
                        GUI_TOOLTIP(r, "During the time the normals will rotate, this will give the little dynamus, at higher values it will become like boiling water");
                        r.y += 31;
                        if (rotenable)
                        {
                            r = target.DRAW_SLIDER(r, "Base Rotate", "_MOR_Base", 0f, 10, true); r.y += r.height;
                            r = target.DRAW_SLIDER(r, "Rotate Offset ", "_MOR_Offset", 0.1f, 3f, true);
                            GUI_TOOLTIP(r, "Offset means that each new octave will be offset by a given coefficient relative to the base value"); r.y += r.height;

                            var uvtoroate = target.DRAW_TOGGLE(r, "Add UV to Rotate", "MULTI_OCTAVES_ROTATE_TILE", true, out tV);
                            GUI_TOOLTIP(r, "Some normals have a texture with parallel waves, use this feature to avoid of artifacts when using such textures");
                            r.y += 31;
                            if (uvtoroate)
                            {
                                r    = target.DRAW_SLIDER(r, "UV Scale ", "_MOR_Tile", 0.1f, 300f, true);
                                r.y += r.height;
                            }
                        }


                        //  r = target.DRAW_SLIDER(r, "Tile Offset", "_MultyOctavesTileOffset", 0.5f, 2f, true); r.y += r.height;
                    }
                }



                r.y += FastWaterModel20ControllerEditor.H;
                var sd = target.DRAW_TOGGLE(r, "Sin Disatortion", "SIN_OFFSET", true); r.y += 31;
                if (sd)
                {
                    r = target.DRAW_SLIDER(r, "Amount", "_sinAmount", -0.5f, 0.5f, true); r.y += r.height;
                    r = target.DRAW_SLIDER(r, "Tile", "_sinFriq", 0.1f, 300, true); r.y += r.height;
                }

                if (!target.MODE_MINIMUM)
                {
                    GUI.enabled = true;
                    r.y        += FastWaterModel20ControllerEditor.H;
                    r.height    = FastWaterModel20ControllerEditor.H;
                    EditorGUI.HelpBox(r, "DeTiler", MessageType.None); r.y            += r.height;
                    target.DRAW_TOGGLE(r, "images_detiling", null, true, out tV); r.y += 31;
                    r.height = FastWaterModel20ControllerEditor.H;
                    target.pop_detiler.DrawPop(null, r);
                    r.y += r.height;
                    if (target.MODE_ULTRA_FAST && target.pop_detiler.VALUE == 2)
                    {
                        r.height = FastWaterModel20ControllerEditor.H * 8;
                        EditorGUI.HelpBox(r, "HQ detiling not allow with Ultra Fast Mode", MessageType.Error);
                    }
                    else
                    {
                        if (target.pop_detiler.VALUE != 0)
                        {
                            r = target.DRAW_SLIDER(r, "Amount", "_DetileAmount", 0.01f, 1, true, div: 10); r.y += r.height;
                            r = target.DRAW_SLIDER(r, "Frequency", "_DetileFriq", 0.01f, 50, true); r.y += r.height;
                            target.DRAW_TOGGLE(r, "Same dir as anim", "DETILE_SAME_DIR", true, out tV); r.y += 31;
                        }
                    }
                }


                if (target.MODE_ULTRA_FAST)
                {
                    r.y = 0;
                    r.x = 300;

                    string    FEATURE          = "UF_AMOUNTMASK";
                    string[]  texture          = new[] { "_UF_NMASK_Texture", FIELDS._MainTex };
                    POP_CLASS texture_SWITCHER = target.pop_normalMastTextureSwitcher;
                    POP_CLASS pop_channel      = target.pop_normalMastChannel;
                    string    tile             = "_UF_NMASK_Tile";
                    string    offset           = "_UF_NMASK_offset";
                    string    contrast         = "_UF_NMASK_Contrast";
                    string    brightness       = "_UF_NMASK_Brightnes";
                    bool      enable           = GUI.enabled;
                    //////////////////////////////
                    r = target.DRAW_MASK_PANEL_CB(r, "Normals Mask", null, FEATURE, texture, texture_SWITCHER, tile, offset, contrast, brightness,
                                                  "AMOUNT_MASK_DEBUG", ref enable, pop_channel); r.y += r.height;
                    //////////////////////////////
                }

                if (target.MODE_ADVANCEPC)
                {
                    r.y = 0;
                    r.x = 200;


                    string    FEATURE = "AMOUNTMASK";
                    string    tile    = "_AMOUNTMASK_Tile";
                    string    amount  = "_AMOUNTMASK_Amount";
                    string    min     = "_AMOUNTMASK_min";
                    string    max     = "_AMOUNTMASK_max";
                    string    offset  = "_AMOUNTMASK_offset";
                    bool      enable  = GUI.enabled;
                    POP_CLASS pop     = null;
                    //////////////////////////////
                    r = target.DRAW_MASK_PANEL(r, "Amount Mask", "white means that the waves in this place will be larger", FEATURE, tile, offset, amount, min, max, "AMOUNT_MASK_DEBUG", ref enable, pop);
                    //////////////////////////////

                    r.y += FastWaterModel20ControllerEditor.H;

                    FEATURE = "TILINGMASK";
                    tile    = "_TILINGMASK_Tile";
                    amount  = "_TILINGMASK_Amount";
                    min     = "_TILINGMASK_min";
                    max     = "_TILINGMASK_max";
                    offset  = "_TILINGMASK_offset";
                    enable  = GUI.enabled;
                    pop     = null;
                    //////////////////////////////
                    r = target.DRAW_MASK_PANEL(r, "Tile Mask", "white means that the waves in this place will be more tiled", FEATURE, tile, offset, amount, min, max, "TILE_MASK_DEBUG", ref enable, pop,
                                               amountClamp: new Vector2(0, 20));


                    GUI.enabled = enable;
                    r.height    = FastWaterModel20ControllerEditor.H;
                    EditorGUI.HelpBox(r, "Tile Type", MessageType.None); r.y += r.height;
                    r.height = FastWaterModel20ControllerEditor.H;
                    target.pop_tilemasktype.DrawPop(null, r); r.y += r.height;
                    if (target.pop_tilemasktype.VALUE > 0)
                    {
                        r    = target.DRAW_SLIDER(r, "Tile Factor", "_TILINGMASK_factor", 0.01f, 50, GUI.enabled);
                        r.y += r.height;
                    }
                    //////////////////////////////



                    r.x += r.width + 14;
                    r.x  = 200;
                    //r.y = VL.y + 20;
                    r.y = 60;
                    // r.y =0 ;
                }


                if (!target.MODE_ULTRA_FAST)
                {
                    target.d_D_Vertices.target = target;
                    Vector2[] draw_output;
                    target.d_D_Vertices.Draw(new Rect(300, 0, 100, 0), out draw_output);
                }



                LAST_GROUP_R = Rect.zero;
                GUI.EndGroup();
            }