 		
 		override protected function getOutputPosition() : SValue
 		{
-			var lightDir	: SValue	= subtract(vertexPosition, cameraLocalPosition);
+			// compute vertex color to be interpolated by the fragment shader
+			var lightDir	: SValue	= subtract(cameraLocalPosition, vertexPosition);
 			
 			lightDir.normalize();
 			
 			_vertexColor = vertexNormal.dotProduct3(lightDir);
 			_vertexColor = float4(multiply(_vertexColor, COLOR.rgb), COLOR.a);
+			
+			// perform skinning
+			var skinningMethod	: uint	= getStyleConstant(SkinningStyle.METHOD, SkinningMethod.DISABLED)
+									      as uint;
+			
+			// handle skinning
+			if (skinningMethod != SkinningMethod.DISABLED)
+			{
+				var maxInfluences	: uint		= getStyleConstant(SkinningStyle.MAX_INFLUENCES, 0) as uint;
+				var numBones		: uint		= getStyleConstant(SkinningStyle.NUM_BONES, 0) as uint;
+				var skinnedPosition	: SValue	= getVertexSkinnedPosition(skinningMethod, maxInfluences, numBones);
+				
+				return multiply4x4(skinnedPosition, localToScreenMatrix);
+			}
 			
 			return vertexClipspacePosition;
 		}

			return interpolate(_vertexColor);
		}
		
	}
}
package aerys.minko.render.effect.debug
{
	import aerys.minko.render.effect.SinglePassEffect;
	import aerys.minko.render.effect.skinning.SkinningStyle;
	import aerys.minko.render.shader.SValue;
	import aerys.minko.scene.data.LocalData;
	import aerys.minko.scene.data.StyleStack;
	import aerys.minko.type.math.Vector4;
	import aerys.minko.type.skinning.SkinningMethod;
	
	import flash.utils.Dictionary;

	public class DebugEffect extends SinglePassEffect
	{
