HdrFilter Class |
Namespace: DigitalRune.Graphics.PostProcessing
The HdrFilter type exposes the following members.
Name | Description | |
---|---|---|
Dispose |
Releases all resources used by an instance of the PostProcessor class.
(Inherited from PostProcessor.) | |
Dispose(Boolean) |
Releases the unmanaged resources used by an instance of the PostProcessor class
and optionally releases the managed resources.
(Inherited from PostProcessor.) | |
Equals | (Inherited from Object.) | |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | |
GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
OnDisable |
Called when this post-processor is disabled.
(Inherited from PostProcessor.) | |
OnEnable |
Called when this post-processor is enabled.
(Inherited from PostProcessor.) | |
OnProcess |
Called when the post-processor should perform the post-processing.
(Overrides PostProcessorOnProcess(RenderContext).) | |
Process |
Performs the post-processing using the SourceTexture
and the RenderTarget specified in the render context.
(Inherited from PostProcessor.) | |
Reset | Obsolete.
Resets the dynamic internal states, especially dynamic luminance adaption.
| |
ToString | Returns a string that represents the current object. (Inherited from Object.) |
Name | Description | |
---|---|---|
AdaptionSpeed |
Gets or sets the adaption speed of the eye.
| |
BloomIntensity |
Gets or sets the bloom intensity factor.
| |
BloomThreshold |
Gets or sets the brightness threshold.
| |
BlueShiftCenter |
Gets or sets scene luminance where 50% blue shift is applied
| |
BlueShiftColor |
Gets or sets the color of the blue shift.
| |
BlueShiftRange |
Gets or sets the range of the blue shift.
| |
DefaultTargetFormat |
Gets or sets the default target format.
(This property is used by the PostProcessorChain).
(Inherited from PostProcessor.) | |
DownsampleFactor |
Gets or sets the downsample factor.
| |
EnableBlueShift |
Gets or sets a value indicating whether a blue shift is applied to scenes with low average
luminance.
| |
Enabled |
Gets or sets a value indicating whether this post-processor is enabled.
(Inherited from PostProcessor.) | |
GraphicsService |
Gets the graphics service.
(Inherited from PostProcessor.) | |
IsDisposed |
Gets a value indicating whether this post-processor has been disposed of.
(Inherited from PostProcessor.) | |
MaxExposure |
Gets or sets the max exposure factor.
| |
MiddleGray |
Gets or sets the average gray level.
| |
MinExposure |
Gets or sets the min exposure factor.
| |
Name |
Gets or sets the name of the post-processor.
(Inherited from PostProcessor.) | |
UseAdaption |
Gets or sets a value indicating whether dynamic eye adaption should be used.
| |
UseGeometricMean |
Gets or sets a value indicating whether the average luminance is computed using the
geometric mean.
|
This post-processor is also responsible for converting the input texture from an HDR format (usually HdrBlendable) to an LDR format. Therefore, the surface format in DefaultTargetFormat is set to Color.
This post-processor stores luminance information of a frame for use in the next frame. The information is stored with the currently active camera node. When there is a cut in the scene (i.e. a new level is loaded or the view changes significantly), the method InvalidateViewDependentData of the camera node needs to be called to reset the luminance information. Further, this post-processor expects that it is called once per frame for a certain camera node. It might not work as expected if it is called several times per frame (e.g. to process different views using the same camera).
Exposure and Middle Gray
The HdrFilter computes the average brightness of the scene and applies a
brightness scale factor ("exposure") so that the average brightness of the final image is
equal to MiddleGray. That means, if you are in a dark cave, the filter will
make the image a lot brighter. If you are in a white dessert, it will make the image darker.
Both images will have the same average brightness defined by MiddleGray.
The brightness scale factor is limited by MinExposure and
MaxExposure. That means, if you set MinExposure =
MaxExposure = 1, then there will be no brightness change.
If your scene is very bright or very dark, then you have to adjust MiddleGray.
Use MinExposure and MaxExposure to limit the allowed brightness
changes.
Night Tone mapping with Blue Shift (Scotopic Vision):
The human visual system perceives low luminance scenes (e.g. night scenes) different than
well-lit scenes. Under daylight the cones in the human eye dominate and create the normal
color image (photopic vision). The cones start to lose sensitivity at about 3.4 cd/m², and
the rods start to get more dominant. A dark scene perceived by the rods (scotopic vision) is
monochrome with a blue shift. This HdrFilter supports physically-based night
tone mapping. Per default it is disabled. The blue shift is controlled using the properties
EnableBlueShift, BlueShiftColor, BlueShiftCenter and
BlueShiftRange. Depending on the lighting in the scene,
BlueShiftColor might need to be scaled. It is also possible to use a different
color for a more dramatic effect. BlueShiftCenter and
BlueShiftRange might also need to be changed if the scene is not lit using
physically-based light intensities and lighting models.