/**
 * @author nitelite - Changes the visiblity of items in the effect composer chain
 */

THREE.ChangeVisPass = function ( objects, state ) {

	this.objects = ( objects !== undefined ) ? objects : [];
	this.state = ( state !== undefined ) ? state : true;

	// render targets
	this.enabled = true;
	this.needsSwap = false;
	this.clear = false;
};

THREE.ChangeVisPass.prototype = {

	render: function ( renderer, writeBuffer, readBuffer, delta, maskActive ) {
		for(var i = 0; i < this.objects.length; i++) {
			this.objects[i].visible = this.state;
		}
	}
};