Browse Source

Render compositor nodes now execute the render callbacks
StandardPostProcessSettings -> PostProcessSettings

BearishSun 8 years ago
parent
commit
b83831cd3e

+ 7 - 0
Source/BansheeCore/Include/BsCorePrerequisites.h

@@ -580,6 +580,13 @@ namespace bs
 		TID_Renderable = 30004,
 		TID_Light = 30011,
 		TID_CLight = 30012,
+		TID_AutoExposureSettings = 30016,
+		TID_TonemappingSettings = 30017,
+		TID_WhiteBalanceSettings = 30018,
+		TID_ColorGradingSettings = 30019,
+		TID_DepthOfFieldSettings = 30020,
+		TID_AmbientOcclusionSettings = 30021,
+		TID_ScreenSpaceReflectionsSettings = 30022
 	};
 }
 

+ 417 - 3
Source/BansheeCore/Include/BsPostProcessSettings.h

@@ -4,19 +4,433 @@
 
 #include "BsCorePrerequisites.h"
 #include "BsIReflectable.h"
+#include "BsVector3.h"
 
 namespace bs
 {
 	/** @addtogroup Renderer
 	 *  @{
 	 */
+
+	/** Settings that control automatic exposure (eye adaptation) post-process. */
+	struct BS_CORE_EXPORT AutoExposureSettings : public IReflectable
+	{
+		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 (for
+		 * example 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 (for 
+		 * example 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 (for example 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 (for example 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;
+
+		/************************************************************************/
+		/* 								RTTI		                     		*/
+		/************************************************************************/
+	public:
+		friend class AutoExposureSettingsRTTI;
+		static RTTITypeBase* getRTTIStatic();
+		RTTITypeBase* getRTTI() const override;
+	};
+
+	/** Settings that control tonemap post-process. */
+	struct BS_CORE_EXPORT TonemappingSettings : public IReflectable
+	{
+		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;
+
+		/************************************************************************/
+		/* 								RTTI		                     		*/
+		/************************************************************************/
+	public:
+		friend class TonemappingSettingsRTTI;
+		static RTTITypeBase* getRTTIStatic();
+		RTTITypeBase* getRTTI() const override;
+	};
+
+	/** Settings that control white balance post-process. */
+	struct BS_CORE_EXPORT WhiteBalanceSettings : public IReflectable
+	{
+		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;
+
+		/************************************************************************/
+		/* 								RTTI		                     		*/
+		/************************************************************************/
+	public:
+		friend class WhiteBalanceSettingsRTTI;
+		static RTTITypeBase* getRTTIStatic();
+		RTTITypeBase* getRTTI() const override;
+	};
+
+	/** Settings that control color grading post-process. */
+	struct BS_CORE_EXPORT ColorGradingSettings : public IReflectable
+	{
+		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;
+
+		/************************************************************************/
+		/* 								RTTI		                     		*/
+		/************************************************************************/
+	public:
+		friend class ColorGradingSettingsRTTI;
+		static RTTITypeBase* getRTTIStatic();
+		RTTITypeBase* getRTTI() const override;
+	};
+
+	/** Settings that control screen space ambient occlusion. */
+	struct BS_CORE_EXPORT AmbientOcclusionSettings : public IReflectable
+	{
+		AmbientOcclusionSettings();
+
+		/** Enables or disabled the screen space ambient occlusion effect. */
+		bool enabled;
+
+		/** 
+		 * Radius (in world space, in meters) over which occluders are searched for. Smaller radius ensures better sampling
+		 * precision but can miss occluders. Larger radius ensures far away occluders are considered but can yield lower
+		 * quality or noise because of low sampling precision. Usually best to keep at around a meter, valid range
+		 * is roughly [0.05, 5.0].
+		 */
+		float radius;
+
+		/**
+		 * Bias used to reduce false occlusion artifacts. Higher values reduce the amount of artifacts but will cause
+		 * details to be lost in areas where occlusion isn't high. Value is in millimeters. Usually best to keep at a few
+		 * dozen millimeters, valid range is roughly [0, 200].
+		 */
+		float bias;
+
+		/**
+		 * Distance (in view space, in meters) after which AO starts fading out. The fade process will happen over the
+		 * range as specified by @p fadeRange.
+		 */
+		float fadeDistance;
+
+		/**
+		 * Range (in view space, in meters) in which AO fades out from 100% to 0%. AO starts fading out after the distance
+		 * specified in @p fadeDistance.
+		 */
+		float fadeRange;
+
+		/**
+		 * Linearly scales the intensity of the AO effect. Values less than 1 make the AO effect less pronounced, and vice
+		 * versa. Valid range is roughly [0.2, 2].
+		 */
+		float intensity;
+
+		/**
+		 * Controls how quickly does the AO darkening effect increase with higher occlusion percent. This is a non-linear
+		 * control and will cause the darkening to ramp up exponentially. Valid range is roughly [1, 4], where 1 means no
+		 * extra darkening will occur.
+		 */
+		float power;
+
+		/**
+		 * Quality level of generated ambient occlusion. In range [0, 4]. Higher levels yield higher quality AO at the cost
+		 * of performance.
+		 */
+		UINT32 quality;
+
+		/************************************************************************/
+		/* 								RTTI		                     		*/
+		/************************************************************************/
+	public:
+		friend class AmbientOcclusionSettingsRTTI;
+		static RTTITypeBase* getRTTIStatic();
+		RTTITypeBase* getRTTI() const override;
+	};
+
+	/** Settings that control the depth-of-field effect. */
+	struct BS_CORE_EXPORT DepthOfFieldSettings : public IReflectable
+	{
+		DepthOfFieldSettings();
+
+		/** Enables or disables the depth of field effect. */
+		bool enabled;
+
+		/** 
+		 * Distance from the camera at which the focal plane is located in. Objects at this distance will be fully in focus.
+		 */
+		float focalDistance;
+		
+		/** 
+		 * Range within which the objects remain fully in focus. This range is applied relative to the focal distance. 
+		 * Only relevant if Gaussian depth of field is used as other methods don't use a constant in-focus range.
+		 */
+		float focalRange;
+
+		/**
+		 * Determines the size of the range within which objects transition from focused to fully unfocused, at the near 
+		 * plane. Only relevant for Gaussian depth of field.
+		 */
+		float nearTransitionRange;
+
+		/**
+		 * Determines the size of the range within which objects transition from focused to fully unfocused, at the far 
+		 * plane. Only relevant for Gaussian depth of field.
+		 */
+		float farTransitionRange;
+
+		/** 
+		 * Determines the amount of blur to apply to fully unfocused objects that are closer to camera than the in-focus
+		 * zone. Set to zero to disable near-field blur. Only relevant for Gaussian depth of field.
+		 */
+		float nearBlurAmount;
+
+		/** 
+		 * Determines the amount of blur to apply to fully unfocused objects that are farther away from camera than the
+		 * in-focus zone. Set to zero to disable far-field blur. Only relevant for Gaussian depth of field.
+		 */
+		float farBlurAmount;
+
+		/************************************************************************/
+		/* 								RTTI		                     		*/
+		/************************************************************************/
+	public:
+		friend class DepthOfFieldSettingsRTTI;
+		static RTTITypeBase* getRTTIStatic();
+		RTTITypeBase* getRTTI() const override;
+	};
+
+	/** 
+	 * Settings that control the screen space reflections effect. Screen space reflections provide high quality mirror-like
+	 * reflections at low performance cost. They should be used together with reflection probes as the effects complement
+	 * each other. As the name implies, the reflections are only limited to geometry drawn on the screen and the system will
+	 * fall back to refl. probes when screen space data is unavailable. Similarly the system will fall back to refl. probes
+	 * for rougher (more glossy rather than mirror-like) surfaces. Those surfaces require a higher number of samples to
+	 * achieve the glossy look, so we instead fall back to refl. probes which are pre-filtered and can be quickly sampled.
+	 */
+	struct BS_CORE_EXPORT ScreenSpaceReflectionsSettings : public IReflectable
+	{
+		ScreenSpaceReflectionsSettings();
+
+		/** Enables or disables the SSR effect. */
+		bool enabled;
+
+		/** 
+		 * Quality of the SSR effect. Higher values cast more sample rays, and march those rays are lower increments for
+		 * better precision. This results in higher quality, as well as a higher performance requirement. Valid range is
+		 * [0, 4], default is 2.
+		 */
+		UINT32 quality;
+
+		/** Intensity of the screen space reflections. Valid range is [0, 1]. Default is 1 (100%). */
+		float intensity;
+
+		/** 
+		 * Roughness at which screen space reflections start fading out and become replaced with refl. probes. Valid range
+		 * is [0, 1]. Default is 0.8.
+		 */
+		float maxRoughness;
+
+		/************************************************************************/
+		/* 								RTTI		                     		*/
+		/************************************************************************/
+	public:
+		friend class ScreenSpaceReflectionsRTTI;
+		static RTTITypeBase* getRTTIStatic();
+		RTTITypeBase* getRTTI() const override;
+	};
 	
 	/** Base class whose implementations contain settings that control post-process operations during rendering. */
 	struct BS_CORE_EXPORT PostProcessSettings : public IReflectable
 	{
-		PostProcessSettings() { }
+		PostProcessSettings();
 		virtual ~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;
+
+		/** Parameters used for customizing the depth of field effect. */
+		DepthOfFieldSettings depthOfField;
+
+		/** Parameters used for customizing screen space ambient occlusion. */
+		AmbientOcclusionSettings ambientOcclusion;
+
+		/** Parameters used for customizing screen space reflections. */
+		ScreenSpaceReflectionsSettings screenSpaceReflections;
+
+		/** Enables the fast approximate anti-aliasing effect. */
+		bool enableFXAA;
+
+		/**
+		 * Log2 value to scale the eye adaptation by (for example 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;
+
 		/** @name Internal
 		 *  @{
 		 */
@@ -30,7 +444,7 @@ namespace bs
 		 * @param[in, out]	size		Size of the provided allocated buffer. Or if the buffer is null, this parameter will
 		 *								contain the required buffer size when the method executes.
 		 */
-		virtual void _getSyncData(UINT8* buffer, UINT32& size) = 0;
+		void _getSyncData(UINT8* buffer, UINT32& size);
 
 		/** 
 		 * Updates the stored data from the provided buffer, allowing changes to be transfered between two versions of this
@@ -39,7 +453,7 @@ namespace bs
 		 * @param[in]		buffer		Buffer containing the dirty data.
 		 * @param[in, out]	size		Size of the provided buffer.
 		 */
-		virtual void _setSyncData(UINT8* buffer, UINT32 size) = 0;
+		void _setSyncData(UINT8* buffer, UINT32 size);
 
 		/** @} */
 		/************************************************************************/

+ 255 - 4
Source/BansheeCore/Include/BsPostProcessSettingsRTTI.h

@@ -13,12 +13,264 @@ namespace bs
 	 *  @{
 	 */
 
-	class BS_CORE_EXPORT PostProcessSettingsRTTI : public RTTIType<PostProcessSettings, IReflectable, PostProcessSettingsRTTI>
+	class BS_CORE_EXPORT AutoExposureSettingsRTTI : public RTTIType <AutoExposureSettings, IReflectable, AutoExposureSettingsRTTI>
 	{
 	private:
+		BS_BEGIN_RTTI_MEMBERS
+			BS_RTTI_MEMBER_PLAIN(histogramLog2Min, 0)
+			BS_RTTI_MEMBER_PLAIN(histogramLog2Max, 1)
+			BS_RTTI_MEMBER_PLAIN(histogramPctLow, 2)
+			BS_RTTI_MEMBER_PLAIN(histogramPctHigh, 3)
+			BS_RTTI_MEMBER_PLAIN(minEyeAdaptation, 4)
+			BS_RTTI_MEMBER_PLAIN(maxEyeAdaptation, 5)
+			BS_RTTI_MEMBER_PLAIN(eyeAdaptationSpeedUp, 6)
+			BS_RTTI_MEMBER_PLAIN(eyeAdaptationSpeedDown, 7)
+		BS_END_RTTI_MEMBERS
 
 	public:
-		PostProcessSettingsRTTI() { }
+		AutoExposureSettingsRTTI()
+			:mInitMembers(this)
+		{ }
+
+		const String& getRTTIName() override
+		{
+			static String name = "AutoExposureSettings";
+			return name;
+		}
+
+		UINT32 getRTTIId() override
+		{
+			return TID_AutoExposureSettings;
+		}
+
+		SPtr<IReflectable> newRTTIObject() override
+		{
+			return bs_shared_ptr_new<AutoExposureSettings>();
+		}
+	};
+
+	class BS_CORE_EXPORT TonemappingSettingsRTTI : public RTTIType <TonemappingSettings, IReflectable, TonemappingSettingsRTTI>
+	{
+	private:
+		BS_BEGIN_RTTI_MEMBERS
+			BS_RTTI_MEMBER_PLAIN(filmicCurveShoulderStrength, 0)
+			BS_RTTI_MEMBER_PLAIN(filmicCurveLinearStrength, 1)
+			BS_RTTI_MEMBER_PLAIN(filmicCurveLinearAngle, 2)
+			BS_RTTI_MEMBER_PLAIN(filmicCurveToeStrength, 3)
+			BS_RTTI_MEMBER_PLAIN(filmicCurveToeNumerator, 4)
+			BS_RTTI_MEMBER_PLAIN(filmicCurveToeDenominator, 5)
+			BS_RTTI_MEMBER_PLAIN(filmicCurveLinearWhitePoint, 6)
+		BS_END_RTTI_MEMBERS
+
+	public:
+		TonemappingSettingsRTTI()
+			:mInitMembers(this)
+		{ }
+
+		const String& getRTTIName() override
+		{
+			static String name = "TonemappingSettings";
+			return name;
+		}
+
+		UINT32 getRTTIId() override
+		{
+			return TID_TonemappingSettings;
+		}
+
+		SPtr<IReflectable> newRTTIObject() override
+		{
+			return bs_shared_ptr_new<TonemappingSettings>();
+		}
+	};
+
+	class BS_CORE_EXPORT WhiteBalanceSettingsRTTI : public RTTIType <WhiteBalanceSettings, IReflectable, WhiteBalanceSettingsRTTI>
+	{
+	private:
+		BS_BEGIN_RTTI_MEMBERS
+			BS_RTTI_MEMBER_PLAIN(temperature, 0)
+			BS_RTTI_MEMBER_PLAIN(tint, 1)
+		BS_END_RTTI_MEMBERS
+
+	public:
+		WhiteBalanceSettingsRTTI()
+			:mInitMembers(this)
+		{ }
+
+		const String& getRTTIName() override
+		{
+			static String name = "WhiteBalanceSettings";
+			return name;
+		}
+
+		UINT32 getRTTIId() override
+		{
+			return TID_WhiteBalanceSettings;
+		}
+
+		SPtr<IReflectable> newRTTIObject() override
+		{
+			return bs_shared_ptr_new<WhiteBalanceSettings>();
+		}
+	};
+
+	class BS_CORE_EXPORT ColorGradingSettingsRTTI : public RTTIType <ColorGradingSettings, IReflectable, ColorGradingSettingsRTTI>
+	{
+	private:
+		BS_BEGIN_RTTI_MEMBERS
+			BS_RTTI_MEMBER_PLAIN(saturation, 0)
+			BS_RTTI_MEMBER_PLAIN(contrast, 1)
+			BS_RTTI_MEMBER_PLAIN(gain, 2)
+			BS_RTTI_MEMBER_PLAIN(offset, 3)
+		BS_END_RTTI_MEMBERS
+
+	public:
+		ColorGradingSettingsRTTI()
+			:mInitMembers(this)
+		{ }
+
+		const String& getRTTIName() override
+		{
+			static String name = "ColorGradingSettings";
+			return name;
+		}
+
+		UINT32 getRTTIId() override
+		{
+			return TID_ColorGradingSettings;
+		}
+
+		SPtr<IReflectable> newRTTIObject() override
+		{
+			return bs_shared_ptr_new<ColorGradingSettings>();
+		}
+	};
+
+	class BS_CORE_EXPORT DepthOfFieldSettingsRTTI : public RTTIType <DepthOfFieldSettings, IReflectable, DepthOfFieldSettingsRTTI>
+	{
+	private:
+		BS_BEGIN_RTTI_MEMBERS
+			BS_RTTI_MEMBER_PLAIN(enabled, 0)
+			BS_RTTI_MEMBER_PLAIN(focalDistance, 1)
+			BS_RTTI_MEMBER_PLAIN(focalRange, 2)
+			BS_RTTI_MEMBER_PLAIN(nearTransitionRange, 3)
+			BS_RTTI_MEMBER_PLAIN(farTransitionRange, 4)
+			BS_RTTI_MEMBER_PLAIN(nearBlurAmount, 5)
+			BS_RTTI_MEMBER_PLAIN(farBlurAmount, 6)
+		BS_END_RTTI_MEMBERS
+
+	public:
+		DepthOfFieldSettingsRTTI()
+			:mInitMembers(this)
+		{ }
+
+		const String& getRTTIName() override
+		{
+			static String name = "DepthOfFieldSettings";
+			return name;
+		}
+
+		UINT32 getRTTIId() override
+		{
+			return TID_DepthOfFieldSettings;
+		}
+
+		SPtr<IReflectable> newRTTIObject() override
+		{
+			return bs_shared_ptr_new<DepthOfFieldSettings>();
+		}
+	};
+
+	class BS_CORE_EXPORT AmbientOcclusionSettingsRTTI : public RTTIType <AmbientOcclusionSettings, IReflectable, AmbientOcclusionSettingsRTTI>
+	{
+	private:
+		BS_BEGIN_RTTI_MEMBERS
+			BS_RTTI_MEMBER_PLAIN(enabled, 0)
+			BS_RTTI_MEMBER_PLAIN(radius, 1)
+			BS_RTTI_MEMBER_PLAIN(bias, 2)
+			BS_RTTI_MEMBER_PLAIN(fadeRange, 3)
+			BS_RTTI_MEMBER_PLAIN(fadeDistance, 4)
+			BS_RTTI_MEMBER_PLAIN(intensity, 5)
+			BS_RTTI_MEMBER_PLAIN(power, 6)
+			BS_RTTI_MEMBER_PLAIN(quality, 7)
+		BS_END_RTTI_MEMBERS
+
+	public:
+		AmbientOcclusionSettingsRTTI()
+			:mInitMembers(this)
+		{ }
+
+		const String& getRTTIName() override
+		{
+			static String name = "AmbientOcclusionSettings";
+			return name;
+		}
+
+		UINT32 getRTTIId() override
+		{
+			return TID_AmbientOcclusionSettings;
+		}
+
+		SPtr<IReflectable> newRTTIObject() override
+		{
+			return bs_shared_ptr_new<AmbientOcclusionSettings>();
+		}
+	};
+
+	class BS_CORE_EXPORT ScreenSpaceReflectionsSettingsRTTI : public RTTIType <ScreenSpaceReflectionsSettings, IReflectable, ScreenSpaceReflectionsSettingsRTTI>
+	{
+	private:
+		BS_BEGIN_RTTI_MEMBERS
+			BS_RTTI_MEMBER_PLAIN(enabled, 0)
+			BS_RTTI_MEMBER_PLAIN(intensity, 1)
+			BS_RTTI_MEMBER_PLAIN(maxRoughness, 2)
+			BS_RTTI_MEMBER_PLAIN(quality, 3)
+		BS_END_RTTI_MEMBERS
+
+	public:
+		ScreenSpaceReflectionsSettingsRTTI()
+			:mInitMembers(this)
+		{ }
+
+		const String& getRTTIName() override
+		{
+			static String name = "ScreenSpaceReflectionsSettings";
+			return name;
+		}
+
+		UINT32 getRTTIId() override
+		{
+			return TID_ScreenSpaceReflectionsSettings;
+		}
+
+		SPtr<IReflectable> newRTTIObject() override
+		{
+			return bs_shared_ptr_new<ScreenSpaceReflectionsSettings>();
+		}
+	};
+
+	class BS_CORE_EXPORT PostProcessSettingsRTTI : public RTTIType <PostProcessSettings, IReflectable, PostProcessSettingsRTTI>
+	{
+	private:
+		BS_BEGIN_RTTI_MEMBERS
+			BS_RTTI_MEMBER_PLAIN(enableAutoExposure, 0)
+			BS_RTTI_MEMBER_REFL(autoExposure, 1)
+			BS_RTTI_MEMBER_PLAIN(enableTonemapping, 2)
+			BS_RTTI_MEMBER_REFL(tonemapping, 3)
+			BS_RTTI_MEMBER_REFL(whiteBalance, 4)
+			BS_RTTI_MEMBER_REFL(colorGrading, 5)
+			BS_RTTI_MEMBER_PLAIN(exposureScale, 6)
+			BS_RTTI_MEMBER_PLAIN(gamma, 7)
+			BS_RTTI_MEMBER_REFL(depthOfField, 8)
+			BS_RTTI_MEMBER_PLAIN(enableFXAA, 9)
+			BS_RTTI_MEMBER_REFL(ambientOcclusion, 10)
+			BS_RTTI_MEMBER_REFL(screenSpaceReflections, 11)
+		BS_END_RTTI_MEMBERS
+			
+	public:
+		PostProcessSettingsRTTI()
+			:mInitMembers(this)
+		{ }
 
 		const String& getRTTIName() override
 		{
@@ -33,8 +285,7 @@ namespace bs
 
 		SPtr<IReflectable> newRTTIObject() override
 		{
-			assert(false); // Abstract class
-			return nullptr;
+			return bs_shared_ptr_new<PostProcessSettings>();
 		}
 	};
 

+ 0 - 3
Source/BansheeCore/Include/BsRenderer.h

@@ -224,9 +224,6 @@ namespace bs
 		/**	Returns current set of options used for controlling the rendering. */
 		virtual SPtr<RendererOptions> getOptions() const { return SPtr<RendererOptions>(); }
 
-		/** Creates post process settings that can be attached to a camera and processed by the active renderer. */
-		virtual SPtr<PostProcessSettings> createPostProcessSettings() const = 0;
-
 	protected:
 		/**	Contains information about a render callback. */
 		struct RenderCallbackData

+ 2 - 2
Source/BansheeCore/Source/BsCamera.cpp

@@ -26,7 +26,7 @@ namespace bs
 		, mProjMatrixRSInv(BsZero), mProjMatrixInv(BsZero), mViewMatrixInv(BsZero), mRecalcFrustum(true)
 		, mRecalcFrustumPlanes(true), mRecalcView(true)
 	{
-		mPPSettings = RendererManager::instance().getActive()->createPostProcessSettings();
+		mPPSettings = bs_shared_ptr_new<PostProcessSettings>();
 
 		invalidateFrustum();
 	}
@@ -892,7 +892,7 @@ namespace bs
 			if(ppSize > 0)
 			{
 				if (mPPSettings == nullptr)
-					mPPSettings = RendererManager::instance().getActive()->createPostProcessSettings();
+					mPPSettings = bs_shared_ptr_new<PostProcessSettings>();
 
 				mPPSettings->_setSyncData((UINT8*)dataPtr, ppSize);
 				dataPtr += ppSize;

+ 288 - 0
Source/BansheeCore/Source/BsPostProcessSettings.cpp

@@ -5,6 +5,113 @@
 
 namespace bs
 {
+	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)
+	{ }
+
+	RTTITypeBase* AutoExposureSettings::getRTTIStatic()
+	{
+		return AutoExposureSettingsRTTI::instance();
+	}
+
+	RTTITypeBase* AutoExposureSettings::getRTTI() const
+	{
+		return AutoExposureSettings::getRTTIStatic();
+	}
+
+	TonemappingSettings::TonemappingSettings()
+		: filmicCurveShoulderStrength(0.15f), filmicCurveLinearStrength(0.5f), filmicCurveLinearAngle(0.1f)
+		, filmicCurveToeStrength(0.2f), filmicCurveToeNumerator(0.02f), filmicCurveToeDenominator(0.3f)
+		, filmicCurveLinearWhitePoint(11.2f)
+	{ }
+
+	RTTITypeBase* TonemappingSettings::getRTTIStatic()
+	{
+		return TonemappingSettingsRTTI::instance();
+	}
+
+	RTTITypeBase* TonemappingSettings::getRTTI() const
+	{
+		return TonemappingSettings::getRTTIStatic();
+	}
+
+	WhiteBalanceSettings::WhiteBalanceSettings()
+		: temperature(6500.0f), tint(0.0f)
+	{ }
+
+	RTTITypeBase* WhiteBalanceSettings::getRTTIStatic()
+	{
+		return WhiteBalanceSettingsRTTI::instance();
+	}
+
+	RTTITypeBase* WhiteBalanceSettings::getRTTI() const
+	{
+		return WhiteBalanceSettings::getRTTIStatic();
+	}
+
+	ColorGradingSettings::ColorGradingSettings()
+		: saturation(Vector3::ONE), contrast(Vector3::ONE), gain(Vector3::ONE), offset(Vector3::ZERO)
+	{ }
+
+	RTTITypeBase* ColorGradingSettings::getRTTIStatic()
+	{
+		return ColorGradingSettingsRTTI::instance();
+	}
+
+	RTTITypeBase* ColorGradingSettings::getRTTI() const
+	{
+		return ColorGradingSettings::getRTTIStatic();
+	}
+
+	AmbientOcclusionSettings::AmbientOcclusionSettings()
+		: enabled(true), radius(1.5f), bias(1.0f), fadeDistance(500.0f), fadeRange(50.0f), intensity(1.0f), power(1.0f)
+		, quality(3)
+	{ }
+
+	RTTITypeBase* AmbientOcclusionSettings::getRTTIStatic()
+	{
+		return AmbientOcclusionSettingsRTTI::instance();
+	}
+
+	RTTITypeBase* AmbientOcclusionSettings::getRTTI() const
+	{
+		return AmbientOcclusionSettings::getRTTIStatic();
+	}
+
+	DepthOfFieldSettings::DepthOfFieldSettings()
+		: enabled(false), focalDistance(0.75f), focalRange(0.75f), nearTransitionRange(0.25f), farTransitionRange(0.25f)
+		, nearBlurAmount(0.15f), farBlurAmount(0.15f)
+	{ }
+
+	RTTITypeBase* DepthOfFieldSettings::getRTTIStatic()
+	{
+		return DepthOfFieldSettingsRTTI::instance();
+	}
+
+	RTTITypeBase* DepthOfFieldSettings::getRTTI() const
+	{
+		return DepthOfFieldSettings::getRTTIStatic();
+	}
+
+	ScreenSpaceReflectionsSettings::ScreenSpaceReflectionsSettings()
+		: enabled(true), intensity(1.0f), maxRoughness(0.8f), quality(2)
+	{ }
+
+	RTTITypeBase* ScreenSpaceReflectionsSettings::getRTTIStatic()
+	{
+		return ScreenSpaceReflectionsSettingsRTTI::instance();
+	}
+
+	RTTITypeBase* ScreenSpaceReflectionsSettings::getRTTI() const
+	{
+		return ScreenSpaceReflectionsSettings::getRTTIStatic();
+	}
+
+	PostProcessSettings::PostProcessSettings()
+		: enableAutoExposure(true), enableTonemapping(true), enableFXAA(false), exposureScale(0.0f), gamma(2.2f)
+	{ }
+
 	RTTITypeBase* PostProcessSettings::getRTTIStatic()
 	{
 		return PostProcessSettingsRTTI::instance();
@@ -14,4 +121,185 @@ namespace bs
 	{
 		return PostProcessSettings::getRTTIStatic();
 	}
+
+	void PostProcessSettings::_getSyncData(UINT8* buffer, UINT32& size)
+	{
+		UINT32 bufferSize = 0;
+		bufferSize += rttiGetElemSize(enableAutoExposure);
+		bufferSize += rttiGetElemSize(enableTonemapping);
+		bufferSize += rttiGetElemSize(exposureScale);
+		bufferSize += rttiGetElemSize(gamma);
+		bufferSize += rttiGetElemSize(enableFXAA);
+
+		bufferSize += rttiGetElemSize(autoExposure.histogramLog2Min);
+		bufferSize += rttiGetElemSize(autoExposure.histogramLog2Max);
+		bufferSize += rttiGetElemSize(autoExposure.histogramPctLow);
+		bufferSize += rttiGetElemSize(autoExposure.histogramPctHigh);
+		bufferSize += rttiGetElemSize(autoExposure.minEyeAdaptation);
+		bufferSize += rttiGetElemSize(autoExposure.maxEyeAdaptation);
+		bufferSize += rttiGetElemSize(autoExposure.eyeAdaptationSpeedUp);
+		bufferSize += rttiGetElemSize(autoExposure.eyeAdaptationSpeedDown);
+
+		bufferSize += rttiGetElemSize(tonemapping.filmicCurveShoulderStrength);
+		bufferSize += rttiGetElemSize(tonemapping.filmicCurveLinearStrength);
+		bufferSize += rttiGetElemSize(tonemapping.filmicCurveLinearAngle);
+		bufferSize += rttiGetElemSize(tonemapping.filmicCurveToeStrength);
+		bufferSize += rttiGetElemSize(tonemapping.filmicCurveToeNumerator);
+		bufferSize += rttiGetElemSize(tonemapping.filmicCurveToeDenominator);
+		bufferSize += rttiGetElemSize(tonemapping.filmicCurveLinearWhitePoint);
+
+		bufferSize += rttiGetElemSize(whiteBalance.temperature);
+		bufferSize += rttiGetElemSize(whiteBalance.tint);
+
+		bufferSize += rttiGetElemSize(colorGrading.saturation);
+		bufferSize += rttiGetElemSize(colorGrading.contrast);
+		bufferSize += rttiGetElemSize(colorGrading.gain);
+		bufferSize += rttiGetElemSize(colorGrading.offset);
+
+		bufferSize += rttiGetElemSize(depthOfField.enabled);
+		bufferSize += rttiGetElemSize(depthOfField.focalDistance);
+		bufferSize += rttiGetElemSize(depthOfField.focalRange);
+		bufferSize += rttiGetElemSize(depthOfField.nearTransitionRange);
+		bufferSize += rttiGetElemSize(depthOfField.farTransitionRange);
+		bufferSize += rttiGetElemSize(depthOfField.nearBlurAmount);
+		bufferSize += rttiGetElemSize(depthOfField.farBlurAmount);
+
+		bufferSize += rttiGetElemSize(ambientOcclusion.enabled);
+		bufferSize += rttiGetElemSize(ambientOcclusion.radius);
+		bufferSize += rttiGetElemSize(ambientOcclusion.bias);
+		bufferSize += rttiGetElemSize(ambientOcclusion.fadeRange);
+		bufferSize += rttiGetElemSize(ambientOcclusion.fadeDistance);
+		bufferSize += rttiGetElemSize(ambientOcclusion.intensity);
+		bufferSize += rttiGetElemSize(ambientOcclusion.power);
+		bufferSize += rttiGetElemSize(ambientOcclusion.quality);
+
+		bufferSize += rttiGetElemSize(screenSpaceReflections.enabled);
+		bufferSize += rttiGetElemSize(screenSpaceReflections.intensity);
+		bufferSize += rttiGetElemSize(screenSpaceReflections.maxRoughness);
+		bufferSize += rttiGetElemSize(screenSpaceReflections.quality);
+
+		if (buffer == nullptr)
+		{
+			size = bufferSize;
+			return;
+		}
+
+		if (bufferSize != size)
+		{
+			LOGERR("Invalid buffer size");
+			return;
+		}
+
+		char* writeDst = (char*)buffer;
+		writeDst = rttiWriteElem(enableAutoExposure, writeDst);
+		writeDst = rttiWriteElem(enableTonemapping, writeDst);
+		writeDst = rttiWriteElem(exposureScale, writeDst);
+		writeDst = rttiWriteElem(gamma, writeDst);
+		writeDst = rttiWriteElem(enableFXAA, writeDst);
+
+		writeDst = rttiWriteElem(autoExposure.histogramLog2Min, writeDst);
+		writeDst = rttiWriteElem(autoExposure.histogramLog2Max, writeDst);
+		writeDst = rttiWriteElem(autoExposure.histogramPctLow, writeDst);
+		writeDst = rttiWriteElem(autoExposure.histogramPctHigh, writeDst);
+		writeDst = rttiWriteElem(autoExposure.minEyeAdaptation, writeDst);
+		writeDst = rttiWriteElem(autoExposure.maxEyeAdaptation, writeDst);
+		writeDst = rttiWriteElem(autoExposure.eyeAdaptationSpeedUp, writeDst);
+		writeDst = rttiWriteElem(autoExposure.eyeAdaptationSpeedDown, writeDst);
+
+		writeDst = rttiWriteElem(tonemapping.filmicCurveShoulderStrength, writeDst);
+		writeDst = rttiWriteElem(tonemapping.filmicCurveLinearStrength, writeDst);
+		writeDst = rttiWriteElem(tonemapping.filmicCurveLinearAngle, writeDst);
+		writeDst = rttiWriteElem(tonemapping.filmicCurveToeStrength, writeDst);
+		writeDst = rttiWriteElem(tonemapping.filmicCurveToeNumerator, writeDst);
+		writeDst = rttiWriteElem(tonemapping.filmicCurveToeDenominator, writeDst);
+		writeDst = rttiWriteElem(tonemapping.filmicCurveLinearWhitePoint, writeDst);
+
+		writeDst = rttiWriteElem(whiteBalance.temperature, writeDst);
+		writeDst = rttiWriteElem(whiteBalance.tint, writeDst);
+
+		writeDst = rttiWriteElem(colorGrading.saturation, writeDst);
+		writeDst = rttiWriteElem(colorGrading.contrast, writeDst);
+		writeDst = rttiWriteElem(colorGrading.gain, writeDst);
+		writeDst = rttiWriteElem(colorGrading.offset, writeDst);
+
+		writeDst = rttiWriteElem(depthOfField.enabled, writeDst);
+		writeDst = rttiWriteElem(depthOfField.focalDistance, writeDst);
+		writeDst = rttiWriteElem(depthOfField.focalRange, writeDst);
+		writeDst = rttiWriteElem(depthOfField.nearTransitionRange, writeDst);
+		writeDst = rttiWriteElem(depthOfField.farTransitionRange, writeDst);
+		writeDst = rttiWriteElem(depthOfField.nearBlurAmount, writeDst);
+		writeDst = rttiWriteElem(depthOfField.farBlurAmount, writeDst);
+
+		writeDst = rttiWriteElem(ambientOcclusion.enabled, writeDst);
+		writeDst = rttiWriteElem(ambientOcclusion.radius, writeDst);
+		writeDst = rttiWriteElem(ambientOcclusion.bias, writeDst);
+		writeDst = rttiWriteElem(ambientOcclusion.fadeRange, writeDst);
+		writeDst = rttiWriteElem(ambientOcclusion.fadeDistance, writeDst);
+		writeDst = rttiWriteElem(ambientOcclusion.intensity, writeDst);
+		writeDst = rttiWriteElem(ambientOcclusion.power, writeDst);
+		writeDst = rttiWriteElem(ambientOcclusion.quality, writeDst);
+
+		writeDst = rttiWriteElem(screenSpaceReflections.enabled, writeDst);
+		writeDst = rttiWriteElem(screenSpaceReflections.intensity, writeDst);
+		writeDst = rttiWriteElem(screenSpaceReflections.maxRoughness, writeDst);
+		writeDst = rttiWriteElem(screenSpaceReflections.quality, writeDst);
+	}
+
+	void PostProcessSettings::_setSyncData(UINT8* buffer, UINT32 size)
+	{
+		char* readSource = (char*)buffer;
+
+		readSource = rttiReadElem(enableAutoExposure, readSource);
+		readSource = rttiReadElem(enableTonemapping, readSource);
+		readSource = rttiReadElem(exposureScale, readSource);
+		readSource = rttiReadElem(gamma, readSource);
+		readSource = rttiReadElem(enableFXAA, readSource);
+
+		readSource = rttiReadElem(autoExposure.histogramLog2Min, readSource);
+		readSource = rttiReadElem(autoExposure.histogramLog2Max, readSource);
+		readSource = rttiReadElem(autoExposure.histogramPctLow, readSource);
+		readSource = rttiReadElem(autoExposure.histogramPctHigh, readSource);
+		readSource = rttiReadElem(autoExposure.minEyeAdaptation, readSource);
+		readSource = rttiReadElem(autoExposure.maxEyeAdaptation, readSource);
+		readSource = rttiReadElem(autoExposure.eyeAdaptationSpeedUp, readSource);
+		readSource = rttiReadElem(autoExposure.eyeAdaptationSpeedDown, readSource);
+
+		readSource = rttiReadElem(tonemapping.filmicCurveShoulderStrength, readSource);
+		readSource = rttiReadElem(tonemapping.filmicCurveLinearStrength, readSource);
+		readSource = rttiReadElem(tonemapping.filmicCurveLinearAngle, readSource);
+		readSource = rttiReadElem(tonemapping.filmicCurveToeStrength, readSource);
+		readSource = rttiReadElem(tonemapping.filmicCurveToeNumerator, readSource);
+		readSource = rttiReadElem(tonemapping.filmicCurveToeDenominator, readSource);
+		readSource = rttiReadElem(tonemapping.filmicCurveLinearWhitePoint, readSource);
+
+		readSource = rttiReadElem(whiteBalance.temperature, readSource);
+		readSource = rttiReadElem(whiteBalance.tint, readSource);
+
+		readSource = rttiReadElem(colorGrading.saturation, readSource);
+		readSource = rttiReadElem(colorGrading.contrast, readSource);
+		readSource = rttiReadElem(colorGrading.gain, readSource);
+		readSource = rttiReadElem(colorGrading.offset, readSource);
+
+		readSource = rttiReadElem(depthOfField.enabled, readSource);
+		readSource = rttiReadElem(depthOfField.focalDistance, readSource);
+		readSource = rttiReadElem(depthOfField.focalRange, readSource);
+		readSource = rttiReadElem(depthOfField.nearTransitionRange, readSource);
+		readSource = rttiReadElem(depthOfField.farTransitionRange, readSource);
+		readSource = rttiReadElem(depthOfField.nearBlurAmount, readSource);
+		readSource = rttiReadElem(depthOfField.farBlurAmount, readSource);
+
+		readSource = rttiReadElem(ambientOcclusion.enabled, readSource);
+		readSource = rttiReadElem(ambientOcclusion.radius, readSource);
+		readSource = rttiReadElem(ambientOcclusion.bias, readSource);
+		readSource = rttiReadElem(ambientOcclusion.fadeRange, readSource);
+		readSource = rttiReadElem(ambientOcclusion.fadeDistance, readSource);
+		readSource = rttiReadElem(ambientOcclusion.intensity, readSource);
+		readSource = rttiReadElem(ambientOcclusion.power, readSource);
+		readSource = rttiReadElem(ambientOcclusion.quality, readSource);
+
+		readSource = rttiReadElem(screenSpaceReflections.enabled, readSource);
+		readSource = rttiReadElem(screenSpaceReflections.intensity, readSource);
+		readSource = rttiReadElem(screenSpaceReflections.maxRoughness, readSource);
+		readSource = rttiReadElem(screenSpaceReflections.quality, readSource);
+	}
 }

+ 0 - 3
Source/BansheeEngine/CMakeSources.cmake

@@ -87,7 +87,6 @@ set(BS_BANSHEEENGINE_INC_RENDERER
 	"Include/BsRendererMaterialManager.h"
 	"Include/BsRenderQueue.h"
 	"Include/BsRendererUtility.h"
-	"Include/BsStandardPostProcessSettings.h"	
 	"Include/BsLightProbeCache.h"
 	"Include/BsIBLUtility.h"
 )
@@ -136,7 +135,6 @@ set(BS_BANSHEEENGINE_INC_RTTI
 	"Include/BsCGUIWidgetRTTI.h"
 	"Include/BsGameSettingsRTTI.h"
 	"Include/BsResourceMappingRTTI.h"
-	"Include/BsStandardPostProcessSettingsRTTI.h"
 )
 
 set(BS_BANSHEEENGINE_INC_NOFILTER
@@ -176,7 +174,6 @@ set(BS_BANSHEEENGINE_SRC_RENDERER
 	"Source/BsRendererMaterialManager.cpp"
 	"Source/BsRenderQueue.cpp"
 	"Source/BsRendererUtility.cpp"
-	"Source/BsStandardPostProcessSettings.cpp"
 	"Source/BsLightProbeCache.cpp"
 	"Source/BsIBLUtility.cpp"
 )

+ 7 - 8
Source/BansheeEngine/Include/BsPrerequisites.h

@@ -227,13 +227,12 @@ namespace bs
 		/* TID_CLight = 30012, */
 		TID_GameSettings = 30013,
 		TID_ResourceMapping = 30014,
-		TID_StandardPostProcessSettings = 30015,
-		TID_AutoExposureSettings = 30016,
-		TID_TonemappingSettings = 30017,
-		TID_WhiteBalanceSettings = 30018,
-		TID_ColorGradingSettings = 30019,
-		TID_DepthOfFieldSettings = 30020,
-		TID_AmbientOcclusionSettings = 30021,
-		TID_ScreenSpaceReflectionsSettings = 30022
+		//TID_AutoExposureSettings = 30016,
+		//TID_TonemappingSettings = 30017,
+		//TID_WhiteBalanceSettings = 30018,
+		//TID_ColorGradingSettings = 30019,
+		//TID_DepthOfFieldSettings = 30020,
+		//TID_AmbientOcclusionSettings = 30021,
+		//TID_ScreenSpaceReflectionsSettings = 30022
 	};
 }

+ 0 - 449
Source/BansheeEngine/Include/BsStandardPostProcessSettings.h

@@ -1,449 +0,0 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-#pragma once
-
-#include "BsPrerequisites.h"
-#include "BsPostProcessSettings.h"
-#include "BsVector3.h"
-
-namespace bs
-{
-	/** @addtogroup Renderer
-	 *  @{
-	 */
-
-	/** Settings that control automatic exposure (eye adaptation) post-process. */
-	struct BS_EXPORT AutoExposureSettings : public IReflectable
-	{
-		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 (for
-		 * example 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 (for 
-		 * example 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 (for example 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 (for example 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;
-
-		/************************************************************************/
-		/* 								RTTI		                     		*/
-		/************************************************************************/
-	public:
-		friend class AutoExposureSettingsRTTI;
-		static RTTITypeBase* getRTTIStatic();
-		RTTITypeBase* getRTTI() const override;
-	};
-
-	/** Settings that control tonemap post-process. */
-	struct BS_EXPORT TonemappingSettings : public IReflectable
-	{
-		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;
-
-		/************************************************************************/
-		/* 								RTTI		                     		*/
-		/************************************************************************/
-	public:
-		friend class TonemappingSettingsRTTI;
-		static RTTITypeBase* getRTTIStatic();
-		RTTITypeBase* getRTTI() const override;
-	};
-
-	/** Settings that control white balance post-process. */
-	struct BS_EXPORT WhiteBalanceSettings : public IReflectable
-	{
-		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;
-
-		/************************************************************************/
-		/* 								RTTI		                     		*/
-		/************************************************************************/
-	public:
-		friend class WhiteBalanceSettingsRTTI;
-		static RTTITypeBase* getRTTIStatic();
-		RTTITypeBase* getRTTI() const override;
-	};
-
-	/** Settings that control color grading post-process. */
-	struct BS_EXPORT ColorGradingSettings : public IReflectable
-	{
-		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;
-
-		/************************************************************************/
-		/* 								RTTI		                     		*/
-		/************************************************************************/
-	public:
-		friend class ColorGradingSettingsRTTI;
-		static RTTITypeBase* getRTTIStatic();
-		RTTITypeBase* getRTTI() const override;
-	};
-
-	/** Settings that control screen space ambient occlusion. */
-	struct BS_EXPORT AmbientOcclusionSettings : public IReflectable
-	{
-		AmbientOcclusionSettings();
-
-		/** Enables or disabled the screen space ambient occlusion effect. */
-		bool enabled;
-
-		/** 
-		 * Radius (in world space, in meters) over which occluders are searched for. Smaller radius ensures better sampling
-		 * precision but can miss occluders. Larger radius ensures far away occluders are considered but can yield lower
-		 * quality or noise because of low sampling precision. Usually best to keep at around a meter, valid range
-		 * is roughly [0.05, 5.0].
-		 */
-		float radius;
-
-		/**
-		 * Bias used to reduce false occlusion artifacts. Higher values reduce the amount of artifacts but will cause
-		 * details to be lost in areas where occlusion isn't high. Value is in millimeters. Usually best to keep at a few
-		 * dozen millimeters, valid range is roughly [0, 200].
-		 */
-		float bias;
-
-		/**
-		 * Distance (in view space, in meters) after which AO starts fading out. The fade process will happen over the
-		 * range as specified by @p fadeRange.
-		 */
-		float fadeDistance;
-
-		/**
-		 * Range (in view space, in meters) in which AO fades out from 100% to 0%. AO starts fading out after the distance
-		 * specified in @p fadeDistance.
-		 */
-		float fadeRange;
-
-		/**
-		 * Linearly scales the intensity of the AO effect. Values less than 1 make the AO effect less pronounced, and vice
-		 * versa. Valid range is roughly [0.2, 2].
-		 */
-		float intensity;
-
-		/**
-		 * Controls how quickly does the AO darkening effect increase with higher occlusion percent. This is a non-linear
-		 * control and will cause the darkening to ramp up exponentially. Valid range is roughly [1, 4], where 1 means no
-		 * extra darkening will occur.
-		 */
-		float power;
-
-		/**
-		 * Quality level of generated ambient occlusion. In range [0, 4]. Higher levels yield higher quality AO at the cost
-		 * of performance.
-		 */
-		UINT32 quality;
-
-		/************************************************************************/
-		/* 								RTTI		                     		*/
-		/************************************************************************/
-	public:
-		friend class AmbientOcclusionSettingsRTTI;
-		static RTTITypeBase* getRTTIStatic();
-		RTTITypeBase* getRTTI() const override;
-	};
-
-	/** Settings that control the depth-of-field effect. */
-	struct BS_EXPORT DepthOfFieldSettings : public IReflectable
-	{
-		DepthOfFieldSettings();
-
-		/** Enables or disables the depth of field effect. */
-		bool enabled;
-
-		/** 
-		 * Distance from the camera at which the focal plane is located in. Objects at this distance will be fully in focus.
-		 */
-		float focalDistance;
-		
-		/** 
-		 * Range within which the objects remain fully in focus. This range is applied relative to the focal distance. 
-		 * Only relevant if Gaussian depth of field is used as other methods don't use a constant in-focus range.
-		 */
-		float focalRange;
-
-		/**
-		 * Determines the size of the range within which objects transition from focused to fully unfocused, at the near 
-		 * plane. Only relevant for Gaussian depth of field.
-		 */
-		float nearTransitionRange;
-
-		/**
-		 * Determines the size of the range within which objects transition from focused to fully unfocused, at the far 
-		 * plane. Only relevant for Gaussian depth of field.
-		 */
-		float farTransitionRange;
-
-		/** 
-		 * Determines the amount of blur to apply to fully unfocused objects that are closer to camera than the in-focus
-		 * zone. Set to zero to disable near-field blur. Only relevant for Gaussian depth of field.
-		 */
-		float nearBlurAmount;
-
-		/** 
-		 * Determines the amount of blur to apply to fully unfocused objects that are farther away from camera than the
-		 * in-focus zone. Set to zero to disable far-field blur. Only relevant for Gaussian depth of field.
-		 */
-		float farBlurAmount;
-
-		/************************************************************************/
-		/* 								RTTI		                     		*/
-		/************************************************************************/
-	public:
-		friend class DepthOfFieldSettingsRTTI;
-		static RTTITypeBase* getRTTIStatic();
-		RTTITypeBase* getRTTI() const override;
-	};
-
-	/** 
-	 * Settings that control the screen space reflections effect. Screen space reflections provide high quality mirror-like
-	 * reflections at low performance cost. They should be used together with reflection probes as the effects complement
-	 * each other. As the name implies, the reflections are only limited to geometry drawn on the screen and the system will
-	 * fall back to refl. probes when screen space data is unavailable. Similarly the system will fall back to refl. probes
-	 * for rougher (more glossy rather than mirror-like) surfaces. Those surfaces require a higher number of samples to
-	 * achieve the glossy look, so we instead fall back to refl. probes which are pre-filtered and can be quickly sampled.
-	 */
-	struct BS_EXPORT ScreenSpaceReflectionsSettings : public IReflectable
-	{
-		ScreenSpaceReflectionsSettings();
-
-		/** Enables or disables the SSR effect. */
-		bool enabled;
-
-		/** 
-		 * Quality of the SSR effect. Higher values cast more sample rays, and march those rays are lower increments for
-		 * better precision. This results in higher quality, as well as a higher performance requirement. Valid range is
-		 * [0, 4], default is 2.
-		 */
-		UINT32 quality;
-
-		/** Intensity of the screen space reflections. Valid range is [0, 1]. Default is 1 (100%). */
-		float intensity;
-
-		/** 
-		 * Roughness at which screen space reflections start fading out and become replaced with refl. probes. Valid range
-		 * is [0, 1]. Default is 0.8.
-		 */
-		float maxRoughness;
-
-		/************************************************************************/
-		/* 								RTTI		                     		*/
-		/************************************************************************/
-	public:
-		friend class ScreenSpaceReflectionsRTTI;
-		static RTTITypeBase* getRTTIStatic();
-		RTTITypeBase* getRTTI() const override;
-	};
-
-	/** Settings that control the post-process operations. */
-	struct BS_EXPORT StandardPostProcessSettings : public PostProcessSettings
-	{
-		StandardPostProcessSettings();
-
-		/**
-		 * 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;
-
-		/** Parameters used for customizing the depth of field effect. */
-		DepthOfFieldSettings depthOfField;
-
-		/** Parameters used for customizing screen space ambient occlusion. */
-		AmbientOcclusionSettings ambientOcclusion;
-
-		/** Parameters used for customizing screen space reflections. */
-		ScreenSpaceReflectionsSettings screenSpaceReflections;
-
-		/** Enables the fast approximate anti-aliasing effect. */
-		bool enableFXAA;
-
-		/**
-		 * Log2 value to scale the eye adaptation by (for example 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;
-
-		/** @copydoc PostProcessSettings::_getSyncData */
-		void _getSyncData(UINT8* buffer, UINT32& size) override;
-
-		/** @copydoc PostProcessSettings::_setSyncData */
-		void _setSyncData(UINT8* buffer, UINT32 size) override;
-
-		/************************************************************************/
-		/* 								RTTI		                     		*/
-		/************************************************************************/
-	public:
-		friend class StandardPostProcessSettingsRTTI;
-		static RTTITypeBase* getRTTIStatic();
-		RTTITypeBase* getRTTI() const override;
-	};
-
-	/** @} */
-}

+ 0 - 294
Source/BansheeEngine/Include/BsStandardPostProcessSettingsRTTI.h

@@ -1,294 +0,0 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-#pragma once
-
-#include "BsPrerequisites.h"
-#include "BsRTTIType.h"
-#include "BsStandardPostProcessSettings.h"
-
-namespace bs
-{
-	/** @cond RTTI */
-	/** @addtogroup RTTI-Impl-Engine
-	 *  @{
-	 */
-
-	class BS_EXPORT AutoExposureSettingsRTTI : public RTTIType <AutoExposureSettings, IReflectable, AutoExposureSettingsRTTI>
-	{
-	private:
-		BS_BEGIN_RTTI_MEMBERS
-			BS_RTTI_MEMBER_PLAIN(histogramLog2Min, 0)
-			BS_RTTI_MEMBER_PLAIN(histogramLog2Max, 1)
-			BS_RTTI_MEMBER_PLAIN(histogramPctLow, 2)
-			BS_RTTI_MEMBER_PLAIN(histogramPctHigh, 3)
-			BS_RTTI_MEMBER_PLAIN(minEyeAdaptation, 4)
-			BS_RTTI_MEMBER_PLAIN(maxEyeAdaptation, 5)
-			BS_RTTI_MEMBER_PLAIN(eyeAdaptationSpeedUp, 6)
-			BS_RTTI_MEMBER_PLAIN(eyeAdaptationSpeedDown, 7)
-		BS_END_RTTI_MEMBERS
-
-	public:
-		AutoExposureSettingsRTTI()
-			:mInitMembers(this)
-		{ }
-
-		const String& getRTTIName() override
-		{
-			static String name = "AutoExposureSettings";
-			return name;
-		}
-
-		UINT32 getRTTIId() override
-		{
-			return TID_AutoExposureSettings;
-		}
-
-		SPtr<IReflectable> newRTTIObject() override
-		{
-			return bs_shared_ptr_new<AutoExposureSettings>();
-		}
-	};
-
-	class BS_EXPORT TonemappingSettingsRTTI : public RTTIType <TonemappingSettings, IReflectable, TonemappingSettingsRTTI>
-	{
-	private:
-		BS_BEGIN_RTTI_MEMBERS
-			BS_RTTI_MEMBER_PLAIN(filmicCurveShoulderStrength, 0)
-			BS_RTTI_MEMBER_PLAIN(filmicCurveLinearStrength, 1)
-			BS_RTTI_MEMBER_PLAIN(filmicCurveLinearAngle, 2)
-			BS_RTTI_MEMBER_PLAIN(filmicCurveToeStrength, 3)
-			BS_RTTI_MEMBER_PLAIN(filmicCurveToeNumerator, 4)
-			BS_RTTI_MEMBER_PLAIN(filmicCurveToeDenominator, 5)
-			BS_RTTI_MEMBER_PLAIN(filmicCurveLinearWhitePoint, 6)
-		BS_END_RTTI_MEMBERS
-
-	public:
-		TonemappingSettingsRTTI()
-			:mInitMembers(this)
-		{ }
-
-		const String& getRTTIName() override
-		{
-			static String name = "TonemappingSettings";
-			return name;
-		}
-
-		UINT32 getRTTIId() override
-		{
-			return TID_TonemappingSettings;
-		}
-
-		SPtr<IReflectable> newRTTIObject() override
-		{
-			return bs_shared_ptr_new<TonemappingSettings>();
-		}
-	};
-
-	class BS_EXPORT WhiteBalanceSettingsRTTI : public RTTIType <WhiteBalanceSettings, IReflectable, WhiteBalanceSettingsRTTI>
-	{
-	private:
-		BS_BEGIN_RTTI_MEMBERS
-			BS_RTTI_MEMBER_PLAIN(temperature, 0)
-			BS_RTTI_MEMBER_PLAIN(tint, 1)
-		BS_END_RTTI_MEMBERS
-
-	public:
-		WhiteBalanceSettingsRTTI()
-			:mInitMembers(this)
-		{ }
-
-		const String& getRTTIName() override
-		{
-			static String name = "WhiteBalanceSettings";
-			return name;
-		}
-
-		UINT32 getRTTIId() override
-		{
-			return TID_WhiteBalanceSettings;
-		}
-
-		SPtr<IReflectable> newRTTIObject() override
-		{
-			return bs_shared_ptr_new<WhiteBalanceSettings>();
-		}
-	};
-
-	class BS_EXPORT ColorGradingSettingsRTTI : public RTTIType <ColorGradingSettings, IReflectable, ColorGradingSettingsRTTI>
-	{
-	private:
-		BS_BEGIN_RTTI_MEMBERS
-			BS_RTTI_MEMBER_PLAIN(saturation, 0)
-			BS_RTTI_MEMBER_PLAIN(contrast, 1)
-			BS_RTTI_MEMBER_PLAIN(gain, 2)
-			BS_RTTI_MEMBER_PLAIN(offset, 3)
-		BS_END_RTTI_MEMBERS
-
-	public:
-		ColorGradingSettingsRTTI()
-			:mInitMembers(this)
-		{ }
-
-		const String& getRTTIName() override
-		{
-			static String name = "ColorGradingSettings";
-			return name;
-		}
-
-		UINT32 getRTTIId() override
-		{
-			return TID_ColorGradingSettings;
-		}
-
-		SPtr<IReflectable> newRTTIObject() override
-		{
-			return bs_shared_ptr_new<ColorGradingSettings>();
-		}
-	};
-
-	class BS_EXPORT DepthOfFieldSettingsRTTI : public RTTIType <DepthOfFieldSettings, IReflectable, DepthOfFieldSettingsRTTI>
-	{
-	private:
-		BS_BEGIN_RTTI_MEMBERS
-			BS_RTTI_MEMBER_PLAIN(enabled, 0)
-			BS_RTTI_MEMBER_PLAIN(focalDistance, 1)
-			BS_RTTI_MEMBER_PLAIN(focalRange, 2)
-			BS_RTTI_MEMBER_PLAIN(nearTransitionRange, 3)
-			BS_RTTI_MEMBER_PLAIN(farTransitionRange, 4)
-			BS_RTTI_MEMBER_PLAIN(nearBlurAmount, 5)
-			BS_RTTI_MEMBER_PLAIN(farBlurAmount, 6)
-		BS_END_RTTI_MEMBERS
-
-	public:
-		DepthOfFieldSettingsRTTI()
-			:mInitMembers(this)
-		{ }
-
-		const String& getRTTIName() override
-		{
-			static String name = "DepthOfFieldSettings";
-			return name;
-		}
-
-		UINT32 getRTTIId() override
-		{
-			return TID_DepthOfFieldSettings;
-		}
-
-		SPtr<IReflectable> newRTTIObject() override
-		{
-			return bs_shared_ptr_new<DepthOfFieldSettings>();
-		}
-	};
-
-	class BS_EXPORT AmbientOcclusionSettingsRTTI : public RTTIType <AmbientOcclusionSettings, IReflectable, AmbientOcclusionSettingsRTTI>
-	{
-	private:
-		BS_BEGIN_RTTI_MEMBERS
-			BS_RTTI_MEMBER_PLAIN(enabled, 0)
-			BS_RTTI_MEMBER_PLAIN(radius, 1)
-			BS_RTTI_MEMBER_PLAIN(bias, 2)
-			BS_RTTI_MEMBER_PLAIN(fadeRange, 3)
-			BS_RTTI_MEMBER_PLAIN(fadeDistance, 4)
-			BS_RTTI_MEMBER_PLAIN(intensity, 5)
-			BS_RTTI_MEMBER_PLAIN(power, 6)
-			BS_RTTI_MEMBER_PLAIN(quality, 7)
-		BS_END_RTTI_MEMBERS
-
-	public:
-		AmbientOcclusionSettingsRTTI()
-			:mInitMembers(this)
-		{ }
-
-		const String& getRTTIName() override
-		{
-			static String name = "AmbientOcclusionSettings";
-			return name;
-		}
-
-		UINT32 getRTTIId() override
-		{
-			return TID_AmbientOcclusionSettings;
-		}
-
-		SPtr<IReflectable> newRTTIObject() override
-		{
-			return bs_shared_ptr_new<AmbientOcclusionSettings>();
-		}
-	};
-
-	class BS_EXPORT ScreenSpaceReflectionsSettingsRTTI : public RTTIType <ScreenSpaceReflectionsSettings, IReflectable, ScreenSpaceReflectionsSettingsRTTI>
-	{
-	private:
-		BS_BEGIN_RTTI_MEMBERS
-			BS_RTTI_MEMBER_PLAIN(enabled, 0)
-			BS_RTTI_MEMBER_PLAIN(intensity, 1)
-			BS_RTTI_MEMBER_PLAIN(maxRoughness, 2)
-			BS_RTTI_MEMBER_PLAIN(quality, 3)
-		BS_END_RTTI_MEMBERS
-
-	public:
-		ScreenSpaceReflectionsSettingsRTTI()
-			:mInitMembers(this)
-		{ }
-
-		const String& getRTTIName() override
-		{
-			static String name = "ScreenSpaceReflectionsSettings";
-			return name;
-		}
-
-		UINT32 getRTTIId() override
-		{
-			return TID_ScreenSpaceReflectionsSettings;
-		}
-
-		SPtr<IReflectable> newRTTIObject() override
-		{
-			return bs_shared_ptr_new<ScreenSpaceReflectionsSettings>();
-		}
-	};
-
-	class BS_EXPORT StandardPostProcessSettingsRTTI : public RTTIType <StandardPostProcessSettings, PostProcessSettings, StandardPostProcessSettingsRTTI>
-	{
-	private:
-		BS_BEGIN_RTTI_MEMBERS
-			BS_RTTI_MEMBER_PLAIN(enableAutoExposure, 0)
-			BS_RTTI_MEMBER_REFL(autoExposure, 1)
-			BS_RTTI_MEMBER_PLAIN(enableTonemapping, 2)
-			BS_RTTI_MEMBER_REFL(tonemapping, 3)
-			BS_RTTI_MEMBER_REFL(whiteBalance, 4)
-			BS_RTTI_MEMBER_REFL(colorGrading, 5)
-			BS_RTTI_MEMBER_PLAIN(exposureScale, 6)
-			BS_RTTI_MEMBER_PLAIN(gamma, 7)
-			BS_RTTI_MEMBER_REFL(depthOfField, 8)
-			BS_RTTI_MEMBER_PLAIN(enableFXAA, 9)
-			BS_RTTI_MEMBER_REFL(ambientOcclusion, 10)
-			BS_RTTI_MEMBER_REFL(screenSpaceReflections, 11)
-		BS_END_RTTI_MEMBERS
-			
-	public:
-		StandardPostProcessSettingsRTTI()
-			:mInitMembers(this)
-		{ }
-
-		const String& getRTTIName() override
-		{
-			static String name = "StandardPostProcessSettings";
-			return name;
-		}
-
-		UINT32 getRTTIId() override
-		{
-			return TID_StandardPostProcessSettings;
-		}
-
-		SPtr<IReflectable> newRTTIObject() override
-		{
-			return bs_shared_ptr_new<StandardPostProcessSettings>();
-		}
-	};
-
-	/** @} */
-	/** @endcond */
-}

+ 0 - 306
Source/BansheeEngine/Source/BsStandardPostProcessSettings.cpp

@@ -1,306 +0,0 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-#include "BsStandardPostProcessSettings.h"
-#include "BsBinarySerializer.h"
-#include "BsStandardPostProcessSettingsRTTI.h"
-
-namespace bs
-{
-	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)
-	{ }
-
-	RTTITypeBase* AutoExposureSettings::getRTTIStatic()
-	{
-		return AutoExposureSettingsRTTI::instance();
-	}
-
-	RTTITypeBase* AutoExposureSettings::getRTTI() const
-	{
-		return AutoExposureSettings::getRTTIStatic();
-	}
-
-	TonemappingSettings::TonemappingSettings()
-		: filmicCurveShoulderStrength(0.15f), filmicCurveLinearStrength(0.5f), filmicCurveLinearAngle(0.1f)
-		, filmicCurveToeStrength(0.2f), filmicCurveToeNumerator(0.02f), filmicCurveToeDenominator(0.3f)
-		, filmicCurveLinearWhitePoint(11.2f)
-	{ }
-
-	RTTITypeBase* TonemappingSettings::getRTTIStatic()
-	{
-		return TonemappingSettingsRTTI::instance();
-	}
-
-	RTTITypeBase* TonemappingSettings::getRTTI() const
-	{
-		return TonemappingSettings::getRTTIStatic();
-	}
-
-	WhiteBalanceSettings::WhiteBalanceSettings()
-		: temperature(6500.0f), tint(0.0f)
-	{ }
-
-	RTTITypeBase* WhiteBalanceSettings::getRTTIStatic()
-	{
-		return WhiteBalanceSettingsRTTI::instance();
-	}
-
-	RTTITypeBase* WhiteBalanceSettings::getRTTI() const
-	{
-		return WhiteBalanceSettings::getRTTIStatic();
-	}
-
-	ColorGradingSettings::ColorGradingSettings()
-		: saturation(Vector3::ONE), contrast(Vector3::ONE), gain(Vector3::ONE), offset(Vector3::ZERO)
-	{ }
-
-	RTTITypeBase* ColorGradingSettings::getRTTIStatic()
-	{
-		return ColorGradingSettingsRTTI::instance();
-	}
-
-	RTTITypeBase* ColorGradingSettings::getRTTI() const
-	{
-		return ColorGradingSettings::getRTTIStatic();
-	}
-
-	AmbientOcclusionSettings::AmbientOcclusionSettings()
-		: enabled(true), radius(1.5f), bias(1.0f), fadeDistance(500.0f), fadeRange(50.0f), intensity(1.0f), power(1.0f)
-		, quality(3)
-	{ }
-
-	RTTITypeBase* AmbientOcclusionSettings::getRTTIStatic()
-	{
-		return AmbientOcclusionSettingsRTTI::instance();
-	}
-
-	RTTITypeBase* AmbientOcclusionSettings::getRTTI() const
-	{
-		return AmbientOcclusionSettings::getRTTIStatic();
-	}
-
-	DepthOfFieldSettings::DepthOfFieldSettings()
-		: enabled(false), focalDistance(0.75f), focalRange(0.75f), nearTransitionRange(0.25f), farTransitionRange(0.25f)
-		, nearBlurAmount(0.15f), farBlurAmount(0.15f)
-	{ }
-
-	RTTITypeBase* DepthOfFieldSettings::getRTTIStatic()
-	{
-		return DepthOfFieldSettingsRTTI::instance();
-	}
-
-	RTTITypeBase* DepthOfFieldSettings::getRTTI() const
-	{
-		return DepthOfFieldSettings::getRTTIStatic();
-	}
-
-	ScreenSpaceReflectionsSettings::ScreenSpaceReflectionsSettings()
-		: enabled(true), intensity(1.0f), maxRoughness(0.8f), quality(2)
-	{ }
-
-	RTTITypeBase* ScreenSpaceReflectionsSettings::getRTTIStatic()
-	{
-		return ScreenSpaceReflectionsSettingsRTTI::instance();
-	}
-
-	RTTITypeBase* ScreenSpaceReflectionsSettings::getRTTI() const
-	{
-		return ScreenSpaceReflectionsSettings::getRTTIStatic();
-	}
-
-	StandardPostProcessSettings::StandardPostProcessSettings()
-		: enableAutoExposure(true), enableTonemapping(true), enableFXAA(false), exposureScale(0.0f), gamma(2.2f)
-	{ }
-
-	RTTITypeBase* StandardPostProcessSettings::getRTTIStatic()
-	{
-		return StandardPostProcessSettingsRTTI::instance();
-	}
-
-	RTTITypeBase* StandardPostProcessSettings::getRTTI() const
-	{
-		return StandardPostProcessSettings::getRTTIStatic();
-	}
-
-	void StandardPostProcessSettings::_getSyncData(UINT8* buffer, UINT32& size)
-	{
-		UINT32 bufferSize = 0;
-		bufferSize += rttiGetElemSize(enableAutoExposure);
-		bufferSize += rttiGetElemSize(enableTonemapping);
-		bufferSize += rttiGetElemSize(exposureScale);
-		bufferSize += rttiGetElemSize(gamma);
-		bufferSize += rttiGetElemSize(enableFXAA);
-
-		bufferSize += rttiGetElemSize(autoExposure.histogramLog2Min);
-		bufferSize += rttiGetElemSize(autoExposure.histogramLog2Max);
-		bufferSize += rttiGetElemSize(autoExposure.histogramPctLow);
-		bufferSize += rttiGetElemSize(autoExposure.histogramPctHigh);
-		bufferSize += rttiGetElemSize(autoExposure.minEyeAdaptation);
-		bufferSize += rttiGetElemSize(autoExposure.maxEyeAdaptation);
-		bufferSize += rttiGetElemSize(autoExposure.eyeAdaptationSpeedUp);
-		bufferSize += rttiGetElemSize(autoExposure.eyeAdaptationSpeedDown);
-
-		bufferSize += rttiGetElemSize(tonemapping.filmicCurveShoulderStrength);
-		bufferSize += rttiGetElemSize(tonemapping.filmicCurveLinearStrength);
-		bufferSize += rttiGetElemSize(tonemapping.filmicCurveLinearAngle);
-		bufferSize += rttiGetElemSize(tonemapping.filmicCurveToeStrength);
-		bufferSize += rttiGetElemSize(tonemapping.filmicCurveToeNumerator);
-		bufferSize += rttiGetElemSize(tonemapping.filmicCurveToeDenominator);
-		bufferSize += rttiGetElemSize(tonemapping.filmicCurveLinearWhitePoint);
-
-		bufferSize += rttiGetElemSize(whiteBalance.temperature);
-		bufferSize += rttiGetElemSize(whiteBalance.tint);
-
-		bufferSize += rttiGetElemSize(colorGrading.saturation);
-		bufferSize += rttiGetElemSize(colorGrading.contrast);
-		bufferSize += rttiGetElemSize(colorGrading.gain);
-		bufferSize += rttiGetElemSize(colorGrading.offset);
-
-		bufferSize += rttiGetElemSize(depthOfField.enabled);
-		bufferSize += rttiGetElemSize(depthOfField.focalDistance);
-		bufferSize += rttiGetElemSize(depthOfField.focalRange);
-		bufferSize += rttiGetElemSize(depthOfField.nearTransitionRange);
-		bufferSize += rttiGetElemSize(depthOfField.farTransitionRange);
-		bufferSize += rttiGetElemSize(depthOfField.nearBlurAmount);
-		bufferSize += rttiGetElemSize(depthOfField.farBlurAmount);
-
-		bufferSize += rttiGetElemSize(ambientOcclusion.enabled);
-		bufferSize += rttiGetElemSize(ambientOcclusion.radius);
-		bufferSize += rttiGetElemSize(ambientOcclusion.bias);
-		bufferSize += rttiGetElemSize(ambientOcclusion.fadeRange);
-		bufferSize += rttiGetElemSize(ambientOcclusion.fadeDistance);
-		bufferSize += rttiGetElemSize(ambientOcclusion.intensity);
-		bufferSize += rttiGetElemSize(ambientOcclusion.power);
-		bufferSize += rttiGetElemSize(ambientOcclusion.quality);
-
-		bufferSize += rttiGetElemSize(screenSpaceReflections.enabled);
-		bufferSize += rttiGetElemSize(screenSpaceReflections.intensity);
-		bufferSize += rttiGetElemSize(screenSpaceReflections.maxRoughness);
-		bufferSize += rttiGetElemSize(screenSpaceReflections.quality);
-
-		if (buffer == nullptr)
-		{
-			size = bufferSize;
-			return;
-		}
-
-		if (bufferSize != size)
-		{
-			LOGERR("Invalid buffer size");
-			return;
-		}
-
-		char* writeDst = (char*)buffer;
-		writeDst = rttiWriteElem(enableAutoExposure, writeDst);
-		writeDst = rttiWriteElem(enableTonemapping, writeDst);
-		writeDst = rttiWriteElem(exposureScale, writeDst);
-		writeDst = rttiWriteElem(gamma, writeDst);
-		writeDst = rttiWriteElem(enableFXAA, writeDst);
-
-		writeDst = rttiWriteElem(autoExposure.histogramLog2Min, writeDst);
-		writeDst = rttiWriteElem(autoExposure.histogramLog2Max, writeDst);
-		writeDst = rttiWriteElem(autoExposure.histogramPctLow, writeDst);
-		writeDst = rttiWriteElem(autoExposure.histogramPctHigh, writeDst);
-		writeDst = rttiWriteElem(autoExposure.minEyeAdaptation, writeDst);
-		writeDst = rttiWriteElem(autoExposure.maxEyeAdaptation, writeDst);
-		writeDst = rttiWriteElem(autoExposure.eyeAdaptationSpeedUp, writeDst);
-		writeDst = rttiWriteElem(autoExposure.eyeAdaptationSpeedDown, writeDst);
-
-		writeDst = rttiWriteElem(tonemapping.filmicCurveShoulderStrength, writeDst);
-		writeDst = rttiWriteElem(tonemapping.filmicCurveLinearStrength, writeDst);
-		writeDst = rttiWriteElem(tonemapping.filmicCurveLinearAngle, writeDst);
-		writeDst = rttiWriteElem(tonemapping.filmicCurveToeStrength, writeDst);
-		writeDst = rttiWriteElem(tonemapping.filmicCurveToeNumerator, writeDst);
-		writeDst = rttiWriteElem(tonemapping.filmicCurveToeDenominator, writeDst);
-		writeDst = rttiWriteElem(tonemapping.filmicCurveLinearWhitePoint, writeDst);
-
-		writeDst = rttiWriteElem(whiteBalance.temperature, writeDst);
-		writeDst = rttiWriteElem(whiteBalance.tint, writeDst);
-
-		writeDst = rttiWriteElem(colorGrading.saturation, writeDst);
-		writeDst = rttiWriteElem(colorGrading.contrast, writeDst);
-		writeDst = rttiWriteElem(colorGrading.gain, writeDst);
-		writeDst = rttiWriteElem(colorGrading.offset, writeDst);
-
-		writeDst = rttiWriteElem(depthOfField.enabled, writeDst);
-		writeDst = rttiWriteElem(depthOfField.focalDistance, writeDst);
-		writeDst = rttiWriteElem(depthOfField.focalRange, writeDst);
-		writeDst = rttiWriteElem(depthOfField.nearTransitionRange, writeDst);
-		writeDst = rttiWriteElem(depthOfField.farTransitionRange, writeDst);
-		writeDst = rttiWriteElem(depthOfField.nearBlurAmount, writeDst);
-		writeDst = rttiWriteElem(depthOfField.farBlurAmount, writeDst);
-
-		writeDst = rttiWriteElem(ambientOcclusion.enabled, writeDst);
-		writeDst = rttiWriteElem(ambientOcclusion.radius, writeDst);
-		writeDst = rttiWriteElem(ambientOcclusion.bias, writeDst);
-		writeDst = rttiWriteElem(ambientOcclusion.fadeRange, writeDst);
-		writeDst = rttiWriteElem(ambientOcclusion.fadeDistance, writeDst);
-		writeDst = rttiWriteElem(ambientOcclusion.intensity, writeDst);
-		writeDst = rttiWriteElem(ambientOcclusion.power, writeDst);
-		writeDst = rttiWriteElem(ambientOcclusion.quality, writeDst);
-
-		writeDst = rttiWriteElem(screenSpaceReflections.enabled, writeDst);
-		writeDst = rttiWriteElem(screenSpaceReflections.intensity, writeDst);
-		writeDst = rttiWriteElem(screenSpaceReflections.maxRoughness, writeDst);
-		writeDst = rttiWriteElem(screenSpaceReflections.quality, writeDst);
-	}
-
-	void StandardPostProcessSettings::_setSyncData(UINT8* buffer, UINT32 size)
-	{
-		char* readSource = (char*)buffer;
-
-		readSource = rttiReadElem(enableAutoExposure, readSource);
-		readSource = rttiReadElem(enableTonemapping, readSource);
-		readSource = rttiReadElem(exposureScale, readSource);
-		readSource = rttiReadElem(gamma, readSource);
-		readSource = rttiReadElem(enableFXAA, readSource);
-
-		readSource = rttiReadElem(autoExposure.histogramLog2Min, readSource);
-		readSource = rttiReadElem(autoExposure.histogramLog2Max, readSource);
-		readSource = rttiReadElem(autoExposure.histogramPctLow, readSource);
-		readSource = rttiReadElem(autoExposure.histogramPctHigh, readSource);
-		readSource = rttiReadElem(autoExposure.minEyeAdaptation, readSource);
-		readSource = rttiReadElem(autoExposure.maxEyeAdaptation, readSource);
-		readSource = rttiReadElem(autoExposure.eyeAdaptationSpeedUp, readSource);
-		readSource = rttiReadElem(autoExposure.eyeAdaptationSpeedDown, readSource);
-
-		readSource = rttiReadElem(tonemapping.filmicCurveShoulderStrength, readSource);
-		readSource = rttiReadElem(tonemapping.filmicCurveLinearStrength, readSource);
-		readSource = rttiReadElem(tonemapping.filmicCurveLinearAngle, readSource);
-		readSource = rttiReadElem(tonemapping.filmicCurveToeStrength, readSource);
-		readSource = rttiReadElem(tonemapping.filmicCurveToeNumerator, readSource);
-		readSource = rttiReadElem(tonemapping.filmicCurveToeDenominator, readSource);
-		readSource = rttiReadElem(tonemapping.filmicCurveLinearWhitePoint, readSource);
-
-		readSource = rttiReadElem(whiteBalance.temperature, readSource);
-		readSource = rttiReadElem(whiteBalance.tint, readSource);
-
-		readSource = rttiReadElem(colorGrading.saturation, readSource);
-		readSource = rttiReadElem(colorGrading.contrast, readSource);
-		readSource = rttiReadElem(colorGrading.gain, readSource);
-		readSource = rttiReadElem(colorGrading.offset, readSource);
-
-		readSource = rttiReadElem(depthOfField.enabled, readSource);
-		readSource = rttiReadElem(depthOfField.focalDistance, readSource);
-		readSource = rttiReadElem(depthOfField.focalRange, readSource);
-		readSource = rttiReadElem(depthOfField.nearTransitionRange, readSource);
-		readSource = rttiReadElem(depthOfField.farTransitionRange, readSource);
-		readSource = rttiReadElem(depthOfField.nearBlurAmount, readSource);
-		readSource = rttiReadElem(depthOfField.farBlurAmount, readSource);
-
-		readSource = rttiReadElem(ambientOcclusion.enabled, readSource);
-		readSource = rttiReadElem(ambientOcclusion.radius, readSource);
-		readSource = rttiReadElem(ambientOcclusion.bias, readSource);
-		readSource = rttiReadElem(ambientOcclusion.fadeRange, readSource);
-		readSource = rttiReadElem(ambientOcclusion.fadeDistance, readSource);
-		readSource = rttiReadElem(ambientOcclusion.intensity, readSource);
-		readSource = rttiReadElem(ambientOcclusion.power, readSource);
-		readSource = rttiReadElem(ambientOcclusion.quality, readSource);
-
-		readSource = rttiReadElem(screenSpaceReflections.enabled, readSource);
-		readSource = rttiReadElem(screenSpaceReflections.intensity, readSource);
-		readSource = rttiReadElem(screenSpaceReflections.maxRoughness, readSource);
-		readSource = rttiReadElem(screenSpaceReflections.quality, readSource);
-	}
-}

+ 3 - 10
Source/RenderBeast/Include/BsPostProcessing.h

@@ -6,8 +6,8 @@
 #include "BsRendererMaterial.h"
 #include "BsParamBlocks.h"
 #include "BsGpuResourcePool.h"
-#include "BsStandardPostProcessSettings.h"
 #include "BsLightRendering.h"
+#include "BsPostProcessSettings.h"
 
 namespace bs { namespace ct
 {
@@ -17,13 +17,6 @@ namespace bs { namespace ct
 	 *  @{
 	 */
 
-	/** Contains per-camera data used by post process effects. */
-	struct PostProcessInfo
-	{
-		SPtr<StandardPostProcessSettings> settings;
-		bool settingDirty = true;
-	};
-
 	BS_PARAM_BLOCK_BEGIN(DownsampleParamDef)
 		BS_PARAM_BLOCK_ENTRY_ARRAY(Vector2, gOffsets, 4)
 	BS_PARAM_BLOCK_END
@@ -184,7 +177,7 @@ namespace bs { namespace ct
 		CreateTonemapLUTMat();
 
 		/** Executes the post-process effect with the provided parameters. */
-		void execute(const SPtr<Texture>& output, const StandardPostProcessSettings& settings);
+		void execute(const SPtr<Texture>& output, const PostProcessSettings& settings);
 
 		/** Returns the texture descriptor that can be used for initializing the output render target. */
 		static POOLED_RENDER_TEXTURE_DESC getOutputDesc();
@@ -216,7 +209,7 @@ namespace bs { namespace ct
 
 		/** Executes the post-process effect with the provided parameters. */
 		void execute(const SPtr<Texture>& sceneColor, const SPtr<Texture>& eyeAdaptation, const SPtr<Texture>& colorLUT,
-			const SPtr<RenderTarget>& output, const StandardPostProcessSettings& settings);
+			const SPtr<RenderTarget>& output, const PostProcessSettings& settings);
 
 		/** Returns the material variation matching the provided parameters. */
 		static TonemappingMat* getVariation(bool gammaOnly, bool autoExposure, bool MSAA);

+ 2 - 5
Source/RenderBeast/Include/BsRenderBeast.h

@@ -69,9 +69,6 @@ namespace bs
 		/** @copydoc Renderer::destroy */
 		void destroy() override;
 
-		/** @copydoc Renderer::createPostProcessSettings */
-		SPtr<PostProcessSettings> createPostProcessSettings() const override;
-
 		/** 
 		 * Captures the scene at the specified location into a cubemap. 
 		 * 
@@ -166,14 +163,14 @@ namespace bs
 		 *			
 		 * @note	Core thread only.
 		 */
-		void renderView(const RendererViewGroup& viewGroup, RendererView* viewInfo, const FrameInfo& frameInfo);
+		void renderView(const RendererViewGroup& viewGroup, RendererView& view, const FrameInfo& frameInfo);
 
 		/**
 		 * Renders all overlay callbacks of the provided view.
 		 * 					
 		 * @note	Core thread only.
 		 */
-		void renderOverlay(RendererView* viewInfo);
+		void renderOverlay(RendererView& view);
 
 		/** 
 		 * Renders a single element of a renderable object. 

+ 16 - 16
Source/RenderBeast/Include/BsRenderCompositor.h

@@ -4,7 +4,11 @@
 
 #include "BsRenderBeastPrerequisites.h"
 
-namespace bs { namespace ct
+namespace bs 
+{ 
+	class RendererExtension;
+
+namespace ct
 {
 	struct SceneInfo;
 	class RendererViewGroup;
@@ -20,9 +24,8 @@ namespace bs { namespace ct
 	struct RenderCompositorNodeInputs
 	{
 		RenderCompositorNodeInputs(const RendererViewGroup& viewGroup, const RendererView& view, const SceneInfo& scene, 
-			const RenderBeastOptions& options, const FrameInfo& frameInfo, 
-			const SmallVector<RenderCompositorNode*, 4>& inputNodes)
-			: viewGroup(viewGroup), view(view), scene(scene), options(options), frameInfo(frameInfo), inputNodes(inputNodes)
+			const RenderBeastOptions& options, const FrameInfo& frameInfo)
+			: viewGroup(viewGroup), view(view), scene(scene), options(options), frameInfo(frameInfo)
 		{ }
 
 		const RendererViewGroup& viewGroup;
@@ -31,6 +34,12 @@ namespace bs { namespace ct
 		const RenderBeastOptions& options;
 		const FrameInfo& frameInfo;
 
+		// Callbacks to external systems can hook into the compositor
+		SmallVector<RendererExtension*, 4> extPreBasePass;
+		SmallVector<RendererExtension*, 4> extPostBasePass;
+		SmallVector<RendererExtension*, 4> extPostLighting;
+		SmallVector<RendererExtension*, 4> extOverlay;
+
 		SmallVector<RenderCompositorNode*, 4> inputNodes;
 	};
 
@@ -87,17 +96,8 @@ namespace bs { namespace ct
 		 */
 		void build(const RendererView& view, const StringID& finalNode);
 
-		/**
-		 * Performs rendering using the current render node hierarchy. This is expected to be called once per frame.
-		 * 
-		 * @param[in]	viewGroup		Information about the current view group.
-		 * @param[in]	view			Information about the view this compositor belongs to.
-		 * @param[in]	scene			Information about the entire scene.
-		 * @param[in]	frameInfo		Information about the current frame.
-		 * @param[in]	options			Global renderer options.
-		 */
-		void execute(const RendererViewGroup& viewGroup, const RendererView& view, const SceneInfo& scene, 
-			const FrameInfo& frameInfo, const RenderBeastOptions& options) const;
+		/** Performs rendering using the current render node hierarchy. This is expected to be called once per frame. */
+		void execute(RenderCompositorNodeInputs& inputs) const;
 
 	private:
 		/** Clears the render node hierarchy. */
@@ -123,7 +123,6 @@ namespace bs { namespace ct
 
 			StringID id;
 		};
-
 		
 		/** Templated implementation of NodeType. */
 		template<class T>
@@ -479,6 +478,7 @@ namespace bs { namespace ct
 		void clear() override;
 
 		SPtr<PooledRenderTexture> mTonemapLUT;
+		UINT64 mTonemapLastUpdateHash = -1;
 	};
 
 	/** Renders the depth of field effect using Gaussian blurring. */

+ 9 - 8
Source/RenderBeast/Include/BsRendererView.h

@@ -283,14 +283,14 @@ namespace bs { namespace ct
 		/** Returns the visibility mask calculated with the last call to determineVisible(). */
 		const VisibilityInfo& getVisibilityMasks() const { return mVisibility; }
 
-		/** 
-		 * Returns a structure containing information about post-processing effects. This structure will be modified and
-		 * maintained by the post-processing system.
-		 */
-		PostProcessInfo& getPPInfo() { return mPostProcessInfo; }
+		/** Returns per-view settings that control rendering. */
+		const PostProcessSettings& getRenderSettings() const { return *mRenderSettings; }
 
-		/** @copydoc getPPInfo() */
-		const PostProcessInfo& getPPInfo() const { return mPostProcessInfo; }
+		/**
+		 * Retrieves a hash value that is updated whenever render settings change. This can be used by external systems
+		 * to detect when they need to update.
+		 */
+		UINT64 getRenderSettingsHash() const { return mRenderSettingsHash; }
 
 		/** Updates the GPU buffer containing per-view information, with the latest internal data. */
 		void updatePerViewBuffer();
@@ -341,7 +341,8 @@ namespace bs { namespace ct
 		SPtr<RenderQueue> mTransparentQueue;
 
 		RenderCompositor mCompositor;
-		PostProcessInfo mPostProcessInfo;
+		SPtr<PostProcessSettings> mRenderSettings;
+		UINT32 mRenderSettingsHash;
 
 		SPtr<GpuParamBlockBuffer> mParamBuffer;
 		VisibilityInfo mVisibility;

+ 2 - 2
Source/RenderBeast/Source/BsPostProcessing.cpp

@@ -348,7 +348,7 @@ namespace bs { namespace ct
 		variations.add(variation);
 	}
 
-	void CreateTonemapLUTMat::execute(const SPtr<Texture>& output, const StandardPostProcessSettings& settings)
+	void CreateTonemapLUTMat::execute(const SPtr<Texture>& output, const PostProcessSettings& settings)
 	{
 		// Set parameters
 		gCreateTonemapLUTParamDef.gGammaAdjustment.set(mParamBuffer, 2.2f / settings.gamma);
@@ -480,7 +480,7 @@ namespace bs { namespace ct
 	}
 
 	void TonemappingMat::execute(const SPtr<Texture>& sceneColor, const SPtr<Texture>& eyeAdaptation, 
-		const SPtr<Texture>& colorLUT, const SPtr<RenderTarget>& output, const StandardPostProcessSettings& settings)
+		const SPtr<Texture>& colorLUT, const SPtr<RenderTarget>& output, const PostProcessSettings& settings)
 	{
 		const TextureProperties& texProps = sceneColor->getProperties();
 

+ 31 - 78
Source/RenderBeast/Source/BsRenderBeast.cpp

@@ -215,11 +215,6 @@ namespace bs { namespace ct
 		mScene->unregisterSkybox(skybox);
 	}
 
-	SPtr<PostProcessSettings> RenderBeast::createPostProcessSettings() const
-	{
-		return bs_shared_ptr_new<StandardPostProcessSettings>();
-	}
-
 	void RenderBeast::setOptions(const SPtr<RendererOptions>& options)
 	{
 		mOptions = std::static_pointer_cast<RenderBeastOptions>(options);
@@ -351,109 +346,67 @@ namespace bs { namespace ct
 			RendererView* view = viewGroup.getView(i);
 
 			if (view->getProperties().isOverlay)
-				renderOverlay(view);
+				renderOverlay(*view);
 			else
-				renderView(viewGroup, view, frameInfo);
+				renderView(viewGroup, *view, frameInfo);
 		}
 	}
 
-	void RenderBeast::renderView(const RendererViewGroup& viewGroup, RendererView* viewInfo, const FrameInfo& frameInfo)
+	void RenderBeast::renderView(const RendererViewGroup& viewGroup, RendererView& view, const FrameInfo& frameInfo)
 	{
 		gProfilerCPU().beginSample("Render");
 
 		const SceneInfo& sceneInfo = mScene->getSceneInfo();
-		auto& viewProps = viewInfo->getProperties();
-		const Camera* sceneCamera = viewInfo->getSceneCamera();
+		auto& viewProps = view.getProperties();
 
-		SPtr<GpuParamBlockBuffer> perCameraBuffer = viewInfo->getPerViewBuffer();
+		SPtr<GpuParamBlockBuffer> perCameraBuffer = view.getPerViewBuffer();
 		perCameraBuffer->flushToGPU();
 
-		viewInfo->beginFrame();
+		view.beginFrame();
 
-		// Trigger pre-base-pass callbacks
-		auto iterRenderCallback = mCallbacks.begin();
+		RenderCompositorNodeInputs inputs(viewGroup, view, sceneInfo, *mCoreOptions, frameInfo);
 
+		// Register callbacks
 		if (viewProps.triggerCallbacks)
 		{
-			while (iterRenderCallback != mCallbacks.end())
+			for(auto& extension : mCallbacks)
 			{
-				RendererExtension* extension = *iterRenderCallback;
-				if (extension->getLocation() != RenderLocation::PreBasePass)
+				RenderLocation location = extension->getLocation();
+				switch(location)
+				{
+				case RenderLocation::PreBasePass: 
+					inputs.extPreBasePass.push_back(extension);
 					break;
-
-				if (extension->check(*sceneCamera))
-					extension->render(*sceneCamera);
-
-				++iterRenderCallback;
-			}
-		}
-
-		// Trigger post-base-pass callbacks
-		if (viewProps.triggerCallbacks)
-		{
-			while (iterRenderCallback != mCallbacks.end())
-			{
-				RendererExtension* extension = *iterRenderCallback;
-				if (extension->getLocation() != RenderLocation::PostBasePass)
+				case RenderLocation::PostBasePass:
+					inputs.extPostBasePass.push_back(extension);
 					break;
-
-				if (extension->check(*sceneCamera))
-					extension->render(*sceneCamera);
-
-				++iterRenderCallback;
-			}
-		}
-
-		const RenderCompositor& compositor = viewInfo->getCompositor();
-		compositor.execute(viewGroup, *viewInfo, sceneInfo, frameInfo, *mCoreOptions);
-		viewInfo->getPPInfo().settingDirty = false;
-
-		// Trigger post-light-pass callbacks
-		if (viewProps.triggerCallbacks)
-		{
-			while (iterRenderCallback != mCallbacks.end())
-			{
-				RendererExtension* extension = *iterRenderCallback;
-				if (extension->getLocation() != RenderLocation::PostLightPass)
+				case RenderLocation::PostLightPass:
+					inputs.extPostLighting.push_back(extension);
 					break;
-
-				if (extension->check(*sceneCamera))
-					extension->render(*sceneCamera);
-
-				++iterRenderCallback;
-			}
-		}
-
-		// Trigger overlay callbacks
-		if (viewProps.triggerCallbacks)
-		{
-			while (iterRenderCallback != mCallbacks.end())
-			{
-				RendererExtension* extension = *iterRenderCallback;
-				if (extension->getLocation() != RenderLocation::Overlay)
+				case RenderLocation::Overlay:
+					inputs.extOverlay.push_back(extension);
 					break;
-
-				if (extension->check(*sceneCamera))
-					extension->render(*sceneCamera);
-
-				++iterRenderCallback;
+				}
 			}
 		}
 
-		viewInfo->endFrame();
+		const RenderCompositor& compositor = view.getCompositor();
+		compositor.execute(inputs);
+
+		view.endFrame();
 
 		gProfilerCPU().endSample("Render");
 	}
 
-	void RenderBeast::renderOverlay(RendererView* viewInfo)
+	void RenderBeast::renderOverlay(RendererView& view)
 	{
 		gProfilerCPU().beginSample("RenderOverlay");
 
-		viewInfo->getPerViewBuffer()->flushToGPU();
-		viewInfo->beginFrame();
+		view.getPerViewBuffer()->flushToGPU();
+		view.beginFrame();
 
-		auto& viewProps = viewInfo->getProperties();
-		const Camera* camera = viewInfo->getSceneCamera();
+		auto& viewProps = view.getProperties();
+		const Camera* camera = view.getSceneCamera();
 		SPtr<RenderTarget> target = viewProps.target;
 		SPtr<Viewport> viewport = camera->getViewport();
 
@@ -495,7 +448,7 @@ namespace bs { namespace ct
 			++iterRenderCallback;
 		}
 
-		viewInfo->endFrame();
+		view.endFrame();
 
 		gProfilerCPU().endSample("RenderOverlay");
 	}

+ 57 - 9
Source/RenderBeast/Source/BsRenderCompositor.cpp

@@ -16,6 +16,7 @@
 #include "BsRendererTextures.h"
 #include "BsObjectRendering.h"
 #include "BsGpuParamsSet.h"
+#include "BsRendererExtension.h"
 
 namespace bs { namespace ct
 {
@@ -126,8 +127,7 @@ namespace bs { namespace ct
 		bs_frame_clear();
 	}
 
-	void RenderCompositor::execute(const RendererViewGroup& viewGroup, const RendererView& view, const SceneInfo& scene, 
-		const FrameInfo& frameInfo, const RenderBeastOptions& options) const
+	void RenderCompositor::execute(RenderCompositorNodeInputs& inputs) const
 	{
 		if (!mIsValid)
 			return;
@@ -139,7 +139,7 @@ namespace bs { namespace ct
 			UINT32 idx = 0;
 			for (auto& entry : mNodeInfos)
 			{
-				RenderCompositorNodeInputs inputs(viewGroup, view, scene, options, frameInfo, entry.inputs);
+				inputs.inputNodes = entry.inputs;
 				entry.node->render(inputs);
 
 				activeNodes.push_back(&entry);
@@ -273,6 +273,18 @@ namespace bs { namespace ct
 			}
 		}
 
+		Camera* sceneCamera = inputs.view.getSceneCamera();
+
+		// Trigger pre-base-pass callbacks
+		if (sceneCamera != nullptr)
+		{
+			for(auto& extension : inputs.extPreBasePass)
+			{
+				if (extension->check(*sceneCamera))
+					extension->render(*sceneCamera);
+			}
+		}
+
 		// Render base pass
 		RenderAPI& rapi = RenderAPI::instance();
 		rapi.setRenderTarget(renderTarget);
@@ -310,6 +322,16 @@ namespace bs { namespace ct
 				gRendererUtility().drawMorph(renderElem->mesh, renderElem->subMesh, renderElem->morphShapeBuffer, 
 					renderElem->morphVertexDeclaration);
 		}
+
+		// Trigger post-base-pass callbacks
+		if (sceneCamera != nullptr)
+		{
+			for(auto& extension : inputs.extPostBasePass)
+			{
+				if (extension->check(*sceneCamera))
+					extension->render(*sceneCamera);
+			}
+		}
 	}
 
 	void RCNodeGBuffer::clear()
@@ -772,6 +794,17 @@ namespace bs { namespace ct
 				gRendererUtility().drawMorph(renderElem->mesh, renderElem->subMesh, renderElem->morphShapeBuffer, 
 					renderElem->morphVertexDeclaration);
 		}
+
+		// Trigger post-lighting callbacks
+		Camera* sceneCamera = inputs.view.getSceneCamera();
+		if (sceneCamera != nullptr)
+		{
+			for(auto& extension : inputs.extPostLighting)
+			{
+				if (extension->check(*sceneCamera))
+					extension->render(*sceneCamera);
+			}
+		}
 	}
 
 	void RCNodeClusteredForward::clear()
@@ -862,6 +895,17 @@ namespace bs { namespace ct
 		rapi.setViewport(viewProps.nrmViewRect);
 
 		gRendererUtility().blit(input, Rect2I::EMPTY, viewProps.flipView);
+
+		// Trigger overlay callbacks
+		Camera* sceneCamera = inputs.view.getSceneCamera();
+		if (sceneCamera != nullptr)
+		{
+			for(auto& extension : inputs.extOverlay)
+			{
+				if (extension->check(*sceneCamera))
+					extension->render(*sceneCamera);
+			}
+		}
 	}
 
 	void RCNodeFinalResolve::clear()
@@ -966,8 +1010,7 @@ namespace bs { namespace ct
 		GpuResourcePool& resPool = GpuResourcePool::instance();
 
 		const RendererViewProperties& viewProps = inputs.view.getProperties();
-		const PostProcessInfo& ppInfo = inputs.view.getPPInfo();
-		const StandardPostProcessSettings& settings = *inputs.view.getPPInfo().settings;
+		const PostProcessSettings& settings = inputs.view.getRenderSettings();
 
 		RCNodeSceneColor* sceneColorNode = static_cast<RCNodeSceneColor*>(inputs.inputNodes[0]);
 		RCNodePostProcess* postProcessNode = static_cast<RCNodePostProcess*>(inputs.inputNodes[2]);
@@ -1031,13 +1074,18 @@ namespace bs { namespace ct
 		{
 			if (settings.enableTonemapping)
 			{
-				if (ppInfo.settingDirty) // Rebuild LUT if PP settings changed
+				UINT64 latestHash = inputs.view.getRenderSettingsHash();
+				bool tonemapLUTDirty = mTonemapLastUpdateHash != latestHash;
+
+				if (tonemapLUTDirty) // Rebuild LUT if PP settings changed
 				{
 					if(mTonemapLUT == nullptr)
 						mTonemapLUT = resPool.get(CreateTonemapLUTMat::getOutputDesc());
 
 					CreateTonemapLUTMat* createLUT = CreateTonemapLUTMat::get();
 					createLUT->execute(mTonemapLUT->texture, settings);
+
+					mTonemapLastUpdateHash = latestHash;
 				}
 
 				gammaOnly = false;
@@ -1100,7 +1148,7 @@ namespace bs { namespace ct
 		RCNodeSceneDepth* sceneDepthNode = static_cast<RCNodeSceneDepth*>(inputs.inputNodes[1]);
 		RCNodePostProcess* postProcessNode = static_cast<RCNodePostProcess*>(inputs.inputNodes[2]);
 
-		DepthOfFieldSettings& settings = inputs.view.getPPInfo().settings->depthOfField;
+		const DepthOfFieldSettings& settings = inputs.view.getRenderSettings().depthOfField;
 		bool near = settings.nearBlurAmount > 0.0f;
 		bool far = settings.farBlurAmount > 0.0f;
 
@@ -1181,7 +1229,7 @@ namespace bs { namespace ct
 
 	void RCNodeFXAA::render(const RenderCompositorNodeInputs& inputs)
 	{
-		const StandardPostProcessSettings& settings = *inputs.view.getPPInfo().settings;
+		const PostProcessSettings& settings = inputs.view.getRenderSettings();
 		if (!settings.enableFXAA)
 			return;
 
@@ -1348,7 +1396,7 @@ namespace bs { namespace ct
 
 		GpuResourcePool& resPool = GpuResourcePool::instance();
 		const RendererViewProperties& viewProps = inputs.view.getProperties();
-		const AmbientOcclusionSettings& settings = inputs.view.getPPInfo().settings->ambientOcclusion;
+		const AmbientOcclusionSettings& settings = inputs.view.getRenderSettings().ambientOcclusion;
 
 		RCNodeResolvedSceneDepth* resolvedDepthNode = static_cast<RCNodeResolvedSceneDepth*>(inputs.inputNodes[0]);
 		RCNodeGBuffer* gbufferNode = static_cast<RCNodeGBuffer*>(inputs.inputNodes[1]);

+ 7 - 9
Source/RenderBeast/Source/BsRendererView.cpp

@@ -84,12 +84,13 @@ namespace bs { namespace ct
 	}
 
 	RendererView::RendererView()
+		:mRenderSettingsHash(0)
 	{
 		mParamBuffer = gPerCameraParamDef.createBuffer();
 	}
 
 	RendererView::RendererView(const RENDERER_VIEW_DESC& desc)
-		: mProperties(desc), mTargetDesc(desc.target), mCamera(desc.sceneCamera)
+		: mProperties(desc), mTargetDesc(desc.target), mCamera(desc.sceneCamera), mRenderSettingsHash(0)
 	{
 		mParamBuffer = gPerCameraParamDef.createBuffer();
 		mProperties.prevViewProjTransform = mProperties.viewProjTransform;
@@ -110,16 +111,13 @@ namespace bs { namespace ct
 
 	void RendererView::setPostProcessSettings(const SPtr<PostProcessSettings>& ppSettings)
 	{
-		if (mPostProcessInfo.settings == nullptr)
-			mPostProcessInfo.settings = bs_shared_ptr_new<StandardPostProcessSettings>();
+		if (mRenderSettings == nullptr)
+			mRenderSettings = bs_shared_ptr_new<PostProcessSettings>();
 
-		SPtr<StandardPostProcessSettings> stdPPSettings = std::static_pointer_cast<StandardPostProcessSettings>(ppSettings);
-		if (stdPPSettings != nullptr)
-			*mPostProcessInfo.settings = *stdPPSettings;
-		else
-			*mPostProcessInfo.settings = StandardPostProcessSettings();
+		if (ppSettings != nullptr)
+			*mRenderSettings = *ppSettings;
 
-		mPostProcessInfo.settingDirty = true;
+		mRenderSettingsHash++;
 
 		// Update compositor hierarchy
 		mCompositor.build(*this, RCNodeFinalResolve::getNodeId());

+ 3 - 3
Source/SBansheeEngine/Include/BsScriptPostProcessSettings.h

@@ -7,7 +7,7 @@
 
 namespace bs
 {
-	struct StandardPostProcessSettings;
+	struct PostProcessSettings;
 	struct AutoExposureSettings;
 	struct TonemappingSettings;
 	struct WhiteBalanceSettings;
@@ -125,10 +125,10 @@ namespace bs
 		SCRIPT_OBJ(ENGINE_ASSEMBLY, "BansheeEngine", "PostProcessSettings")
 
 		/** Converts managed object its native counterpart. */
-		static SPtr<StandardPostProcessSettings> toNative(MonoObject* object);
+		static SPtr<PostProcessSettings> toNative(MonoObject* object);
 
 		/** Converts native object to its managed counterpart. */
-		static MonoObject* toManaged(const SPtr<StandardPostProcessSettings>& value);
+		static MonoObject* toManaged(const SPtr<PostProcessSettings>& value);
 
 	private:
 		ScriptPostProcessSettings(MonoObject* instance);

+ 4 - 15
Source/SBansheeEngine/Source/BsScriptCamera.cpp

@@ -15,7 +15,7 @@
 #include "BsRenderWindow.h"
 #include "BsRenderTexture.h"
 #include "BsGUIManager.h"
-#include "BsStandardPostProcessSettings.h"
+#include "BsPostProcessSettings.h"
 #include "BsScriptPostProcessSettings.h"
 
 namespace bs
@@ -317,21 +317,10 @@ namespace bs
 	MonoObject* ScriptCamera::internal_GetPostProcessSettings(ScriptCamera* instance)
 	{
 		SPtr<PostProcessSettings> ppSettings = instance->mCamera->getPostProcessSettings();
-		SPtr<StandardPostProcessSettings> standardPPSettings;
-		if(ppSettings != nullptr)
-		{
-			if (!rtti_is_of_type<StandardPostProcessSettings>(ppSettings))
-			{
-				assert(false && "Invalid post process settings type.");
-			}
-			else
-				standardPPSettings = std::static_pointer_cast<StandardPostProcessSettings>(ppSettings);
-		}
-
-		if (standardPPSettings == nullptr)
-			standardPPSettings = bs_shared_ptr_new<StandardPostProcessSettings>();
+		if (ppSettings == nullptr)
+			ppSettings = bs_shared_ptr_new<PostProcessSettings>();
 
-		return ScriptPostProcessSettings::toManaged(standardPPSettings);
+		return ScriptPostProcessSettings::toManaged(ppSettings);
 	}
 
 	void ScriptCamera::internal_SetPostProcessSettings(ScriptCamera* instance, MonoObject* value)

+ 5 - 5
Source/SBansheeEngine/Source/BsScriptPostProcessSettings.cpp

@@ -6,7 +6,7 @@
 #include "BsMonoClass.h"
 #include "BsMonoUtil.h"
 #include "BsCoreThread.h"
-#include "BsStandardPostProcessSettings.h"
+#include "BsPostProcessSettings.h"
 
 namespace bs
 {
@@ -221,9 +221,9 @@ namespace bs
 		sGamma = metaData.scriptClass->getField("Gamma");
 	}
 
-	SPtr<StandardPostProcessSettings> ScriptPostProcessSettings::toNative(MonoObject* object)
+	SPtr<PostProcessSettings> ScriptPostProcessSettings::toNative(MonoObject* object)
 	{
-		SPtr<StandardPostProcessSettings> output = bs_shared_ptr_new<StandardPostProcessSettings>();
+		SPtr<PostProcessSettings> output = bs_shared_ptr_new<PostProcessSettings>();
 
 		sEnableAutoExposure->get(object, &output->enableAutoExposure);
 		sEnableTonemapping->get(object, &output->enableTonemapping);
@@ -249,7 +249,7 @@ namespace bs
 		return output;
 	}
 
-	MonoObject* ScriptPostProcessSettings::toManaged(const SPtr<StandardPostProcessSettings>& value)
+	MonoObject* ScriptPostProcessSettings::toManaged(const SPtr<PostProcessSettings>& value)
 	{
 		MonoObject* object = metaData.scriptClass->createInstance();
 
@@ -275,6 +275,6 @@ namespace bs
 
 	MonoObject* ScriptPostProcessSettings::internal_CreateDefault()
 	{
-		return toManaged(bs_shared_ptr_new<StandardPostProcessSettings>());
+		return toManaged(bs_shared_ptr_new<PostProcessSettings>());
 	}
 }