فهرست منبع

Refactored post process settings and exposed it to the scripting API

BearishSun 9 سال پیش
والد
کامیت
0a275f2bf2

+ 3 - 0
Build/VS2015/BansheeEngine.vcxproj

@@ -271,6 +271,7 @@
     <ClCompile Include="..\..\Source\BansheeEngine\Source\BsCLight.cpp" />
     <ClCompile Include="..\..\Source\BansheeEngine\Source\BsPlainText.cpp" />
     <ClCompile Include="..\..\Source\BansheeEngine\Source\BsPlainTextImporter.cpp" />
+    <ClCompile Include="..\..\Source\BansheeEngine\Source\BsPostProcessSettings.cpp" />
     <ClCompile Include="..\..\Source\BansheeEngine\Source\BsRenderableHandler.cpp" />
     <ClCompile Include="..\..\Source\BansheeEngine\Source\BsRenderable.cpp" />
     <ClCompile Include="..\..\Source\BansheeEngine\Source\BsRenderer.cpp" />
@@ -318,6 +319,8 @@
     <ClInclude Include="..\..\Source\BansheeEngine\Include\BsPlainText.h" />
     <ClInclude Include="..\..\Source\BansheeEngine\Include\BsPlainTextImporter.h" />
     <ClInclude Include="..\..\Source\BansheeEngine\Include\BsPlainTextRTTI.h" />
+    <ClInclude Include="..\..\Source\BansheeEngine\Include\BsPostProcessSettings.h" />
+    <ClInclude Include="..\..\Source\BansheeEngine\Include\BsPostProcessSettingsRTTI.h" />
     <ClInclude Include="..\..\Source\BansheeEngine\Include\BsRenderableElement.h" />
     <ClInclude Include="..\..\Source\BansheeEngine\Include\BsRenderable.h" />
     <ClInclude Include="..\..\Source\BansheeEngine\Include\BsRenderableRTTI.h" />

+ 9 - 0
Build/VS2015/BansheeEngine.vcxproj.filters

@@ -410,6 +410,12 @@
     <ClInclude Include="..\..\Source\BansheeEngine\Include\BsResourceMappingRTTI.h">
       <Filter>Header Files\RTTI</Filter>
     </ClInclude>
+    <ClInclude Include="..\..\Source\BansheeEngine\Include\BsPostProcessSettings.h">
+      <Filter>Header Files\Renderer</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\Source\BansheeEngine\Include\BsPostProcessSettingsRTTI.h">
+      <Filter>Header Files\RTTI</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <ClCompile Include="..\..\Source\BansheeEngine\Source\BsGUIElement.cpp">
@@ -685,5 +691,8 @@
     <ClCompile Include="..\..\Source\BansheeEngine\Source\BsGameResourceManager.cpp">
       <Filter>Source Files\Resources</Filter>
     </ClCompile>
+    <ClCompile Include="..\..\Source\BansheeEngine\Source\BsPostProcessSettings.cpp">
+      <Filter>Source Files\Renderer</Filter>
+    </ClCompile>
   </ItemGroup>
 </Project>

+ 2 - 0
Build/VS2015/SBansheeEngine.vcxproj

@@ -338,6 +338,7 @@
     <ClInclude Include="..\..\Source\SBansheeEngine\Include\BsScriptPixelUtility.h" />
     <ClInclude Include="..\..\Source\SBansheeEngine\Include\BsScriptPlainText.h" />
     <ClInclude Include="..\..\Source\SBansheeEngine\Include\BsScriptPlaneCollider.h" />
+    <ClInclude Include="..\..\Source\SBansheeEngine\Include\BsScriptPostProcessSettings.h" />
     <ClInclude Include="..\..\Source\SBansheeEngine\Include\BsScriptPrefab.h" />
     <ClInclude Include="..\..\Source\SBansheeEngine\Include\BsScriptProfilerOverlayInternal.h" />
     <ClInclude Include="..\..\Source\SBansheeEngine\Include\BsScriptRenderable.h" />
@@ -463,6 +464,7 @@
     <ClCompile Include="..\..\Source\SBansheeEngine\Source\BsScriptPixelUtility.cpp" />
     <ClCompile Include="..\..\Source\SBansheeEngine\Source\BsScriptPlainText.cpp" />
     <ClCompile Include="..\..\Source\SBansheeEngine\Source\BsScriptPlaneCollider.cpp" />
+    <ClCompile Include="..\..\Source\SBansheeEngine\Source\BsScriptPostProcessSettings.cpp" />
     <ClCompile Include="..\..\Source\SBansheeEngine\Source\BsScriptPrefab.cpp" />
     <ClCompile Include="..\..\Source\SBansheeEngine\Source\BsScriptProfilerOverlayInternal.cpp" />
     <ClCompile Include="..\..\Source\SBansheeEngine\Source\BsScriptRenderable.cpp" />

+ 6 - 0
Build/VS2015/SBansheeEngine.vcxproj.filters

@@ -440,6 +440,9 @@
     <ClInclude Include="..\..\Source\SBansheeEngine\Include\BsScriptResourceRef.h">
       <Filter>Header Files\Wrappers</Filter>
     </ClInclude>
+    <ClInclude Include="..\..\Source\SBansheeEngine\Include\BsScriptPostProcessSettings.h">
+      <Filter>Header Files\Wrappers</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <ClCompile Include="..\..\Source\SBansheeEngine\Source\BsScriptEnginePlugin.cpp">
@@ -811,5 +814,8 @@
     <ClCompile Include="..\..\Source\SBansheeEngine\Source\BsScriptRenderable.cpp">
       <Filter>Source Files\Wrappers</Filter>
     </ClCompile>
+    <ClCompile Include="..\..\Source\SBansheeEngine\Source\BsScriptPostProcessSettings.cpp">
+      <Filter>Source Files\Wrappers</Filter>
+    </ClCompile>
   </ItemGroup>
 </Project>

+ 1 - 1
README.md

@@ -30,4 +30,4 @@ Aside from being a fully featured game engine and toolkit, Banshee also aims to
 # Author
 Banshee was created and is developed by Marko Pintera. The goal of Banshee is to create a high quality open source game engine that is intuitive to use and easy to extend.
 
-I'm happy to connect with other developers, feel free to contact me at [e-mail] (http://scr.im/39d1) or add me on [LinkedIn] (https://goo.gl/t6pPPs). 
+I'm happy to connect with other developers, feel free to contact me at [email protected] or add me on [LinkedIn] (https://goo.gl/t6pPPs). 

+ 248 - 0
Source/BansheeEngine/Include/BsPostProcessSettings.h

@@ -0,0 +1,248 @@
+//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
+//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
+#pragma once
+
+#include "BsPrerequisites.h"
+#include "BsIReflectable.h"
+#include "BsVector3.h"
+
+namespace BansheeEngine
+{
+	/** @addtogroup Renderer
+	 *  @{
+	 */
+
+	/** Settings that control automatic exposure (eye adaptation) post-process. */
+	struct AutoExposureSettings
+	{
+		AutoExposureSettings();
+
+		/**
+		 * Determines minimum luminance value in the eye adaptation histogram. The histogram is used for calculating the
+		 * average brightness of the scene. Any luminance value below this value will not be included in the histogram and
+		 * ignored in scene brightness calculations. In log2 units (-8 = 1/256). In the range [-16, 0].
+		 */
+		float histogramLog2Min;
+
+		/**
+		 * Determines maximum luminance value in the eye adaptation histogram. The histogram is used for calculating the
+		 * average brightness of the scene. Any luminance value above this value will not be included in the histogram and
+		 * ignored in scene brightness calculations. In log2 units (4 = 16). In the range [0, 16].
+		 */
+		float histogramLog2Max;
+
+		/**
+		 * Percentage below which to ignore values in the eye adaptation histogram. The histogram is used for calculating
+		 * the average brightness of the scene. Total luminance in the histogram will be summed up and multiplied by this
+		 * value to calculate minimal luminance. Luminance values below the minimal luminance will be ignored and not used
+		 * in scene brightness calculations. This allows you to remove outliers on the lower end of the histogram (e.g. a
+		 * few very dark pixels in an otherwise bright image). In range [0.0f, 1.0f].
+		 */
+		float histogramPctLow;
+
+		/**
+		 * Percentage above which to ignore values in the eye adaptation histogram. The histogram is used for calculating
+		 * the average brightness of the scene. Total luminance in the histogram will be summed up and multiplied by this
+		 * value to calculate maximum luminance. Luminance values above the maximum luminance will be ignored and not used
+		 * in scene brightness calculations. This allows you to remove outliers on the high end of the histogram (e.g. a few
+		 * very bright pixels). In range [0.0f, 1.0f].
+		 */
+		float histogramPctHigh;
+
+		/**
+		 * Clamps the minimum eye adaptation scale to this value. This allows you to limit eye adaptation so that exposure
+		 * is never too high (e.g. when in a very dark room you probably do not want the exposure to be so high that
+		 * everything is still visible). In range [0.0f, 10.0f].
+		 */
+		float minEyeAdaptation;
+
+		/**
+		 * Clamps the maximum eye adaptation scale to this value. This allows you to limit eye adaptation so that exposure
+		 * is never too low (e.g. when looking at a very bright light source you probably don't want the exposure to be so
+		 * low that the rest of the scene is all white (overexposed). In range [0.0f, 10.0f].
+		 */
+		float maxEyeAdaptation;
+
+		/**
+		 * Determines how quickly does the eye adaptation adjust to larger values. This affects how quickly does the
+		 * automatic exposure changes when the scene brightness increases. In range [0.01f, 20.0f]. 
+		 */
+		float eyeAdaptationSpeedUp;
+
+		/**
+		 * Determines how quickly does the eye adaptation adjust to smaller values. This affects how quickly does the
+		 * automatic exposure changes when the scene brightness decreases. In range [0.01f, 20.0f].
+		 */
+		float eyeAdaptationSpeedDown;
+	};
+
+	/** Settings that control tonemap post-process. */
+	struct TonemappingSettings
+	{
+		TonemappingSettings();
+
+		/**
+		 * Controls the shoulder (upper non-linear) section of the filmic curve used for tonemapping. Mostly affects bright
+		 * areas of the image and allows you to reduce over-exposure.
+		 */
+		float filmicCurveShoulderStrength;
+
+		/**
+		 * Controls the linear (middle) section of the filmic curve used for tonemapping. Mostly affects mid-range areas of
+		 * the image.
+		 */
+		float filmicCurveLinearStrength;
+
+		/**
+		 * Controls the linear (middle) section of the filmic curve used for tonemapping. Mostly affects mid-range areas of
+		 * the image and allows you to control how quickly does the curve climb.
+		 */
+		float filmicCurveLinearAngle;
+
+		/**
+		 * Controls the toe (lower non-linear) section of the filmic curve used for tonemapping. Mostly affects dark areas
+		 * of the image and allows you to reduce under-exposure.
+		 */
+		float filmicCurveToeStrength;
+
+		/** Controls the toe (lower non-linear) section of the filmic curve. used for tonemapping. Affects low-range. */
+		float filmicCurveToeNumerator;
+
+		/** Controls the toe (lower non-linear) section of the filmic curve used for tonemapping. Affects low-range. */
+		float filmicCurveToeDenominator;
+
+		/** Controls the white point of the filmic curve used for tonemapping. Affects the entire curve. */
+		float filmicCurveLinearWhitePoint;
+	};
+
+	/** Settings that control white balance post-process. */
+	struct WhiteBalanceSettings
+	{
+		WhiteBalanceSettings();
+
+		/**
+		 * Temperature used for white balancing, in Kelvins.
+		 *
+		 * Moves along the Planckian locus. In range [1500.0f, 15000.0f].
+		 */
+		float temperature;
+
+		/**
+		 * Additional tint to be applied during white balancing. Can be used to further tweak the white balancing effect by
+		 * modifying the tint of the light. The tint is chosen on the Planckian locus isothermal, depending on the light
+		 * temperature specified by ::temperature.
+		 *
+		 * In range [-1.0f, 1.0f].
+		 */
+		float tint;
+	};
+
+	/** Settings that control color grading post-process. */
+	struct ColorGradingSettings
+	{
+		ColorGradingSettings();
+
+		/**
+		 * Saturation to be applied during color grading. Larger values increase vibrancy of the image.
+		 * In range [0.0f, 2.0f].
+		 */
+		Vector3 saturation;
+
+		/**
+		 * Contrast to be applied during color grading. Larger values increase difference between light and dark areas of
+		 * the image. In range [0.0f, 2.0f]. 
+		 */
+		Vector3 contrast;
+
+		/**
+		 * Gain to be applied during color grading. Simply increases all color values by an equal scale.
+		 * In range [0.0f, 2.0f].
+		 */
+		Vector3 gain;
+
+		/**
+		 * Gain to be applied during color grading. Simply offsets all color values by an equal amount.
+		 * In range [-1.0f, 1.0f].
+		 */
+		Vector3 offset;
+	};
+
+	/** Settings that control the post-process operations. */
+	struct BS_EXPORT PostProcessSettings : IReflectable
+	{
+		PostProcessSettings();
+
+		/**
+		 * Determines should automatic exposure be applied to the HDR image. When turned on the average scene brightness
+		 * will be calculated and used to automatically expose the image to the optimal range. Use the parameters provided
+		 * by ::autoExposure to customize the automatic exposure effect. You may also use ::exposureScale to
+		 * manually adjust the automatic exposure. When automatic exposure is turned off you can use ::exposureScale to
+		 * manually set the exposure.
+		 */
+		bool enableAutoExposure;
+
+		/**
+		 * Parameters used for customizing automatic scene exposure.
+		 *
+		 * @see	enableAutoExposure
+		 */
+		AutoExposureSettings autoExposure;
+
+		/**
+		 * Determines should the image be tonemapped. Tonemapping converts an HDR image into LDR image by applying
+		 * a filmic curve to the image, simulating the effect of film cameras. Filmic curve improves image quality by
+		 * tapering off lows and highs, preventing under- and over-exposure. This is useful if an image contains both
+		 * very dark and very bright areas, in which case the global exposure parameter would leave some areas either over-
+		 * or under-exposed. Use ::tonemapping to customize how tonemapping performed.
+		 *
+		 * If this is disabled, then color grading and white balancing will not be enabled either. Only relevant for HDR
+		 * images.
+		 */
+		bool enableTonemapping;
+
+		/**
+		 * Parameters used for customizing tonemapping.
+		 *
+		 * @see	enableTonemapping
+		 */
+		TonemappingSettings tonemapping;
+
+		/**
+		 * Parameters used for customizing white balancing. White balancing converts a scene illuminated by a light of the
+		 * specified temperature into a scene illuminated by a standard D65 illuminant (average midday light) in order to
+		 * simulate the effects of chromatic adaptation of the human visual system.
+		 */
+		WhiteBalanceSettings whiteBalance;
+
+		/** Parameters used for customizing color grading. */
+		ColorGradingSettings colorGrading;
+
+		/**
+		 * Log2 value to scale the eye adaptation by (e.g. 2^0 = 1). Smaller values yield darker image, while larger yield
+		 * brighter image. Allows you to customize exposure manually, applied on top of eye adaptation exposure (if
+		 * enabled). In range [-8, 8].
+		 */
+		float exposureScale;
+
+		/**
+		 * Gamma value to adjust the image for. Larger values result in a brighter image. When tonemapping is turned
+		 * on the best gamma curve for the output device is chosen automatically and this value can by used to merely tweak
+		 * that curve. If tonemapping is turned off this is the exact value of the gamma curve that will be applied.
+		 */
+		float gamma;
+
+		/** Creates a new post process settings object. */
+		static SPtr<PostProcessSettings> create();
+
+		/************************************************************************/
+		/* 								RTTI		                     		*/
+		/************************************************************************/
+
+	public:
+		friend class PostProcessSettingsRTTI;
+		static RTTITypeBase* getRTTIStatic();
+		RTTITypeBase* getRTTI() const override;
+	};
+
+	/** @} */
+}

+ 65 - 0
Source/BansheeEngine/Include/BsPostProcessSettingsRTTI.h

@@ -0,0 +1,65 @@
+//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
+//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
+#pragma once
+
+#include "BsPrerequisites.h"
+#include "BsRTTIType.h"
+#include "BsPostProcessSettings.h"
+
+namespace BansheeEngine
+{
+	/** @cond RTTI */
+	/** @addtogroup RTTI-Impl-Engine
+	 *  @{
+	 */
+
+	class BS_EXPORT PostProcessSettingsRTTI : public RTTIType <PostProcessSettings, IReflectable, PostProcessSettingsRTTI>
+	{
+	private:
+		BS_PLAIN_MEMBER(enableAutoExposure);
+		BS_PLAIN_MEMBER(autoExposure);
+		BS_PLAIN_MEMBER(enableTonemapping);
+		BS_PLAIN_MEMBER(tonemapping);
+		BS_PLAIN_MEMBER(whiteBalance);
+		BS_PLAIN_MEMBER(colorGrading);
+		BS_PLAIN_MEMBER(exposureScale);
+		BS_PLAIN_MEMBER(gamma);
+
+	public:
+		PostProcessSettingsRTTI()
+		{
+			BS_ADD_PLAIN_FIELD(enableAutoExposure, 0);
+			BS_ADD_PLAIN_FIELD(autoExposure, 1);
+			BS_ADD_PLAIN_FIELD(enableTonemapping, 2);
+			BS_ADD_PLAIN_FIELD(tonemapping, 3);
+			BS_ADD_PLAIN_FIELD(whiteBalance, 4);
+			BS_ADD_PLAIN_FIELD(colorGrading, 5);
+			BS_ADD_PLAIN_FIELD(exposureScale, 6);
+			BS_ADD_PLAIN_FIELD(gamma, 7);
+		}
+
+		const String& getRTTIName() override
+		{
+			static String name = "PostProcessSettings";
+			return name;
+		}
+
+		UINT32 getRTTIId() override
+		{
+			return TID_PostProcessSettings;
+		}
+
+		SPtr<IReflectable> newRTTIObject() override
+		{
+			return PostProcessSettings::create();
+		}
+	};
+
+	BS_ALLOW_MEMCPY_SERIALIZATION(AutoExposureSettings);
+	BS_ALLOW_MEMCPY_SERIALIZATION(WhiteBalanceSettings);
+	BS_ALLOW_MEMCPY_SERIALIZATION(ColorGradingSettings);
+	BS_ALLOW_MEMCPY_SERIALIZATION(TonemappingSettings);
+
+	/** @} */
+	/** @endcond */
+}

+ 2 - 1
Source/BansheeEngine/Include/BsPrerequisites.h

@@ -220,6 +220,7 @@ namespace BansheeEngine
 		TID_Light = 30011,
 		TID_CLight = 30012,
 		TID_GameSettings = 30013,
-		TID_ResourceMapping = 30014
+		TID_ResourceMapping = 30014,
+		TID_PostProcessSettings = 30015
 	};
 }

+ 45 - 0
Source/BansheeEngine/Source/BsPostProcessSettings.cpp

@@ -0,0 +1,45 @@
+//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
+//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
+#include "BsPostProcessSettings.h"
+#include "BsPostProcessSettingsRTTI.h"
+
+namespace BansheeEngine
+{
+	AutoExposureSettings::AutoExposureSettings()
+		: histogramLog2Min(-8.0f), histogramLog2Max(4.0f), histogramPctLow(0.8f), histogramPctHigh(0.985f)
+		, minEyeAdaptation(0.3f), maxEyeAdaptation(2.0f), eyeAdaptationSpeedUp(3.0f), eyeAdaptationSpeedDown(3.0f)
+	{ }
+
+	TonemappingSettings::TonemappingSettings()
+		: filmicCurveShoulderStrength(0.22f), filmicCurveLinearStrength(0.3f), filmicCurveLinearAngle(0.1f)
+		, filmicCurveToeStrength(0.2f), filmicCurveToeNumerator(0.01f), filmicCurveToeDenominator(0.3f)
+		, filmicCurveLinearWhitePoint(11.2f)
+	{ }
+
+	WhiteBalanceSettings::WhiteBalanceSettings()
+		: temperature(6500.0f), tint(0.0f)
+	{ }
+
+	ColorGradingSettings::ColorGradingSettings()
+		: saturation(Vector3::ONE), contrast(Vector3::ONE), gain(Vector3::ONE), offset(Vector3::ZERO)
+	{ }
+
+	PostProcessSettings::PostProcessSettings()
+		: enableAutoExposure(true), enableTonemapping(true), exposureScale(0.0f), gamma(2.2f)
+	{ }
+
+	SPtr<PostProcessSettings> PostProcessSettings::create()
+	{
+		return bs_shared_ptr_new<PostProcessSettings>();
+	}
+
+	RTTITypeBase* PostProcessSettings::getRTTIStatic()
+	{
+		return PostProcessSettingsRTTI::instance();
+	}
+
+	RTTITypeBase* PostProcessSettings::getRTTI() const
+	{
+		return PostProcessSettings::getRTTIStatic();
+	}
+}

+ 3 - 0
Source/BansheeMono/Include/BsMonoClass.h

@@ -124,6 +124,9 @@ namespace BansheeEngine
 		/**	Checks is the provided object instance of this class' type. */
 		bool isInstanceOfType(MonoObject* object) const;
 
+		/** Returns the size of an instance of this class, in bytes. */
+		UINT32 getInstanceSize() const;
+
 		/**
 		 * Shortcut for invoking a method on a class. Invokes a method with the provided name and number of parameters.
 		 *

+ 10 - 0
Source/BansheeMono/Source/BsMonoClass.cpp

@@ -326,4 +326,14 @@ namespace BansheeEngine
 		::MonoClass* monoClass = mono_object_get_class(object);
 		return mono_class_is_subclass_of(monoClass, mClass, false) != 0;
 	}
+
+	UINT32 MonoClass::getInstanceSize() const
+	{
+		UINT32 dummy = 0;
+
+		if (mono_class_is_valuetype(mClass))
+			return mono_class_value_size(mClass, &dummy);
+		
+		return mono_class_instance_size(mClass);
+	}
 }

+ 354 - 0
Source/MBansheeEditor/Inspectors/PostProcessSettingsInspector.cs

@@ -0,0 +1,354 @@
+//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
+//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
+using System;
+using BansheeEngine;
+
+namespace BansheeEditor
+{
+    /** @addtogroup Inspectors
+     *  @{
+     */
+
+    /// <summary>
+    /// Draws GUI elements for inspecting an <see cref="AutoExposureSettings"/> object.
+    /// </summary>
+    internal class AutoExposureSettingsGUI
+    {
+        private AutoExposureSettings settings;
+
+        private GUISliderField histogramLog2MinField = new GUISliderField(-16.0f, 0.0f, new LocEdString("Histogram min."));
+        private GUISliderField histogramLog2MaxField = new GUISliderField(0.0f, 16.0f, new LocEdString("Histogram max."));
+        private GUISliderField histogramPctLowField = new GUISliderField(0.0f, 1.0f, new LocEdString("Histogram % low"));
+        private GUISliderField histogramPctHighField = new GUISliderField(0.0f, 1.0f, new LocEdString("Histogram % high"));
+        private GUISliderField minEyeAdaptationField = new GUISliderField(0.0f, 10.0f, new LocEdString("Min. eye adapatation"));
+        private GUISliderField maxEyeAdaptationField = new GUISliderField(0.0f, 10.0f, new LocEdString("Max. eye adapatation"));
+        private GUISliderField eyeAdaptationSpeedUpField = new GUISliderField(0.01f, 20.0f, new LocEdString("Eye adaptation speed up"));
+        private GUISliderField eyeAdaptationSpeedDownField = new GUISliderField(0.01f, 20.0f, new LocEdString("Eye adaptation speed down"));
+
+        public Action<AutoExposureSettings> OnChanged;
+        public Action OnConfirmed;
+
+        /// <summary>
+        /// Current value of the settings object.
+        /// </summary>
+        public AutoExposureSettings Settings
+        {
+            get { return settings; }
+            set
+            {
+                settings = value;
+
+                histogramLog2MinField.Value = value.HistogramLog2Min;
+                histogramLog2MaxField.Value = value.HistogramLog2Max;
+
+                histogramPctLowField.Value = value.HistogramPctLow;
+                histogramPctHighField.Value = value.HistogramPctHigh;
+
+                minEyeAdaptationField.Value = value.MinEyeAdaptation;
+                maxEyeAdaptationField.Value = value.MaxEyeAdaptation;
+
+                eyeAdaptationSpeedUpField.Value = value.EyeAdaptationSpeedUp;
+                eyeAdaptationSpeedDownField.Value = value.EyeAdaptationSpeedDown;
+            }
+        }
+
+        /// <summary>
+        /// Constructs a new set of GUI elements for inspecting the auto exposure settings object.
+        /// </summary>
+        /// <param name="settings">Initial values to assign to the GUI elements.</param>
+        /// <param name="layout">Layout to append the GUI elements to.</param>
+        public AutoExposureSettingsGUI(AutoExposureSettings settings, GUILayout layout)
+        {
+            this.settings = settings;
+
+            histogramLog2MinField.OnChanged += x => { settings.HistogramLog2Min = x; MarkAsModified(); ConfirmModify(); };
+            histogramLog2MaxField.OnChanged += x => { settings.HistogramLog2Max = x; MarkAsModified(); ConfirmModify(); };
+            histogramPctLowField.OnChanged += x => { settings.HistogramPctLow = x; MarkAsModified(); ConfirmModify(); };
+            histogramPctHighField.OnChanged += x => { settings.HistogramPctHigh = x; MarkAsModified(); ConfirmModify(); };
+            minEyeAdaptationField.OnChanged += x => { settings.MinEyeAdaptation = x; MarkAsModified(); ConfirmModify(); };
+            maxEyeAdaptationField.OnChanged += x => { settings.MaxEyeAdaptation = x; MarkAsModified(); ConfirmModify(); };
+            eyeAdaptationSpeedUpField.OnChanged += x => { settings.EyeAdaptationSpeedUp = x; MarkAsModified(); ConfirmModify(); };
+            eyeAdaptationSpeedDownField.OnChanged += x => { settings.EyeAdaptationSpeedDown = x; MarkAsModified(); ConfirmModify(); };
+
+            layout.AddElement(histogramLog2MinField);
+            layout.AddElement(histogramLog2MaxField);
+            layout.AddElement(histogramPctLowField);
+            layout.AddElement(histogramPctHighField);
+            layout.AddElement(minEyeAdaptationField);
+            layout.AddElement(maxEyeAdaptationField);
+            layout.AddElement(eyeAdaptationSpeedUpField);
+            layout.AddElement(eyeAdaptationSpeedDownField);
+        }
+
+        /// <summary>
+        /// Marks the contents of the inspector as modified.
+        /// </summary>
+        private void MarkAsModified()
+        {
+            if (OnChanged != null)
+                OnChanged(settings);
+        }
+
+        /// <summary>
+        /// Confirms any queued modifications.
+        /// </summary>
+        private void ConfirmModify()
+        {
+            if (OnConfirmed != null)
+                OnConfirmed();
+        }
+    }
+
+    /// <summary>
+    /// Draws GUI elements for inspecting an <see cref="TonemappingSettings"/> object.
+    /// </summary>
+    internal class TonemappingSettingsGUI
+    {
+        private TonemappingSettings settings;
+
+        private GUIFloatField shoulderStrengthField = new GUIFloatField(new LocEdString("Shoulder strength"));
+        private GUIFloatField linearStrengthField = new GUIFloatField(new LocEdString("Linear strength"));
+        private GUIFloatField linearAngleField = new GUIFloatField(new LocEdString("Linear angle"));
+        private GUIFloatField toeStrengthField = new GUIFloatField(new LocEdString("Toe strength"));
+        private GUIFloatField toeNumeratorField = new GUIFloatField(new LocEdString("Toe numerator"));
+        private GUIFloatField toeDenominatorField = new GUIFloatField(new LocEdString("Toe denominator"));
+        private GUIFloatField whitePointField = new GUIFloatField(new LocEdString("White point"));
+
+        public Action<TonemappingSettings> OnChanged;
+        public Action OnConfirmed;
+
+        /// <summary>
+        /// Current value of the settings object.
+        /// </summary>
+        public TonemappingSettings Settings
+        {
+            get { return settings; }
+            set
+            {
+                settings = value;
+
+                shoulderStrengthField.Value = value.FilmicCurveShoulderStrength;
+                linearStrengthField.Value = value.FilmicCurveLinearStrength;
+
+                linearAngleField.Value = value.FilmicCurveLinearAngle;
+                toeStrengthField.Value = value.FilmicCurveToeStrength;
+
+                toeNumeratorField.Value = value.FilmicCurveToeNumerator;
+                toeDenominatorField.Value = value.FilmicCurveToeDenominator;
+
+                whitePointField.Value = value.FilmicCurveLinearWhitePoint;
+            }
+        }
+
+        /// <summary>
+        /// Constructs a new set of GUI elements for inspecting the auto exposure settings object.
+        /// </summary>
+        /// <param name="settings">Initial values to assign to the GUI elements.</param>
+        /// <param name="layout">Layout to append the GUI elements to.</param>
+        public TonemappingSettingsGUI(TonemappingSettings settings, GUILayout layout)
+        {
+            this.settings = settings;
+
+            shoulderStrengthField.OnChanged += x => { settings.FilmicCurveShoulderStrength = x; MarkAsModified(); };
+            shoulderStrengthField.OnFocusLost += ConfirmModify;
+            shoulderStrengthField.OnConfirmed += ConfirmModify;
+
+            linearStrengthField.OnChanged += x => { settings.FilmicCurveLinearStrength = x; MarkAsModified(); };
+            linearStrengthField.OnFocusLost += ConfirmModify;
+            linearStrengthField.OnConfirmed += ConfirmModify;
+
+            linearAngleField.OnChanged += x => { settings.FilmicCurveLinearAngle = x; MarkAsModified(); };
+            linearAngleField.OnFocusLost += ConfirmModify;
+            linearAngleField.OnConfirmed += ConfirmModify;
+
+            toeStrengthField.OnChanged += x => { settings.FilmicCurveToeStrength = x; MarkAsModified(); };
+            toeStrengthField.OnFocusLost += ConfirmModify;
+            toeStrengthField.OnConfirmed += ConfirmModify;
+
+            toeNumeratorField.OnChanged += x => { settings.FilmicCurveToeNumerator = x; MarkAsModified(); };
+            toeNumeratorField.OnFocusLost += ConfirmModify;
+            toeNumeratorField.OnConfirmed += ConfirmModify;
+
+            toeDenominatorField.OnChanged += x => { settings.FilmicCurveToeDenominator = x; MarkAsModified(); };
+            toeDenominatorField.OnFocusLost += ConfirmModify;
+            toeDenominatorField.OnConfirmed += ConfirmModify;
+
+            whitePointField.OnChanged += x => { settings.FilmicCurveLinearWhitePoint = x; MarkAsModified(); };
+            whitePointField.OnFocusLost += ConfirmModify;
+            whitePointField.OnConfirmed += ConfirmModify;
+
+            layout.AddElement(shoulderStrengthField);
+            layout.AddElement(linearStrengthField);
+            layout.AddElement(linearAngleField);
+            layout.AddElement(toeStrengthField);
+            layout.AddElement(toeNumeratorField);
+            layout.AddElement(toeDenominatorField);
+            layout.AddElement(whitePointField);
+        }
+
+        /// <summary>
+        /// Marks the contents of the inspector as modified.
+        /// </summary>
+        private void MarkAsModified()
+        {
+            if (OnChanged != null)
+                OnChanged(settings);
+        }
+
+        /// <summary>
+        /// Confirms any queued modifications.
+        /// </summary>
+        private void ConfirmModify()
+        {
+            if (OnConfirmed != null)
+                OnConfirmed();
+        }
+    }
+
+    /// <summary>
+    /// Draws GUI elements for inspecting an <see cref="ColorGradingSettings"/> object.
+    /// </summary>
+    internal class ColorGradingSettingssGUI
+    {
+        private ColorGradingSettings settings;
+
+        private GUIVector3Field saturationField = new GUIVector3Field(new LocEdString("Saturation"));
+        private GUIVector3Field contrastField = new GUIVector3Field(new LocEdString("Contrast"));
+        private GUIVector3Field gainField = new GUIVector3Field(new LocEdString("Gain"));
+        private GUIVector3Field offsetField = new GUIVector3Field(new LocEdString("Offset"));
+
+        public Action<ColorGradingSettings> OnChanged;
+        public Action OnConfirmed;
+
+        /// <summary>
+        /// Current value of the settings object.
+        /// </summary>
+        public ColorGradingSettings Settings
+        {
+            get { return settings; }
+            set
+            {
+                settings = value;
+
+                saturationField.Value = value.Saturation;
+                contrastField.Value = value.Contrast;
+                gainField.Value = value.Gain;
+                offsetField.Value = value.Offset;
+            }
+        }
+
+        /// <summary>
+        /// Constructs a new set of GUI elements for inspecting the auto exposure settings object.
+        /// </summary>
+        /// <param name="settings">Initial values to assign to the GUI elements.</param>
+        /// <param name="layout">Layout to append the GUI elements to.</param>
+        public ColorGradingSettingssGUI(ColorGradingSettings settings, GUILayout layout)
+        {
+            this.settings = settings;
+
+            saturationField.OnChanged += x => { settings.Saturation = x; MarkAsModified(); };
+            saturationField.OnFocusLost += ConfirmModify;
+            saturationField.OnConfirmed += ConfirmModify;
+
+            contrastField.OnChanged += x => { settings.Contrast = x; MarkAsModified(); };
+            contrastField.OnFocusLost += ConfirmModify;
+            contrastField.OnConfirmed += ConfirmModify;
+
+            gainField.OnChanged += x => { settings.Gain = x; MarkAsModified(); };
+            gainField.OnFocusLost += ConfirmModify;
+            gainField.OnConfirmed += ConfirmModify;
+
+            offsetField.OnChanged += x => { settings.Offset = x; MarkAsModified(); };
+            offsetField.OnFocusLost += ConfirmModify;
+            offsetField.OnConfirmed += ConfirmModify;
+
+            layout.AddElement(saturationField);
+            layout.AddElement(contrastField);
+            layout.AddElement(gainField);
+            layout.AddElement(offsetField);
+        }
+
+        /// <summary>
+        /// Marks the contents of the inspector as modified.
+        /// </summary>
+        private void MarkAsModified()
+        {
+            if (OnChanged != null)
+                OnChanged(settings);
+        }
+
+        /// <summary>
+        /// Confirms any queued modifications.
+        /// </summary>
+        private void ConfirmModify()
+        {
+            if (OnConfirmed != null)
+                OnConfirmed();
+        }
+    }
+
+    /// <summary>
+    /// Draws GUI elements for inspecting an <see cref="WhiteBalanceSettings"/> object.
+    /// </summary>
+    internal class WhiteBalanceSettingsGUI
+    {
+        private WhiteBalanceSettings settings;
+
+        private GUISliderField temperatureField = new GUISliderField(1500.0f, 15000.0f, new LocEdString("Temperature"));
+        private GUISliderField tintField = new GUISliderField(-1.0f, 1.0f, new LocEdString("Tint"));
+
+        public Action<WhiteBalanceSettings> OnChanged;
+        public Action OnConfirmed;
+
+        /// <summary>
+        /// Current value of the settings object.
+        /// </summary>
+        public WhiteBalanceSettings Settings
+        {
+            get { return settings; }
+            set
+            {
+                settings = value;
+
+                temperatureField.Value = value.Temperature;
+                tintField.Value = value.Tint;
+            }
+        }
+
+        /// <summary>
+        /// Constructs a new set of GUI elements for inspecting the auto exposure settings object.
+        /// </summary>
+        /// <param name="settings">Initial values to assign to the GUI elements.</param>
+        /// <param name="layout">Layout to append the GUI elements to.</param>
+        public WhiteBalanceSettingsGUI(WhiteBalanceSettings settings, GUILayout layout)
+        {
+            this.settings = settings;
+
+            temperatureField.OnChanged += x => { settings.Temperature = x; MarkAsModified(); ConfirmModify(); };
+            tintField.OnChanged += x => { settings.Tint = x; MarkAsModified(); ConfirmModify(); };
+
+            layout.AddElement(temperatureField);
+            layout.AddElement(tintField);
+        }
+
+        /// <summary>
+        /// Marks the contents of the inspector as modified.
+        /// </summary>
+        private void MarkAsModified()
+        {
+            if (OnChanged != null)
+                OnChanged(settings);
+        }
+
+        /// <summary>
+        /// Confirms any queued modifications.
+        /// </summary>
+        private void ConfirmModify()
+        {
+            if (OnConfirmed != null)
+                OnConfirmed();
+        }
+    }
+
+    /** @} */
+}

+ 1 - 0
Source/MBansheeEditor/MBansheeEditor.csproj

@@ -40,6 +40,7 @@
     <Reference Include="System.Xml" />
   </ItemGroup>
   <ItemGroup>
+    <Compile Include="Inspectors\PostProcessSettingsInspector.cs" />
     <Compile Include="Windows\AboutBox.cs" />
     <Compile Include="Windows\BrowseDialog.cs" />
     <Compile Include="Windows\Build\BuildManager.cs" />

+ 1 - 0
Source/MBansheeEngine/MBansheeEngine.csproj

@@ -43,6 +43,7 @@
     <Reference Include="System.Xml" />
   </ItemGroup>
   <ItemGroup>
+    <Compile Include="Rendering\PostProcessSettings.cs" />
     <Compile Include="Utility\AsyncOp.cs" />
     <Compile Include="Math\Bounds.cs" />
     <Compile Include="Utility\Builtin.cs" />

+ 344 - 0
Source/MBansheeEngine/Rendering/PostProcessSettings.cs

@@ -0,0 +1,344 @@
+//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
+//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
+using System;
+using System.Runtime.CompilerServices;
+
+namespace BansheeEngine
+{
+    /// <summary>
+    /// Settings that control automatic exposure (eye adaptation) post-process.
+    /// </summary>
+    struct AutoExposureSettings // Note: Must match C++ struct AutoExposureSettings
+    {
+        /// <summary>
+        /// Determines minimum luminance value in the eye adaptation histogram. The histogram is used for calculating the
+        /// average brightness of the scene.Any luminance value below this value will not be included in the histogram and
+        /// ignored in scene brightness calculations. In log2 units (-8 = 1/256). In the range [-16, 0].
+        /// </summary>
+        public float HistogramLog2Min;
+
+        /// <summary>
+        /// Determines maximum luminance value in the eye adaptation histogram. The histogram is used for calculating the
+        /// average brightness of the scene.Any luminance value above this value will not be included in the histogram and
+        /// ignored in scene brightness calculations. In log2 units (4 = 16). In the range [0, 16].
+        /// </summary>
+        public float HistogramLog2Max;
+
+        /// <summary>
+        /// Percentage below which to ignore values in the eye adaptation histogram. The histogram is used for calculating
+        /// the average brightness of the scene.Total luminance in the histogram will be summed up and multiplied by this
+        /// value to calculate minimal luminance. Luminance values below the minimal luminance will be ignored and not used
+        /// in scene brightness calculations.This allows you to remove outliers on the lower end of the histogram (e.g. a
+        /// few very dark pixels in an otherwise bright image). In range [0.0f, 1.0f].
+        /// </summary>
+        public float HistogramPctLow;
+
+        /// <summary>
+        /// Percentage above which to ignore values in the eye adaptation histogram. The histogram is used for calculating
+        /// the average brightness of the scene.Total luminance in the histogram will be summed up and multiplied by this
+        /// value to calculate maximum luminance. Luminance values above the maximum luminance will be ignored and not used
+        /// in scene brightness calculations.This allows you to remove outliers on the high end of the histogram (e.g. a few
+        /// very bright pixels). In range [0.0f, 1.0f].
+        /// </summary>
+        public float HistogramPctHigh;
+
+        /// <summary>
+        /// Clamps the minimum eye adaptation scale to this value. This allows you to limit eye adaptation so that exposure
+        /// is never too high (e.g. when in a very dark room you probably do not want the exposure to be so high that
+        /// everything is still visible). In range [0.0f, 10.0f].
+        /// </summary>
+        public float MinEyeAdaptation;
+
+        /// <summary>
+        /// Clamps the maximum eye adaptation scale to this value. This allows you to limit eye adaptation so that exposure
+        /// is never too low (e.g. when looking at a very bright light source you probably don't want the exposure to be so
+        /// low that the rest of the scene is all white (overexposed). In range [0.0f, 10.0f].
+        /// </summary>
+        public float MaxEyeAdaptation;
+
+        /// <summary>
+        /// Determines how quickly does the eye adaptation adjust to larger values. This affects how quickly does the
+        /// automatic exposure changes when the scene brightness increases. In range [0.01f, 20.0f].
+        /// </summary>
+        public float EyeAdaptationSpeedUp;
+
+        /// <summary>
+        /// Determines how quickly does the eye adaptation adjust to smaller values. This affects how quickly does the
+        /// automatic exposure changes when the scene brightness decreases. In range [0.01f, 20.0f].
+        /// </summary>
+        public float EyeAdaptationSpeedDown;
+    };
+
+    /// <summary>
+    /// Settings that control tonemap post-process.
+    /// </summary>
+    struct TonemappingSettings // Note: Must match C++ struct TonemappingSettings
+    {
+        /// <summary>
+        /// Controls the shoulder (upper non-linear) section of the filmic curve used for tonemapping. Mostly affects bright
+        /// areas of the image and allows you to reduce over-exposure.
+        /// </summary>
+        public float FilmicCurveShoulderStrength;
+
+        /// <summary>
+        /// Controls the linear (middle) section of the filmic curve used for tonemapping. Mostly affects mid-range areas of
+        /// the image.
+        /// </summary>
+        public float FilmicCurveLinearStrength;
+
+        /// <summary>
+        /// Controls the linear (middle) section of the filmic curve used for tonemapping. Mostly affects mid-range areas of
+        /// the image and allows you to control how quickly does the curve climb.
+        /// </summary>
+        public float FilmicCurveLinearAngle;
+
+        /// <summary>
+        /// Controls the toe (lower non-linear) section of the filmic curve used for tonemapping. Mostly affects dark areas
+        /// of the image and allows you to reduce under-exposure.
+        /// </summary>
+        public float FilmicCurveToeStrength;
+
+        /// <summary>
+        /// Controls the toe (lower non-linear) section of the filmic curve. used for tonemapping. Affects low-range.
+        /// </summary>
+        public float FilmicCurveToeNumerator;
+
+        /// <summary>
+        /// Controls the toe (lower non-linear) section of the filmic curve used for tonemapping. Affects low-range.
+        /// </summary>
+        public float FilmicCurveToeDenominator;
+
+        /// <summary>
+        /// Controls the white point of the filmic curve used for tonemapping. Affects the entire curve.
+        /// </summary>
+        public float FilmicCurveLinearWhitePoint;
+    };
+
+    /// <summary>
+    /// Settings that control white balance post-process.
+    /// </summary>
+    struct WhiteBalanceSettings // Note: Must match C++ struct WhiteBalanceSettings
+    {
+        /// <summary>
+        /// Temperature used for white balancing, in Kelvins.
+        /// 
+        /// Moves along the Planckian locus. In range [1500.0f, 15000.0f].
+        /// </summary>
+        public float Temperature;
+
+        /// <summary>
+        /// Additional tint to be applied during white balancing. Can be used to further tweak the white balancing effect by
+        /// modifying the tint of the light.The tint is chosen on the Planckian locus isothermal, depending on the light
+        /// temperature specified by <see cref="Temperature"/>.
+        /// 
+        /// In range [-1.0f, 1.0f].
+        /// </summary>
+        public float Tint;
+    };
+
+    /// <summary>
+    /// Settings that control color grading post-process.
+    /// </summary>
+    struct ColorGradingSettings // Note: Must match C++ struct ColorGradingSettings
+    {
+        /// <summary>
+        /// Saturation to be applied during color grading. Larger values increase vibrancy of the image. 
+        /// In range [0.0f, 2.0f].
+        /// </summary>
+        public Vector3 Saturation;
+
+        /// <summary>
+        /// Contrast to be applied during color grading. Larger values increase difference between light and dark areas of
+        /// the image. In range [0.0f, 2.0f]. 
+        /// </summary>
+        public Vector3 Contrast;
+
+        /// <summary>
+        /// Gain to be applied during color grading. Simply increases all color values by an equal scale. 
+        /// In range [0.0f, 2.0f].
+        /// </summary>
+        public Vector3 Gain;
+
+        /// <summary>
+        /// Gain to be applied during color grading. Simply offsets all color values by an equal amount.
+        /// In range [-1.0f, 1.0f].
+        /// </summary>
+        public Vector3 Offset;
+    };
+
+    /// <summary>
+    /// Settings that control the post-process operations.
+    /// </summary>
+    class PostProcessSettings : ScriptObject
+    {
+        public PostProcessSettings()
+        {
+            Internal_CreateInstance(this);
+        }
+
+        /// <summary>
+        /// Determines should automatic exposure be applied to the HDR image. When turned on the average scene brightness
+        /// will be calculated and used to automatically expose the image to the optimal range. Use the parameters provided
+        /// by <see cref="AutoExposure"/> to customize the automatic exposure effect.You may also use 
+        /// <see cref="ExposureScale"/> to manually adjust the automatic exposure. When automatic exposure is turned off you
+        /// can use <see cref="ExposureScale"/> to manually set the exposure.
+        /// </summary>
+        public bool EnableAutoExposure
+        {
+            get { return Internal_GetEnableAutoExposure(mCachedPtr); }
+            set { Internal_SetEnableAutoExposure(mCachedPtr, value); }
+        }
+
+        /// <summary>
+        /// Parameters used for customizing automatic scene exposure. <see cref="EnableAutoExposure"/>
+        /// </summary>
+        public AutoExposureSettings AutoExposure
+        {
+            get
+            {
+                AutoExposureSettings output;
+                Internal_GetAutoExposureSettings(mCachedPtr, out output);
+
+                return output;
+            }
+
+            set { Internal_SetAutoExposureSettings(mCachedPtr, ref value); }
+        }
+
+        /// <summary>
+        /// Determines should the image be tonemapped. Tonemapping converts an HDR image into LDR image by applying
+        /// a filmic curve to the image, simulating the effect of film cameras.Filmic curve improves image quality by
+        /// tapering off lows and highs, preventing under- and over-exposure.This is useful if an image contains both
+        /// very dark and very bright areas, in which case the global exposure parameter would leave some areas either over-
+        /// or under-exposed.Use ::tonemapping to customize how tonemapping performed.
+        /// 
+        /// If this is disabled, then color grading and white balancing will not be enabled either.Only relevant for HDR
+        /// images.
+        /// </summary>
+        public bool EnableTonemapping
+        {
+            get { return Internal_GetEnableTonemapping(mCachedPtr); }
+            set { Internal_SetEnableTonemapping(mCachedPtr, value); }
+        }
+
+        /// <summary>
+        /// Parameters used for customizing tonemapping. <see cref="EnableTonemapping"/>
+        /// </summary>
+        public TonemappingSettings Tonemapping
+        {
+            get
+            {
+                TonemappingSettings output;
+                Internal_GetTonemappingSettings(mCachedPtr, out output);
+
+                return output;
+            }
+            set { Internal_SetTonemappingSettings(mCachedPtr, ref value); }
+        }
+
+        /// <summary>
+        /// Parameters used for customizing white balancing. White balancing converts a scene illuminated by a light of the
+        /// specified temperature into a scene illuminated by a standard D65 illuminant (average midday light) in order to
+        /// simulate the effects of chromatic adaptation of the human visual system.
+        /// </summary>
+        public WhiteBalanceSettings WhiteBalance
+        {
+            get
+            {
+                WhiteBalanceSettings output;
+                Internal_GetWhiteBalanceSettings(mCachedPtr, out output);
+
+                return output;
+            }
+            set { Internal_SetWhiteBalanceSettings(mCachedPtr, ref value); }
+        }
+
+        /// <summary>
+        /// Parameters used for customizing color grading.
+        /// </summary>
+        public ColorGradingSettings ColorGrading
+        {
+            get
+            {
+                ColorGradingSettings output;
+                Internal_GetColorGradingSettings(mCachedPtr, out output);
+
+                return output;
+            }
+            set { Internal_SetColorGradingSettings(mCachedPtr, ref value); }
+        }
+
+        /// <summary>
+        /// Log2 value to scale the eye adaptation by (e.g. 2^0 = 1). Smaller values yield darker image, while larger yield
+        /// brighter image.Allows you to customize exposure manually, applied on top of eye adaptation exposure (if
+        /// enabled). In range [-8, 8].
+        /// </summary>
+        public float ExposureScale
+        {
+            get { return Internal_GetExposureScale(mCachedPtr); }
+            set { Internal_SetExposureScale(mCachedPtr, value); }
+        }
+
+        /// <summary>
+        /// Gamma value to adjust the image for. Larger values result in a brighter image. When tonemapping is turned
+        /// on the best gamma curve for the output device is chosen automatically and this value can by used to merely tweak
+        /// that curve. If tonemapping is turned off this is the exact value of the gamma curve that will be applied.
+        /// </summary>
+        public float Gamma
+        {
+            get { return Internal_GetGamma(mCachedPtr); }
+            set { Internal_SetGamma(mCachedPtr, value); }
+        }
+
+        [MethodImpl(MethodImplOptions.InternalCall)]
+        private static extern void Internal_CreateInstance(PostProcessSettings managedInstance);
+
+        [MethodImpl(MethodImplOptions.InternalCall)]
+        private static extern bool Internal_GetEnableAutoExposure(IntPtr thisPtr);
+
+        [MethodImpl(MethodImplOptions.InternalCall)]
+        private static extern void Internal_SetEnableAutoExposure(IntPtr thisPtr, bool value);
+
+        [MethodImpl(MethodImplOptions.InternalCall)]
+        private static extern void Internal_GetAutoExposureSettings(IntPtr thisPtr, out AutoExposureSettings value);
+
+        [MethodImpl(MethodImplOptions.InternalCall)]
+        private static extern void Internal_SetAutoExposureSettings(IntPtr thisPtr, ref AutoExposureSettings value);
+
+        [MethodImpl(MethodImplOptions.InternalCall)]
+        private static extern bool Internal_GetEnableTonemapping(IntPtr thisPtr);
+
+        [MethodImpl(MethodImplOptions.InternalCall)]
+        private static extern void Internal_SetEnableTonemapping(IntPtr thisPtr, bool value);
+
+        [MethodImpl(MethodImplOptions.InternalCall)]
+        private static extern void Internal_GetTonemappingSettings(IntPtr thisPtr, out TonemappingSettings value);
+
+        [MethodImpl(MethodImplOptions.InternalCall)]
+        private static extern void Internal_SetTonemappingSettings(IntPtr thisPtr, ref TonemappingSettings value);
+
+        [MethodImpl(MethodImplOptions.InternalCall)]
+        private static extern void Internal_GetWhiteBalanceSettings(IntPtr thisPtr, out WhiteBalanceSettings value);
+
+        [MethodImpl(MethodImplOptions.InternalCall)]
+        private static extern void Internal_SetWhiteBalanceSettings(IntPtr thisPtr, ref WhiteBalanceSettings value);
+
+        [MethodImpl(MethodImplOptions.InternalCall)]
+        private static extern void Internal_GetColorGradingSettings(IntPtr thisPtr, out ColorGradingSettings value);
+
+        [MethodImpl(MethodImplOptions.InternalCall)]
+        private static extern void Internal_SetColorGradingSettings(IntPtr thisPtr, ref ColorGradingSettings value);
+
+        [MethodImpl(MethodImplOptions.InternalCall)]
+        private static extern float Internal_GetExposureScale(IntPtr thisPtr);
+
+        [MethodImpl(MethodImplOptions.InternalCall)]
+        private static extern void Internal_SetExposureScale(IntPtr thisPtr, float value);
+
+        [MethodImpl(MethodImplOptions.InternalCall)]
+        private static extern float Internal_GetGamma(IntPtr thisPtr);
+
+        [MethodImpl(MethodImplOptions.InternalCall)]
+        private static extern void Internal_SetGamma(IntPtr thisPtr, float value);
+    }
+}

+ 1 - 218
Source/RenderBeast/Include/BsPostProcessing.h

@@ -6,6 +6,7 @@
 #include "BsRendererMaterial.h"
 #include "BsParamBlocks.h"
 #include "BsRenderTexturePool.h"
+#include "BsPostProcessSettings.h"
 
 namespace BansheeEngine
 {
@@ -13,224 +14,6 @@ namespace BansheeEngine
 	 *  @{
 	 */
 
-	/** Settings that control automatic exposure (eye adaptation) post-process. */
-	struct AutoExposureSettings
-	{
-		AutoExposureSettings();
-
-		/** 
-		 * Determines minimum luminance value in the eye adaptation histogram. The histogram is used for calculating the
-		 * average brightness of the scene. Any luminance value below this value will not be included in the histogram and
-		 * ignored in scene brightness calculations. In log2 units (-8 = 1/256). In the range [-16, 0]. 
-		 */
-		float histogramLog2Min; 
-
-		/** 
-		 * Determines maximum luminance value in the eye adaptation histogram. The histogram is used for calculating the
-		 * average brightness of the scene. Any luminance value above this value will not be included in the histogram and
-		 * ignored in scene brightness calculations. In log2 units (4 = 16). In the range [0, 16]. 
-		 */
-		float histogramLog2Max;
-
-		/** 
-		 * Percentage below which to ignore values in the eye adaptation histogram. The histogram is used for calculating
-		 * the average brightness of the scene. Total luminance in the histogram will be summed up and multiplied by this
-		 * value to calculate minimal luminance. Luminance values below the minimal luminance will be ignored and not used
-		 * in scene brightness calculations. This allows you to remove outliers on the lower end of the histogram (e.g. a
-		 * few very dark pixels in an otherwise bright image). In range [0.0f, 1.0f]. 
-		 */
-		float histogramPctLow;
-
-		/** 
-		 * Percentage above which to ignore values in the eye adaptation histogram. The histogram is used for calculating
-		 * the average brightness of the scene. Total luminance in the histogram will be summed up and multiplied by this
-		 * value to calculate maximum luminance. Luminance values above the maximum luminance will be ignored and not used
-		 * in scene brightness calculations. This allows you to remove outliers on the high end of the histogram (e.g. a few
-		 * very bright pixels). In range [0.0f, 1.0f]. 
-		 */
-		float histogramPctHigh;
-
-		/** 
-		 * Clamps the minimum eye adaptation scale to this value. This allows you to limit eye adaptation so that exposure
-		 * is never too high (e.g. when in a very dark room you probably do not want the exposure to be so high that
-		 * everything is still visible). In range [0.0f, 10.0f]. 
-		 */
-		float minEyeAdaptation;
-
-		/** 
-		 * Clamps the maximum eye adaptation scale to this value. This allows you to limit eye adaptation so that exposure
-		 * is never too low (e.g. when looking at a very bright light source you probably don't want the exposure to be so
-		 * low that the rest of the scene is all white (overexposed). In range [0.0f, 10.0f]. 
-		 */
-		float maxEyeAdaptation;
-
-		/** 
-		 * Determines how quickly does the eye adaptation adjust to larger values. This affects how quickly does the 
-		 * automatic exposure changes when the scene brightness increases. In range [0.01f, 20.0f]. */
-		float eyeAdaptationSpeedUp;
-
-		/** 
-		 * Determines how quickly does the eye adaptation adjust to smaller values. This affects how quickly does the 
-		 * automatic exposure changes when the scene brightness decreases. In range [0.01f, 20.0f]. 
-		 */
-		float eyeAdaptationSpeedDown;
-	};
-
-	/** Settings that control tonemap post-process. */
-	struct TonemappingSettings
-	{
-		TonemappingSettings();
-
-		/** 
-		 * Controls the shoulder (upper non-linear) section of the filmic curve used for tonemapping. Mostly affects bright
-		 * areas of the image and allows you to reduce over-exposure. 
-		 */
-		float filmicCurveShoulderStrength;
-
-		/** 
-		 * Controls the linear (middle) section of the filmic curve used for tonemapping. Mostly affects mid-range areas of
-		 * the image. 
-		 */
-		float filmicCurveLinearStrength;
-
-		/** 
-		 * Controls the linear (middle) section of the filmic curve used for tonemapping. Mostly affects mid-range areas of
-		 * the image and allows you to control how quickly does the curve climb.
-		 */
-		float filmicCurveLinearAngle;
-
-		/** 
-		 * Controls the toe (lower non-linear) section of the filmic curve used for tonemapping. Mostly affects dark areas
-		 * of the image and allows you to reduce under-exposure.
-		 */
-		float filmicCurveToeStrength;
-
-		/** Controls the toe (lower non-linear) section of the filmic curve. used for tonemapping. Affects low-range. */
-		float filmicCurveToeNumerator;
-
-		/** Controls the toe (lower non-linear) section of the filmic curve used for tonemapping. Affects low-range. */
-		float filmicCurveToeDenominator;
-
-		/** Controls the white point of the filmic curve used for tonemapping. Affects the entire curve. */
-		float filmicCurveLinearWhitePoint;
-	};
-
-	/** Settings that control white balance post-process. */
-	struct WhiteBalanceSettings
-	{
-		WhiteBalanceSettings();
-
-		/** 
-		 * Temperature used for white balancing, in Kelvins. 
-		 *
-		 * Moves along the Planckian locus. In range [1500.0f, 15000.0f]. 
-		 */
-		float temperature;
-
-		/** 
-		 * Additional tint to be applied during white balancing. Can be used to further tweak the white balancing effect by
-		 * modifying the tint of the light. The tint is chosen on the Planckian locus isothermal, depending on the light
-		 * temperature specified by ::whiteTemperature.
-		 *
-		 * In range [-1.0f, 1.0f]. 
-		 */
-		float tint;	
-	};
-
-	/** Settings that control color grading post-process. */
-	struct ColorGradingSettings
-	{
-		ColorGradingSettings();
-
-		/** 
-		 * Saturation to be applied during color grading. Larger values increase vibrancy of the image. 
-		 * In range [0.0f, 2.0f]. 
-		 */
-		Vector3 saturation;
-
-		/** 
-		 * Contrast to be applied during color grading. Larger values increase difference between light and dark areas of
-		 * the image. In range [0.0f, 2.0f]. */
-		Vector3 contrast;
-
-		/** 
-		 * Gain to be applied during color grading. Simply increases all color values by an equal scale. 
-		 * In range [0.0f, 2.0f]. 
-		 */
-		Vector3 gain;
-
-		/** 
-		 * Gain to be applied during color grading. Simply offsets all color values by an equal amount.
-		 * In range [-1.0f, 1.0f].
-		 */
-		Vector3 offset;
-	};
-
-	/** Settings that control the post-process operations. */
-	struct PostProcessSettings
-	{
-		PostProcessSettings();
-
-		/** 
-		 * Determines should automatic exposure be applied to the HDR image. When turned on the average scene brightness
-		 * will be calculated and used to automatically expose the image to the optimal range. Use the parameters provided
-		 * by ::autoExposure to customize the automatic exposure effect. You may also use ::exposureScale to
-		 * manually adjust the automatic exposure. When automatic exposure is turned off you can use ::exposureScale to
-		 * manually set the exposure.
-		 */
-		bool enableAutoExposure;
-
-		/** 
-		 * Parameters used for customizing automatic scene exposure. 
-		 *
-		 * @see	enableAutoExposure
-		 */
-		AutoExposureSettings autoExposure;
-
-		/** 
-		 * Determines should the image be tonemapped. Tonemapping converts an HDR image into LDR image by applying
-		 * a filmic curve to the image, simulating the effect of film cameras. Filmic curve improves image quality by
-		 * tapering off lows and highs, preventing under- and over-exposure. This is useful if an image contains both
-		 * very dark and very bright areas, in which case the global exposure parameter would leave some areas either over-
-		 * or under-exposed. Use ::tonemapping to customize how tonemapping performed.
-		 *
-		 * If this is disabled, then color grading and white balancing will not be enabled either. Only relevant for HDR
-		 * images.
-		 */
-		bool enableTonemapping;
-
-		/** 
-		 * Parameters used for customizing tonemapping.
-		 *
-		 * @see	enableTonemapping
-		 */
-		TonemappingSettings tonemapping;
-
-		/**
-		 * Parameters used for customizing white balancing. White balancing converts a scene illuminated by a light of the
-		 * specified temperature into a scene illuminated by a standard D65 illuminant (average midday light) in order to
-		 * simulate the effects of chromatic adaptation of the human visual system.
-		 */
-		WhiteBalanceSettings whiteBalance;
-
-		/** Parameters used for customizing color grading. */
-		ColorGradingSettings colorGrading;
-
-		/** 
-		 * Log2 value to scale the eye adaptation by (e.g. 2^0 = 1). Smaller values yield darker image, while larger yield
-		 * brighter image. Allows you to customize exposure manually, applied on top of eye adaptation exposure (if 
-		 * enabled). In range [-8, 8].
-		 */
-		float exposureScale;
-
-		/**
-		 * Gamma value to adjust the image for. Larger values result in a brighter image. When tonemapping is turned
-		 * on the best gamma curve for the output device is chosen automatically and this value can by used to merely tweak
-		 * that curve. If tonemapping is turned off this is the exact value of the gamma curve that will be applied.
-		 */
-		float gamma;
-	};
-
 	/** Contains per-camera data used by post process effects. */
 	struct PostProcessInfo
 	{

+ 0 - 23
Source/RenderBeast/Source/BsPostProcessing.cpp

@@ -8,29 +8,6 @@
 
 namespace BansheeEngine
 {
-	AutoExposureSettings::AutoExposureSettings()
-		: histogramLog2Min(-8.0f), histogramLog2Max(4.0f), histogramPctLow(0.8f), histogramPctHigh(0.985f)
-		, minEyeAdaptation(0.3f), maxEyeAdaptation(2.0f), eyeAdaptationSpeedUp(3.0f), eyeAdaptationSpeedDown(3.0f)
-	{ }
-
-	TonemappingSettings::TonemappingSettings()
-		: filmicCurveShoulderStrength(0.22f), filmicCurveLinearStrength(0.3f), filmicCurveLinearAngle(0.1f)
-		, filmicCurveToeStrength(0.2f), filmicCurveToeNumerator(0.01f), filmicCurveToeDenominator(0.3f)
-		, filmicCurveLinearWhitePoint(11.2f)
-	{ }
-
-	WhiteBalanceSettings::WhiteBalanceSettings()
-		: temperature(6500.0f), tint(0.0f)
-	{ }
-
-	ColorGradingSettings::ColorGradingSettings()
-		: saturation(Vector3::ONE), contrast(Vector3::ONE), gain(Vector3::ONE), offset(Vector3::ZERO)
-	{ }
-
-	PostProcessSettings::PostProcessSettings()
-		: enableAutoExposure(true), enableTonemapping(true), exposureScale(0.0f), gamma(2.2f)
-	{ }
-
 	DownsampleMat::DownsampleMat()
 	{
 		mMaterial->setParamBlockBuffer("Input", mParams.getBuffer());

+ 57 - 0
Source/SBansheeEngine/Include/BsScriptPostProcessSettings.h

@@ -0,0 +1,57 @@
+//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
+//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
+#pragma once
+
+#include "BsScriptEnginePrerequisites.h"
+#include "BsScriptObject.h"
+#include "BsPostProcessSettings.h"
+
+namespace BansheeEngine
+{
+	/** @addtogroup ScriptInteropEngine
+	 *  @{
+	 */
+
+	/**	Interop class between C++ & CLR for PostProcessSettings. */
+	class BS_SCR_BE_EXPORT ScriptPostProcessSettings : public ScriptObject<ScriptPostProcessSettings>
+	{
+	public:
+		SCRIPT_OBJ(ENGINE_ASSEMBLY, "BansheeEngine", "PostProcessSettings")
+
+	private:
+		ScriptPostProcessSettings(MonoObject* instance);
+
+		SPtr<PostProcessSettings> mSettings;
+
+		/************************************************************************/
+		/* 								CLR HOOKS						   		*/
+		/************************************************************************/
+		static void internal_createInstance(MonoObject* managedInstance);
+
+		static bool internal_GetEnableAutoExposure(ScriptPostProcessSettings* thisPtr);
+		static void internal_SetEnableAutoExposure(ScriptPostProcessSettings* thisPtr, bool value);
+
+		static void internal_GetAutoExposureSettings(ScriptPostProcessSettings* thisPtr, AutoExposureSettings* value);
+		static void internal_SetAutoExposureSettings(ScriptPostProcessSettings* thisPtr, AutoExposureSettings* value);
+
+		static bool internal_GetEnableTonemapping(ScriptPostProcessSettings* thisPtr);
+		static void internal_SetEnableTonemapping(ScriptPostProcessSettings* thisPtr, bool value);
+
+		static void internal_GetTonemappingSettings(ScriptPostProcessSettings* thisPtr, TonemappingSettings* value);
+		static void internal_SetTonemappingSettings(ScriptPostProcessSettings* thisPtr, TonemappingSettings* value);
+
+		static void internal_GetWhiteBalanceSettings(ScriptPostProcessSettings* thisPtr, WhiteBalanceSettings* value);
+		static void internal_SetWhiteBalanceSettings(ScriptPostProcessSettings* thisPtr, WhiteBalanceSettings* value);
+
+		static void internal_GetColorGradingSettings(ScriptPostProcessSettings* thisPtr, ColorGradingSettings* value);
+		static void internal_SetColorGradingSettings(ScriptPostProcessSettings* thisPtr, ColorGradingSettings* value);
+
+		static float internal_GetExposureScale(ScriptPostProcessSettings* thisPtr);
+		static void internal_SetExposureScale(ScriptPostProcessSettings* thisPtr, float value);
+
+		static float internal_GetGamma(ScriptPostProcessSettings* thisPtr);
+		static void internal_SetGamma(ScriptPostProcessSettings* thisPtr, float value);
+	};
+
+	/** @} */
+}

+ 144 - 0
Source/SBansheeEngine/Source/BsScriptPostProcessSettings.cpp

@@ -0,0 +1,144 @@
+//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
+//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
+#include "BsScriptPostProcessSettings.h"
+#include "BsMonoManager.h"
+#include "BsMonoAssembly.h"
+#include "BsMonoClass.h"
+#include "BsMonoUtil.h"
+#include "BsCoreThread.h"
+
+namespace BansheeEngine
+{
+	ScriptPostProcessSettings::ScriptPostProcessSettings(MonoObject* instance)
+		:ScriptObject(instance), mSettings(bs_shared_ptr_new<PostProcessSettings>())
+	{ }
+
+	void ScriptPostProcessSettings::initRuntimeData()
+	{
+		metaData.scriptClass->addInternalCall("Internal_CreateInstance", &ScriptPostProcessSettings::internal_createInstance);
+
+		metaData.scriptClass->addInternalCall("Internal_GetEnableAutoExposure", &ScriptPostProcessSettings::internal_GetEnableAutoExposure);
+		metaData.scriptClass->addInternalCall("Internal_SetEnableAutoExposure", &ScriptPostProcessSettings::internal_SetEnableAutoExposure);
+
+		metaData.scriptClass->addInternalCall("Internal_GetAutoExposureSettings", &ScriptPostProcessSettings::internal_GetAutoExposureSettings);
+		metaData.scriptClass->addInternalCall("Internal_SetAutoExposureSettings", &ScriptPostProcessSettings::internal_SetAutoExposureSettings);
+
+		metaData.scriptClass->addInternalCall("Internal_GetEnableTonemapping", &ScriptPostProcessSettings::internal_GetEnableTonemapping);
+		metaData.scriptClass->addInternalCall("Internal_SetEnableTonemapping", &ScriptPostProcessSettings::internal_SetEnableTonemapping);
+
+		metaData.scriptClass->addInternalCall("Internal_GetTonemappingSettings", &ScriptPostProcessSettings::internal_GetTonemappingSettings);
+		metaData.scriptClass->addInternalCall("Internal_SetTonemappingSettings", &ScriptPostProcessSettings::internal_SetTonemappingSettings);
+
+		metaData.scriptClass->addInternalCall("Internal_GetWhiteBalanceSettings", &ScriptPostProcessSettings::internal_GetWhiteBalanceSettings);
+		metaData.scriptClass->addInternalCall("Internal_SetWhiteBalanceSettings", &ScriptPostProcessSettings::internal_SetWhiteBalanceSettings);
+
+		metaData.scriptClass->addInternalCall("Internal_GetColorGradingSettings", &ScriptPostProcessSettings::internal_GetColorGradingSettings);
+		metaData.scriptClass->addInternalCall("Internal_SetColorGradingSettings", &ScriptPostProcessSettings::internal_SetColorGradingSettings);
+
+		metaData.scriptClass->addInternalCall("Internal_GetExposureScale", &ScriptPostProcessSettings::internal_GetExposureScale);
+		metaData.scriptClass->addInternalCall("Internal_SetExposureScale", &ScriptPostProcessSettings::internal_SetExposureScale);
+
+		metaData.scriptClass->addInternalCall("Internal_GetGamma", &ScriptPostProcessSettings::internal_GetGamma);
+		metaData.scriptClass->addInternalCall("Internal_SetGamma", &ScriptPostProcessSettings::internal_SetGamma);
+
+		// Validation
+#if BS_DEBUG_MODE
+		MonoAssembly* engineAssembly = MonoManager::instance().getAssembly(ENGINE_ASSEMBLY);
+
+		MonoClass* autoExposureSettingsClass = engineAssembly->getClass("BansheeEngine", "AutoExposureSettings");
+		MonoClass* tonemappingSettingsClass = engineAssembly->getClass("BansheeEngine", "TonemappingSettings");
+		MonoClass* whieBalanceSettingsClass = engineAssembly->getClass("BansheeEngine", "WhiteBalanceSettings");
+		MonoClass* colorGradingSettingsClass = engineAssembly->getClass("BansheeEngine", "ColorGradingSettings");
+
+		assert(autoExposureSettingsClass->getInstanceSize() == sizeof(AutoExposureSettings));
+		assert(tonemappingSettingsClass->getInstanceSize() == sizeof(TonemappingSettings));
+		assert(whieBalanceSettingsClass->getInstanceSize() == sizeof(WhiteBalanceSettings));
+		assert(colorGradingSettingsClass->getInstanceSize() == sizeof(ColorGradingSettings));
+#endif
+	}
+
+	void ScriptPostProcessSettings::internal_createInstance(MonoObject* managedInstance)
+	{
+		new (bs_alloc<ScriptPostProcessSettings>()) ScriptPostProcessSettings(managedInstance);
+	}
+
+	bool ScriptPostProcessSettings::internal_GetEnableAutoExposure(ScriptPostProcessSettings* thisPtr)
+	{
+		return thisPtr->mSettings->enableAutoExposure;
+	}
+
+	void ScriptPostProcessSettings::internal_SetEnableAutoExposure(ScriptPostProcessSettings* thisPtr, bool value)
+	{
+		thisPtr->mSettings->enableAutoExposure = value;
+	}
+
+	void ScriptPostProcessSettings::internal_GetAutoExposureSettings(ScriptPostProcessSettings* thisPtr, AutoExposureSettings* value)
+	{
+		*value = thisPtr->mSettings->autoExposure;
+	}
+
+	void ScriptPostProcessSettings::internal_SetAutoExposureSettings(ScriptPostProcessSettings* thisPtr, AutoExposureSettings* value)
+	{
+		thisPtr->mSettings->autoExposure = *value;
+	}
+
+	bool ScriptPostProcessSettings::internal_GetEnableTonemapping(ScriptPostProcessSettings* thisPtr)
+	{
+		return thisPtr->mSettings->enableTonemapping;
+	}
+
+	void ScriptPostProcessSettings::internal_SetEnableTonemapping(ScriptPostProcessSettings* thisPtr, bool value)
+	{
+		thisPtr->mSettings->enableTonemapping = value;
+	}
+
+	void ScriptPostProcessSettings::internal_GetTonemappingSettings(ScriptPostProcessSettings* thisPtr, TonemappingSettings* value)
+	{
+		*value = thisPtr->mSettings->tonemapping;
+	}
+
+	void ScriptPostProcessSettings::internal_SetTonemappingSettings(ScriptPostProcessSettings* thisPtr, TonemappingSettings* value)
+	{
+		thisPtr->mSettings->tonemapping = *value;
+	}
+
+	void ScriptPostProcessSettings::internal_GetWhiteBalanceSettings(ScriptPostProcessSettings* thisPtr, WhiteBalanceSettings* value)
+	{
+		*value = thisPtr->mSettings->whiteBalance;
+	}
+
+	void ScriptPostProcessSettings::internal_SetWhiteBalanceSettings(ScriptPostProcessSettings* thisPtr, WhiteBalanceSettings* value)
+	{
+		thisPtr->mSettings->whiteBalance = *value;
+	}
+
+	void ScriptPostProcessSettings::internal_GetColorGradingSettings(ScriptPostProcessSettings* thisPtr, ColorGradingSettings* value)
+	{
+		*value = thisPtr->mSettings->colorGrading;
+	}
+
+	void ScriptPostProcessSettings::internal_SetColorGradingSettings(ScriptPostProcessSettings* thisPtr, ColorGradingSettings* value)
+	{
+		thisPtr->mSettings->colorGrading = *value;
+	}
+
+	float ScriptPostProcessSettings::internal_GetExposureScale(ScriptPostProcessSettings* thisPtr)
+	{
+		return thisPtr->mSettings->exposureScale;
+	}
+
+	void ScriptPostProcessSettings::internal_SetExposureScale(ScriptPostProcessSettings* thisPtr, float value)
+	{
+		thisPtr->mSettings->exposureScale = value;
+	}
+
+	float ScriptPostProcessSettings::internal_GetGamma(ScriptPostProcessSettings* thisPtr)
+	{
+		return thisPtr->mSettings->gamma;
+	}
+
+	void ScriptPostProcessSettings::internal_SetGamma(ScriptPostProcessSettings* thisPtr, float value)
+	{
+		thisPtr->mSettings->gamma = value;
+	}
+}