Przeglądaj źródła

Build: Updated 'bsf' version

BearishSun 6 lat temu
rodzic
commit
bb08b32bb8

+ 5 - 2
Source/EditorManaged/Inspectors/MaterialInspector.cs

@@ -191,8 +191,9 @@ namespace bs.Editor
                         guiParams.Add(new MaterialParamMat4GUI(param, path, component, mat, layout));
                         guiParams.Add(new MaterialParamMat4GUI(param, path, component, mat, layout));
                         break;
                         break;
                     case ShaderParameterType.Color:
                     case ShaderParameterType.Color:
+                        bool hdr = param.flags.HasFlag(ShaderParameterFlag.HDR);
                         layout.AddSpace(5);
                         layout.AddSpace(5);
-                        guiParams.Add(new MaterialParamColorGUI(param, path, component, mat, layout));
+                        guiParams.Add(new MaterialParamColorGUI(param, path, hdr, component, mat, layout));
                         break;
                         break;
                     case ShaderParameterType.Texture2D:
                     case ShaderParameterType.Texture2D:
                     case ShaderParameterType.Texture3D:
                     case ShaderParameterType.Texture3D:
@@ -887,10 +888,11 @@ namespace bs.Editor
         /// </summary>
         /// </summary>
         /// <param name="shaderParam">Shader parameter to create the GUI for. Must be of color type.</param>
         /// <param name="shaderParam">Shader parameter to create the GUI for. Must be of color type.</param>
         /// <param name="path">Path to the material field in the parent object.</param>
         /// <param name="path">Path to the material field in the parent object.</param>
+        /// <param name="hdr">If true the color supports range outside of [0, 1].</param>
         /// <param name="component">Optional component the material is part of (if any).</param>
         /// <param name="component">Optional component the material is part of (if any).</param>
         /// <param name="material">Material the parameter is a part of.</param>
         /// <param name="material">Material the parameter is a part of.</param>
         /// <param name="layout">Layout to append the GUI elements to.</param>
         /// <param name="layout">Layout to append the GUI elements to.</param>
-        internal MaterialParamColorGUI(ShaderParameter shaderParam, string path, Component component, Material material, 
+        internal MaterialParamColorGUI(ShaderParameter shaderParam, string path, bool hdr, Component component, Material material, 
             GUILayout layout)
             GUILayout layout)
             : base(shaderParam, path, component)
             : base(shaderParam, path, component)
         {
         {
@@ -899,6 +901,7 @@ namespace bs.Editor
             var guiToggle = new GUIToggle(new GUIContent( 
             var guiToggle = new GUIToggle(new GUIContent( 
                 EditorBuiltin.GetEditorToggleIcon(EditorToggleIcon.AnimateProperty), new LocString("Animate")));
                 EditorBuiltin.GetEditorToggleIcon(EditorToggleIcon.AnimateProperty), new LocString("Animate")));
             guiColor = new GUIColorField(title);
             guiColor = new GUIColorField(title);
+            guiColor.AllowHDR = hdr;
             guiColorGradient = new GUIColorGradientHDRField(title);
             guiColorGradient = new GUIColorGradientHDRField(title);
 
 
             bool isAnimated = material.IsAnimated(shaderParam.name);
             bool isAnimated = material.IsAnimated(shaderParam.name);

+ 5 - 4
Source/EditorManaged/Windows/ColorPicker.cs

@@ -12,7 +12,7 @@ namespace bs.Editor
     /// <summary>
     /// <summary>
     /// A color picker window that allows the user to select from a gamut of colors.
     /// A color picker window that allows the user to select from a gamut of colors.
     /// </summary>
     /// </summary>
-    [DefaultSize(270, 400)]
+    [DefaultSize(270, 450)]
     public class ColorPicker : ModalWindow
     public class ColorPicker : ModalWindow
     {
     {
         private const int SliderIndividualWidth = 150;
         private const int SliderIndividualWidth = 150;
@@ -236,11 +236,12 @@ namespace bs.Editor
 
 
             if (hdr)
             if (hdr)
             {
             {
-                guiSliderExposure = new GUISliderH();
+                guiSliderExposure = new GUISliderH("", GUIOption.FixedWidth(100));
                 guiSliderExposure.SetRange(-MaxExposureRange, MaxExposureRange);
                 guiSliderExposure.SetRange(-MaxExposureRange, MaxExposureRange);
                 guiSliderExposure.OnChanged += OnSliderExposureChanged;
                 guiSliderExposure.OnChanged += OnSliderExposureChanged;
                 
                 
                 guiLabelExposure = new GUILabel(new LocEdString("Exposure"));
                 guiLabelExposure = new GUILabel(new LocEdString("Exposure"));
+
                 guiInputExposure = new GUIFloatField();
                 guiInputExposure = new GUIFloatField();
                 guiInputExposure.SetRange(-MaxExposureRange, MaxExposureRange);
                 guiInputExposure.SetRange(-MaxExposureRange, MaxExposureRange);
                 guiInputExposure.OnChanged += OnInputExposureChanged;
                 guiInputExposure.OnChanged += OnInputExposureChanged;
@@ -836,7 +837,7 @@ namespace bs.Editor
             exposure = value;
             exposure = value;
             LDRToHDR();
             LDRToHDR();
 
 
-            guiSliderExposure.Value = value;
+            guiInputExposure.Value = value;
         }
         }
 
 
         /// <summary>
         /// <summary>
@@ -848,7 +849,7 @@ namespace bs.Editor
             exposure = value;
             exposure = value;
             LDRToHDR();
             LDRToHDR();
 
 
-            guiInputExposure.Value = value;
+            guiSliderExposure.Value = value;
         }
         }
 
 
         /// <summary>
         /// <summary>

+ 1 - 1
Source/bsf

@@ -1 +1 @@
-Subproject commit 3473cfb67b10fa3d0e63a32503c65e114c51b2ff
+Subproject commit 25482f672109ecfee6142a03bf0079230f87dc79