function AdaptiveToneMappingPass(adaptive, resolution)
{
	Pass.call(this);
	var self = this;
	
	this.type = "AdaptiveToneMapping";
	this.needsInit = true;

	this.resolution = resolution !== undefined ? resolution : 256;
	this._adaptive = adaptive !== undefined ? adaptive : true;

	this.luminanceRT = null;
	this.previousLuminanceRT = null;
	this.currentLuminanceRT = null;

	this.copyUniforms = UniformsUtils.clone(CopyShader.uniforms);
	this.materialCopy = new ShaderMaterial(
		{
			uniforms: this.copyUniforms,
			vertexShader: CopyShader.vertexShader,
			fragmentShader: CopyShader.fragmentShader,
			blending: NoBlending,
			depthTest: false
		});

	this.materialLuminance = new ShaderMaterial(
		{
			uniforms: UniformsUtils.clone(LuminosityShader.uniforms),
			vertexShader: LuminosityShader.vertexShader,
			fragmentShader: LuminosityShader.fragmentShader,
			blending: NoBlending
		});

	this.createShader();

	if (ToneMapShader === undefined)
	{
		console.error("nunuStudio: AdaptiveToneMappingPass relies on ToneMapShader");
	}

	this.materialToneMap = new ShaderMaterial(
		{
			uniforms: UniformsUtils.clone(ToneMapShader.uniforms),
			vertexShader: ToneMapShader.vertexShader,
			fragmentShader: ToneMapShader.fragmentShader,
			blending: NoBlending
		});

	this.createQuadScene();

	Object.defineProperties(this,
		{
		/**
		 * Minimum luminance.
		 *
		 * @property minLuminance
		 * @type {number}
		 */
			minLuminance:
		{
			get: function() {return self.adaptLuminanceShader.uniforms["minLuminance"].value;},
			set: function(value) {self.adaptLuminanceShader.uniforms["minLuminance"].value = value;}
		},

			/**
			 * Rate of luminance variation (adaptation rate).
			 *
			 * @property tau
			 * @type {number}
			 */
			tau:
		{
			get: function() {return self.adaptLuminanceShader.uniforms["tau"].value;},
			set: function(value) {self.adaptLuminanceShader.uniforms["tau"].value = value;}
		},

			/**
			 * Rate of luminance variation (adaptation rate).
			 *
			 * @property tau
			 * @type {number}
			 */
			adaptive:
		{
			get: function() {return self._adaptive;},
			set: function(adaptive)
			{
				if (adaptive)
				{
					this._adaptive = true;
					this.materialToneMap.defines["ADAPTED_LUMINANCE"] = "";
					this.materialToneMap.uniforms.luminanceMap.value = this.luminanceRT.texture;
				}
				else
				{
					this._adaptive = false;
					delete this.materialToneMap.defines["ADAPTED_LUMINANCE"];
					this.materialToneMap.uniforms.luminanceMap.value = null;
				}

				this.materialToneMap.needsUpdate = true;
			}
		}
		});
}
Generate a texture that represents the luminosity of the current scene, adapted over time to simulate the optic nerve responding to the amount of light it is receiving.

Based on a GDC2007 presentation by Wolfgang Engel titled "Post-Processing Pipeline"

Full-screen tone-mapping shader based on http:// www.graphics.cornell.edu/~jaf/publications/sig02_paper.pdf

class AdaptiveToneMappingPass

@module Postprocessing
@author miibond