<commit_before>package aerys.minko.render.material.phong
{
	import aerys.minko.ns.minko_lighting;
	import aerys.minko.render.Effect;
	import aerys.minko.render.RenderTarget;
	import aerys.minko.render.Viewport;
	import aerys.minko.render.resource.texture.CubeTextureResource;
	import aerys.minko.render.resource.texture.TextureResource;
	import aerys.minko.render.shader.Shader;
	import aerys.minko.scene.data.LightDataProvider;
	import aerys.minko.scene.node.Scene;
	import aerys.minko.type.binding.DataBindings;
	
	import flash.display.BitmapData;
	
	public class AbstractShadowMappingEffect extends Effect
	{
		use namespace minko_lighting;
		
		private const SHADOW_FACTORIES : Vector.<Function> = new <Function>[
			manageNoShadowing,				// 0: ShadowMappingType.NONE
			manageMatrixShadowing,			// 1: ShadowMappingType.MATRIX
			manageDualParaboloidShadowing,	// 2: ShadowMappingType.DUAL_PARABOLOID
			manageCubicShadowing			// 3: ShadowMappingType.CUBIC
		];
		
		private var _scene				: Scene;
		private var _renderingPass		: Shader;
		private var _watchedProperties	: Vector.<String>;
		
		private var _updatePasses		: Boolean;
		
		public function get scene() : Scene
		{
			return _scene;
		}
		
		public function AbstractShadowMappingEffect(scene 			: Scene, 
													renderingShader : Shader)
		{
			_renderingPass		= renderingShader;
			_watchedProperties	= new Vector.<String>();
			_scene				= scene;
			_updatePasses		= true;
			
			scene.enterFrame.add(onSceneEnterFrame);
		}
		
		private function onSceneEnterFrame(scene		: Scene,
										   viewport		: Viewport,
										   destination	: BitmapData, 
										   timer		: uint) : void
		{
			if (_updatePasses)
			{
				updatePasses();
				_updatePasses = false;
			}
		}
		
		private function propertyChangedHandler(sceneBindings	: DataBindings, 
												propertyName	: String,
												oldValue		: Object,
												newValue		: Object) : void
		{
			_updatePasses = true;
		}
		
		private function updatePasses() : void
		{
			var passes			: Vector.<Shader>	= new <Shader>[];
			var sceneBindings	: DataBindings		= _scene.bindings;
			var shader			: Shader			= null;
			var renderTarget	: RenderTarget		= null;
			<commit_msg>remove trace() in AbstractShadowMappingEffect<commit_after>package aerys.minko.render.material.phong
{
	import aerys.minko.ns.minko_lighting;
	import aerys.minko.render.Effect;
	import aerys.minko.render.RenderTarget;
	import aerys.minko.render.Viewport;
	import aerys.minko.render.resource.texture.CubeTextureResource;
	import aerys.minko.render.resource.texture.TextureResource;
	import aerys.minko.render.shader.Shader;
	import aerys.minko.scene.data.LightDataProvider;
	import aerys.minko.scene.node.Scene;
	import aerys.minko.type.binding.DataBindings;
	
	import flash.display.BitmapData;
	
	public class AbstractShadowMappingEffect extends Effect
	{
		use namespace minko_lighting;
		
		private const SHADOW_FACTORIES : Vector.<Function> = new <Function>[
			manageNoShadowing,				// 0: ShadowMappingType.NONE
			manageMatrixShadowing,			// 1: ShadowMappingType.MATRIX
			manageDualParaboloidShadowing,	// 2: ShadowMappingType.DUAL_PARABOLOID
			manageCubicShadowing			// 3: ShadowMappingType.CUBIC
		];
		
		private var _scene				: Scene;
		private var _renderingPass		: Shader;
		private var _watchedProperties	: Vector.<String>;
		
		public function get scene() : Scene
		{
			return _scene;
		}
		
		public function AbstractShadowMappingEffect(scene 			: Scene, 
													renderingShader : Shader)
		{
			_renderingPass		= renderingShader;
			_watchedProperties	= new Vector.<String>();
			_scene				= scene;
			
            scene.enterFrame.add(sceneEnterFrameHandler);
		}
		
		private function sceneEnterFrameHandler(scene		: Scene,
                                                viewport	: Viewport,
                                                destination	: BitmapData, 
                                                timer		: uint) : void
		{
            scene.enterFrame.remove(sceneEnterFrameHandler);
            
			updatePasses();
		}
		
		private function propertyChangedHandler(sceneBindings	: DataBindings, 
												propertyName	: String,
												oldValue		: Object,
												newValue		: Object) : void
		{
            scene.enterFrame.add(sceneEnterFrameHandler);
		}
		
		private function updatePasses() : void
		{
			var passes			: Vector.<Shader>	= new <Shader>[];
			var sceneBindings	: DataBindings		= _scene.bindings;
			var shader			: Shader			= null;
			var renderTarget	: RenderTarget		= null;
			
{'fraction_non_alphanumeric': 0.08360691617421755, 'fraction_numerical': 0.0017509301816590063, 'mean_word_length': 2.8893617021276596, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3436940', 'n_tokens_mistral': 1770, 'n_tokens_neox': 1432, 'n_words': 271}