public bool DrawColorCube(Color px, Color nx, Color py, Color ny, Color pz, Color nz, bool updateSettings = true)
        {
            bool         changed  = false;
            BakeSettings settings = BakeData.Instance().GetBakeSettings().SelectedBakeSet;

            Color newColor   = px;
            int   labelWidth = 25;

            if (DrawCubeColor("+X", labelWidth, px, out newColor))
            {
                changed = true;
                if (updateSettings)
                {
                    settings.SetColorCubeFace(Face.PosX, newColor);
                }
            }
            if (DrawCubeColor("-X", labelWidth, nx, out newColor))
            {
                changed = true;
                if (updateSettings)
                {
                    settings.SetColorCubeFace(Face.NegX, newColor);
                }
            }
            if (DrawCubeColor("+Y", labelWidth, py, out newColor))
            {
                changed = true;
                if (updateSettings)
                {
                    settings.SetColorCubeFace(Face.PosY, newColor);
                }
            }
            if (DrawCubeColor("-Y", labelWidth, ny, out newColor))
            {
                changed = true;
                if (updateSettings)
                {
                    settings.SetColorCubeFace(Face.NegY, newColor);
                }
            }
            if (DrawCubeColor("+Z", labelWidth, pz, out newColor))
            {
                changed = true;
                if (updateSettings)
                {
                    settings.SetColorCubeFace(Face.PosZ, newColor);
                }
            }
            if (DrawCubeColor("-Z", labelWidth, nz, out newColor))
            {
                changed = true;
                if (updateSettings)
                {
                    settings.SetColorCubeFace(Face.NegZ, newColor);
                }
            }

            return(changed);
        }
Esempio n. 2
0
            public static BakeSettings CreateDefaultSetting()
            {
                BakeSettings def = new BakeSettings("default");

                def.m_forceAllLights = true;

                return(def);
            }
        public override void OnInspectorGUI()
        {
            VertexLightingOverride source = target as VertexLightingOverride;

            BakeSettings settings = source.m_bakeSettingsOverride;

            DVLEditor.DrawShadowAndAOSettings(settings, source, true);

            if (GUILayout.Button("Copy Global Settings"))
            {
                source.m_bakeSettingsOverride.CopySettings(BakeData.Instance().GetBakeSettings().SelectedBakeSet);
                EditorUtility.SetDirty(source);
            }
        }
Esempio n. 4
0
 public void CopyAmbient(BakeSettings rhs)
 {
     m_ambientMin = rhs.m_ambientMin;
     m_ambientMax = rhs.m_ambientMax;
     m_colorCube  = new float[24];
     for (int i = 0; i < 24; ++i)
     {
         m_colorCube[i] = rhs.m_colorCube[i];
     }
     m_colorGradient = new float[12];
     for (int i = 0; i < 12; ++i)
     {
         m_colorGradient[i] = rhs.m_colorGradient[i];
     }
     m_colorSolid = new float[4];
     for (int i = 0; i < 4; ++i)
     {
         m_colorSolid[i] = rhs.m_colorSolid[i];
     }
     m_colorMode = rhs.m_colorMode;
 }
Esempio n. 5
0
            public void CopySettings(BakeSettings rhs)
            {
                FieldInfo[] fis = this.GetType().GetFields(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.Instance);
                for (int i = 0; i < fis.Length; ++i)
                {
                    if (fis[i].FieldType == typeof(float[]))
                    {
                        float[] source = fis[i].GetValue(rhs) as float[];
                        float[] copy   = new float[source.Length];
                        for (int j = 0; j < source.Length; ++j)
                        {
                            copy[j] = source[j];
                        }

                        fis[i].SetValue(this, copy);
                    }
                    else
                    {
                        fis[i].SetValue(this, fis[i].GetValue(rhs));
                    }
                }
            }
        public static void DrawShadowAndAOSettings(BakeSettings settings, UnityEngine.Object undoObject = null)
        {
            settings.m_shadowsEnabled = EditorGUILayout.BeginToggleGroup(Styles.m_enableShadows, settings.m_shadowsEnabled);
            {
                EditorGUILayout.BeginHorizontal();
                GUILayout.Space(Styles.kIndent);
                EditorGUILayout.BeginVertical();

                settings.m_lightSamples   = Math.Max(4, EditorGUILayout.IntField(Styles.m_lightblockSamples, settings.m_lightSamples));
                settings.m_rayStartOffset = EditorGUILayout.Slider(Styles.m_lightblockStartOffest, settings.m_rayStartOffset, 0f, 1f);

                EditorGUILayout.EndVertical();
                EditorGUILayout.EndHorizontal();
            }
            EditorGUILayout.EndToggleGroup();

            settings.m_ambientOcclusion = EditorGUILayout.BeginToggleGroup(Styles.m_enableAmbient, settings.m_ambientOcclusion);
            {
                EditorGUILayout.BeginHorizontal();
                GUILayout.Space(Styles.kIndent);
                EditorGUILayout.BeginVertical();

                settings.m_aoForceDoubleSidedGeo = EditorGUILayout.Toggle(Styles.m_aoForceTwoSided, settings.m_aoForceDoubleSidedGeo);
                settings.m_occluderSearchSamples = Math.Max(4, EditorGUILayout.IntField(Styles.m_occluderSamples, settings.m_occluderSearchSamples));
                settings.m_normalBend            = EditorGUILayout.Slider(Styles.m_normalBend, settings.m_normalBend, 0f, 1f);
                settings.m_occluderStartOffset   = Mathf.Max(0f, EditorGUILayout.FloatField(Styles.m_occluderOffset, settings.m_occluderStartOffset));
                settings.m_occlusionRayLength    = Mathf.Max(0f, EditorGUILayout.FloatField(Styles.m_occluderLength, settings.m_occlusionRayLength));

                EditorGUILayout.EndVertical();
                EditorGUILayout.EndHorizontal();
            }
            EditorGUILayout.EndToggleGroup();

            if (undoObject != null)
            {
                Undo.RecordObject(undoObject, undoObject.name + "_BakingUndo");
            }
        }
        public bool DrawColorGradient(Color ground, Color equator, Color sky, bool updateSettings = true)
        {
            bool         changed  = false;
            BakeSettings settings = BakeData.Instance().GetBakeSettings().SelectedBakeSet;

            Color newColor = sky;

            int labelWidth = 90;

            if (DrawCubeColor("Sky Color", labelWidth, sky, out newColor))
            {
                changed = true;
                if (updateSettings)
                {
                    settings.SetColorGradient(GradientIndex.Sky, newColor);
                }
            }
            if (DrawCubeColor("Equator Color", labelWidth, equator, out newColor))
            {
                changed = true;
                if (updateSettings)
                {
                    settings.SetColorGradient(GradientIndex.Equator, newColor);
                }
            }
            if (DrawCubeColor("Ground Color", labelWidth, ground, out newColor))
            {
                changed = true;
                if (updateSettings)
                {
                    settings.SetColorGradient(GradientIndex.Ground, newColor);
                }
            }

            return(changed);
        }
Esempio n. 8
0
 public void AddBakeSettings(BakeSettings settings)
 {
     m_settingsList.Add(settings);
 }
        void OnGUI()
        {
            if (SceneManager.GetActiveScene().name == "")
            {
                GUILayout.Space(50);
                EditorGUILayout.HelpBox("Save the scene to begin baking", MessageType.Info);
                return;
            }

            if (!DaydreamRendererImportSettings.BakingEnabledForScene)
            {
                GUILayout.Space(50);
                EditorGUILayout.HelpBox("Enable vertex baking to use Daydream Static Lighting", MessageType.Info);
                if (GUILayout.Button("Enable Vertex Baking For Scene"))
                {
                    DaydreamRendererImportSettings.BakingEnabledForScene = true;
                }
                return;
            }

            if (!s_settingsRestored)
            {
                BakeData.Instance().SaveBakeSettings();
                s_settingsRestored = true;
            }

            if (Event.current.rawType == EventType.MouseUp)
            {
                if (s_settingsDirty)
                {
                    s_settingsDirty = false;
                    BakeData.Instance().SaveBakeSettings();
                }
            }

            if (s_bakeInProgress)
            {
                if (EditorUtility.DisplayCancelableProgressBar("Daydream Baker", "Baking meshes", VertexBakerLib.Instance.BakeProgress()))
                {
                    VertexBakerLib.Instance.BakeCancel();
                    if (!s_bakeInProgress)
                    {
                        s_bakeIsFinished = true;
                    }
                }

                if (s_bakeIsFinished)
                {
                    s_bakeIsFinished = false;
                    s_bakeInProgress = false;
                    EditorUtility.ClearProgressBar();

                    VertexBakerLib.Instance.BakeFinish(delegate(string msg, float complete)
                    {
                        EditorUtility.DisplayProgressBar("Daydream Baker", msg, complete);
                    });
                    EditorUtility.ClearProgressBar();

                    // queue up next bake
                    if (s_bakeSetQueue.Count > 0)
                    {
                        int bakeSet = s_bakeSetQueue.Dequeue();
                        BakeData.Instance().GetBakeSettings().SetBakeSetIndex(bakeSet);
                        BakeScene();
                    }
                }
            }

            EditorGUI.BeginChangeCheck();

#if DDR_RUNTIME_DLL_LINKING_
            if (GUILayout.Button("Reload Library"))
            {
                if (VertexBakerLib.Instance.LibLoaded)
                {
                    VertexBakerLib.Instance.UnloadLib();
                }
                else
                {
                    VertexBakerLib.Instance.LoadLib();
                }
            }
#endif

            DDRSettings settingsData = BakeData.Instance().GetBakeSettings();

            string[] ids = new string[settingsData.m_settingsList.Count];
            for (int i = 0, k = settingsData.m_settingsList.Count; i < k; ++i)
            {
                ids[i] = settingsData.m_settingsList[i].m_settingsId;
            }

            // update selected data
            GUILayout.Space(20);
            int settingsIndex = -1;
            int selected      = DrawToolBar(settingsData.GetBakeSetIndex(), ids, true, out settingsIndex);

            if (selected >= 0)
            {
                int cur = settingsData.GetBakeSetIndex();
                settingsData.SetBakeSetIndex(selected);

                if (cur != selected)
                {
                    DaydreamVertexLighting.UpdateAllVertexLighting(settingsData.SelectedBakeSet.m_settingsId);
                }
            }

            BakeSettings settings = settingsData.SelectedBakeSet;

            if (selected == Toolbar.kAdd)
            {
                if (!BakeSetDialog.m_active)
                {
                    BakeSetDialog.ShowDialog(delegate(bool result, string name)
                    {
                        if (result)
                        {
                            BakeSettings newSettings = new BakeSettings(name);
                            settingsData.AddBakeSettings(newSettings);
                            EditorUtility.SetDirty(settingsData);
                        }
                    });
                }
            }
            else if (selected == Toolbar.kRemove)
            {
                if (settingsData.m_settingsList.Count > 1)
                {
                    int current = settingsData.GetBakeSetIndex();

                    settingsData.RemoveBakeSetting(current);
                    EditorUtility.SetDirty(settingsData);

                    --current;
                    if (current < 0)
                    {
                        current = 0;
                    }

                    settingsData.SetBakeSetIndex(current);
                    DaydreamVertexLighting.UpdateAllVertexLighting(settingsData.SelectedBakeSet.m_settingsId);
                }
            }
            else if (selected == Toolbar.kSettings)
            {
                if (!BakeSetSettingsDialog.m_active)
                {
                    BakeSettings curSettings = settingsData.m_settingsList[settingsIndex];
                    s_settingsDialog = BakeSetSettingsDialog.ShowDialog(curSettings.m_settingsId, curSettings.m_lightList
                                                                        , curSettings.m_activeSet
                                                                        , curSettings.m_forceAllLights
                                                                        , delegate(BakeSetSettingsDialog.Result result, string bakeSetName, List <LightEntry> selectedLights, bool activeSet, bool forceAllLights)
                    {
                        s_settingsDialog = null;
                        if (settingsData.m_settingsList.Count > 1 && result == BakeSetSettingsDialog.Result.Remove)
                        {
                            settingsData.RemoveBakeSetting(settingsIndex);
                            EditorUtility.SetDirty(settingsData);
                            curSettings = settingsData.m_settingsList[settingsIndex];
                        }
                        else if (result == BakeSetSettingsDialog.Result.Ok)
                        {
                            curSettings.m_settingsId     = bakeSetName;
                            curSettings.m_activeSet      = activeSet;
                            curSettings.m_forceAllLights = forceAllLights;
                            if (selectedLights != null)
                            {
                                // remove empty or stale entries
                                var idsInFile = Utilities.LightsByLocalFileId();
                                selectedLights.RemoveAll(delegate(LightEntry obj){
                                    return(string.IsNullOrEmpty(obj.m_group) && obj.m_idInFile == 0 ||
                                           (!idsInFile.ContainsKey(obj.m_idInFile) &&
                                            (string.IsNullOrEmpty(obj.m_group) || GameObject.Find(obj.m_group) == null)));
                                });

                                curSettings.m_lightList = selectedLights;
                            }
                            EditorUtility.SetDirty(settingsData);
                        }
                    });
                }
                else if (s_settingsDialog != null)
                {
                    s_settingsDialog.CancelDialog();
                }
            }

            DrawShadowAndAOSettings(settings, settingsData);

            //settings.m_diffuseEnergyConservation = EditorGUILayout.Slider("Diffuse Conservation", settings.m_diffuseEnergyConservation, 0f, 1f);

            EditorGUILayout.LabelField(Styles.m_ambientHeader);

            EditorGUILayout.BeginHorizontal();
            GUILayout.Space(Styles.kIndent);
            EditorGUILayout.BeginVertical();

            Color solidColor = settings.GetColorSolid();

            Color gradSky     = settings.GetColorGradient(GradientIndex.Sky);
            Color gradEquator = settings.GetColorGradient(GradientIndex.Equator);
            Color gradGround  = settings.GetColorGradient(GradientIndex.Ground);

            Color posX = settings.GetColorCubeFace(Face.PosX);
            Color posY = settings.GetColorCubeFace(Face.PosY);
            Color posZ = settings.GetColorCubeFace(Face.PosZ);

            Color negX = settings.GetColorCubeFace(Face.NegX);
            Color negY = settings.GetColorCubeFace(Face.NegY);
            Color negZ = settings.GetColorCubeFace(Face.NegZ);

            settings.m_colorMode = (BakeSettings.AmbientColorMode)EditorGUILayout.EnumPopup(Styles.m_ambientSource, settings.m_colorMode);

            // Draw color
            EditorGUILayout.BeginHorizontal();
            {
                //GUILayout.Space(Styles.kIndent);
                EditorGUILayout.BeginVertical();

                if (settings.m_colorMode == BakeSettings.AmbientColorMode.kColorCube)
                {
                    // Check for color value change
                    EditorGUILayout.BeginHorizontal();
                    GUILayout.Space(Styles.kIndent);
                    EditorGUILayout.BeginVertical();

                    DrawColorCube(posX, negX, posY, negY, posZ, negZ);
                    EditorGUILayout.EndVertical();
                    EditorGUILayout.EndHorizontal();
                }
                else if (settings.m_colorMode == BakeSettings.AmbientColorMode.kColorGradient)
                {
                    // Check for color value change
                    EditorGUILayout.BeginHorizontal();
                    GUILayout.Space(Styles.kIndent);
                    EditorGUILayout.BeginVertical();

                    DrawColorGradient(gradGround, gradEquator, gradSky);
                    EditorGUILayout.EndVertical();
                    EditorGUILayout.EndHorizontal();
                }
                else
                {
                    EditorGUILayout.BeginHorizontal();
                    GUILayout.Space(Styles.kIndent);
                    Color c = EditorGUILayout.ColorField(Styles.m_ambientColor, solidColor);
                    EditorGUILayout.EndHorizontal();

                    if (c != solidColor)
                    {
                        settings.SetColorSolid(c);
                    }
                }
                EditorGUILayout.EndVertical();
            }
            EditorGUILayout.EndHorizontal();

            float max = settings.m_ambientMax;
            settings.m_ambientMax = EditorGUILayout.Slider(Styles.m_max, settings.m_ambientMax, 0f, 1f);
            if (!s_maxSliderActive && max != settings.m_ambientMax)
            {
                s_control         = EditorGUIUtility.hotControl;
                s_maxSliderActive = true;
            }
            if (s_maxSliderActive && s_control != EditorGUIUtility.hotControl)
            {
                s_control         = -1;
                s_maxSliderActive = false;
            }

            float min = settings.m_ambientMin;
            settings.m_ambientMin = EditorGUILayout.Slider(Styles.m_min, settings.m_ambientMin, 0f, 1f);
            if (!s_minSliderActive && min != settings.m_ambientMin)
            {
                s_control         = EditorGUIUtility.hotControl;
                s_minSliderActive = true;
            }
            if (s_minSliderActive && s_control != EditorGUIUtility.hotControl)
            {
                s_control         = -1;
                s_minSliderActive = false;
            }

            settings.m_ambientMax = Mathf.Clamp(settings.m_ambientMax, settings.m_ambientMin, 1f);
            settings.m_ambientMin = Mathf.Clamp(settings.m_ambientMin, 0f, settings.m_ambientMax);

            if (s_minSliderActive || s_maxSliderActive)
            {
                Color a = Color.black;
                float t = settings.m_ambientMin;
                if (s_maxSliderActive)
                {
                    t = settings.m_ambientMax;
                }

                if (settings.m_colorMode == BakeSettings.AmbientColorMode.kColorCube)
                {
                    Color px = Color.Lerp(a, posX, t);
                    Color nx = Color.Lerp(a, negX, t);
                    Color py = Color.Lerp(a, posY, t);
                    Color ny = Color.Lerp(a, negY, t);
                    Color pz = Color.Lerp(a, posZ, t);
                    Color nz = Color.Lerp(a, negZ, t);

                    EditorGUILayout.BeginHorizontal();
                    GUILayout.Space(Styles.kIndent);
                    EditorGUILayout.BeginVertical();
                    DrawColorCube(px, nx, py, ny, pz, nz, false);
                    EditorGUILayout.EndVertical();
                    EditorGUILayout.EndHorizontal();
                }
                else
                if (settings.m_colorMode == BakeSettings.AmbientColorMode.kColorGradient)
                {
                    Color sky     = Color.Lerp(a, gradSky, t);
                    Color equator = Color.Lerp(a, gradEquator, t);
                    Color ground  = Color.Lerp(a, gradGround, t);

                    EditorGUILayout.BeginHorizontal();
                    GUILayout.Space(Styles.kIndent);
                    EditorGUILayout.BeginVertical();
                    DrawColorGradient(ground, equator, sky, false);
                    EditorGUILayout.EndVertical();
                    EditorGUILayout.EndHorizontal();
                }
                else
                {
                    Color solid = Color.Lerp(a, solidColor, t);

                    EditorGUILayout.BeginHorizontal();
                    GUILayout.Space(Styles.kIndent);
                    EditorGUILayout.BeginVertical();
                    EditorGUILayout.ColorField(solid);
                    EditorGUILayout.EndVertical();
                    EditorGUILayout.EndHorizontal();
                }
            }

            EditorGUILayout.EndVertical();
            EditorGUILayout.EndHorizontal();

            GUILayout.Space(50);

            if (VertexBakerLib.Instance.BakeInProgress())
            {
                if (GUILayout.Button("Cancel"))
                {
                    VertexBakerLib.Instance.BakeCancel();
                }
            }
            else
            {
                settings.m_bakeAllLightSets = EditorGUILayout.ToggleLeft(Styles.m_bakeAll, settings.m_bakeAllLightSets);

                if (GUILayout.Button("Bake Scene"))
                {
                    if (settings.m_bakeAllLightSets)
                    {
                        // enqueue all bake sets
                        for (int i = 0, k = settingsData.m_settingsList.Count; i < k; ++i)
                        {
                            if (settingsData.m_settingsList[i].m_activeSet)
                            {
                                s_bakeSetQueue.Enqueue(i);
                            }
                        }

                        // set the first bake set
                        if (s_bakeSetQueue.Count > 0)
                        {
                            int bakeSet = s_bakeSetQueue.Dequeue();
                            settingsData.SetBakeSetIndex(bakeSet);
                        }
                    }

                    BakeScene();
                }
            }

            BakeSets bakeSets = BakeData.Instance().GetBakeSets();
            GUILayout.BeginHorizontal();
            GUILayout.FlexibleSpace();
            if (bakeSets.m_containers.Count > 0 && GUILayout.Button(Styles.m_clearAllBakeData, Styles.m_clearButton))
            {
                if (EditorUtility.DisplayDialog(Styles.kEditorTitle, "Clear all data, are you sure?", "Yes", "No"))
                {
                    for (int i = 0, k = bakeSets.m_containers.Count; i < k; ++i)
                    {
                        List <Mesh> meshes = bakeSets.m_containers[i].m_list;
                        for (int j = 0; j < meshes.Count; ++j)
                        {
                            DestroyImmediate(meshes[j], true);
                        }
                    }
                }

                EditorUtility.SetDirty(bakeSets);
                AssetDatabase.SaveAssets();
            }
            GUILayout.EndHorizontal();


            if (EditorGUI.EndChangeCheck())
            {
                s_settingsDirty = true;
                Undo.RecordObject(settingsData, "SettingsUndo");
                //VertexBakerLib.Instance.WriteSettings();
                //VertexBakerLib.Instance.SaveSettings();
            }
        }
        public static void DrawShadowAndAOSettings(BakeSettings settings, UnityEngine.Object undoObject = null, bool enableMinTessellationLevel = false)
        {
            // Tessellation - temporarily disabled

            /*
             * // Tessellation settings
             * settings.m_tessEnabled = EditorGUILayout.BeginToggleGroup(Styles.m_enableTessellation, settings.m_tessEnabled);
             * EditorGUILayout.BeginHorizontal();
             * GUILayout.Space(Styles.kIndent);
             * EditorGUILayout.BeginVertical();
             *
             * EditorGUILayout.BeginHorizontal();
             * settings.m_tessControlLevel = (DDRSettings.TessLevel)EditorGUILayout.EnumPopup("Controls", settings.m_tessControlLevel);
             * if(GUILayout.Button(Styles.m_restoreDefaults, EditorStyles.miniButton))
             * {
             *  if(EditorUtility.DisplayDialog("Tessellation Settings", "Restore defaults, are you sure?", "Yes", "No"))
             *  {
             *      settings.RestoreTessellationDefaults();
             *  }
             * }
             *
             * EditorGUILayout.EndHorizontal();
             *
             * const int maxLevel = 8;
             * if(enableMinTessellationLevel)
             * {
             *  settings.m_minTessIterations = EditorGUILayout.IntSlider(Styles.m_minTessIterations, settings.m_minTessIterations, 0, maxLevel);
             * }
             * settings.m_maxTessIterations = EditorGUILayout.IntSlider(Styles.m_maxTessIterations, settings.m_maxTessIterations, 0, maxLevel);
             * //settings.m_maxTessVertices = EditorGUILayout.IntField(Styles.m_maxTessVertices, settings.m_maxTessVertices);
             *
             * if (settings.m_tessControlLevel == DDRSettings.TessLevel.Advanced || settings.m_tessControlLevel == DDRSettings.TessLevel.VeryAdvanced)
             * {
             *  settings.m_maxShadowSoftTessIterations = EditorGUILayout.IntSlider(Styles.m_tessShadowSoftness, settings.m_maxShadowSoftTessIterations, 0, maxLevel);
             *  settings.m_maxShadowHardTessIterations = EditorGUILayout.IntSlider(Styles.m_tessShadowHardness, settings.m_maxShadowHardTessIterations, 0, maxLevel);
             *  settings.m_maxAOTessIterations = EditorGUILayout.IntSlider(Styles.m_tessAOPasses, settings.m_maxAOTessIterations, 0, maxLevel);
             * }
             *
             * if(settings.m_tessControlLevel == DDRSettings.TessLevel.VeryAdvanced)
             * {
             *  settings.m_intesityThreshold = EditorGUILayout.Slider(Styles.m_lightIntensityThreshold, settings.m_intesityThreshold, 0f, 1f);
             *  settings.m_avgIntensityThreshold = EditorGUILayout.Slider(Styles.m_avgLightIntensityThreshold, settings.m_avgIntensityThreshold, 0f, 1f);
             *  settings.m_accessabilityThreshold = EditorGUILayout.Slider(Styles.m_aoAccessibilityThreshold, settings.m_accessabilityThreshold, 0f, 1f);
             *
             *  EditorGUILayout.MinMaxSlider(Styles.m_surfaceLightThreshold, ref settings.m_surfaceLightThresholdMin, ref settings.m_surfaceLightThresholdMax, 0f, 1f);
             *  EditorGUILayout.BeginHorizontal();
             *  {
             *      GUILayout.Space(20);
             *      EditorGUILayout.BeginVertical();
             *      EditorGUILayout.BeginHorizontal();
             *      settings.m_surfaceLightThresholdMin = EditorGUILayout.FloatField(Styles.m_surfaceLightThresholdMin, settings.m_surfaceLightThresholdMin);
             *      settings.m_surfaceLightThresholdMax = EditorGUILayout.FloatField(Styles.m_surfaceLightThresholdMax, settings.m_surfaceLightThresholdMax);
             *      EditorGUILayout.EndHorizontal();
             *      EditorGUILayout.EndVertical();
             *  }
             *  EditorGUILayout.EndHorizontal();
             * }
             *
             * EditorGUILayout.EndVertical();
             * EditorGUILayout.EndHorizontal();
             * EditorGUILayout.EndToggleGroup();
             * //*/

            settings.m_shadowsEnabled = EditorGUILayout.BeginToggleGroup(Styles.m_enableShadows, settings.m_shadowsEnabled);
            {
                EditorGUILayout.BeginHorizontal();
                GUILayout.Space(Styles.kIndent);
                EditorGUILayout.BeginVertical();

                settings.m_lightSamples   = Math.Max(4, EditorGUILayout.IntField(Styles.m_lightblockSamples, settings.m_lightSamples));
                settings.m_rayStartOffset = EditorGUILayout.Slider(Styles.m_lightblockStartOffest, settings.m_rayStartOffset, 0f, 1f);

                EditorGUILayout.EndVertical();
                EditorGUILayout.EndHorizontal();
            }
            EditorGUILayout.EndToggleGroup();

            settings.m_ambientOcclusion = EditorGUILayout.BeginToggleGroup(Styles.m_enableAmbient, settings.m_ambientOcclusion);
            {
                EditorGUILayout.BeginHorizontal();
                GUILayout.Space(Styles.kIndent);
                EditorGUILayout.BeginVertical();

                settings.m_aoForceDoubleSidedGeo = EditorGUILayout.Toggle(Styles.m_aoForceTwoSided, settings.m_aoForceDoubleSidedGeo);
                settings.m_occluderSearchSamples = Math.Max(4, EditorGUILayout.IntField(Styles.m_occluderSamples, settings.m_occluderSearchSamples));
                settings.m_normalBend            = EditorGUILayout.Slider(Styles.m_normalBend, settings.m_normalBend, 0f, 1f);
                settings.m_occluderStartOffset   = Mathf.Max(0f, EditorGUILayout.FloatField(Styles.m_occluderOffset, settings.m_occluderStartOffset));
                settings.m_occlusionRayLength    = Mathf.Max(0f, EditorGUILayout.FloatField(Styles.m_occluderLength, settings.m_occlusionRayLength));

                EditorGUILayout.EndVertical();
                EditorGUILayout.EndHorizontal();
            }
            EditorGUILayout.EndToggleGroup();

            if (undoObject != null)
            {
                Undo.RecordObject(undoObject, undoObject.name + "_BakingUndo");
            }
        }