Index: GTP/trunk/App/Demos/Illum/DepthOfField/shaders/illum.hlsl
===================================================================
--- GTP/trunk/App/Demos/Illum/DepthOfField/shaders/illum.hlsl	(revision 765)
+++ GTP/trunk/App/Demos/Illum/DepthOfField/shaders/illum.hlsl	(revision 765)
@@ -0,0 +1,32 @@
+// material constants
+const float3 ambientMaterial= float3(0.5, 0.5, 0.5);
+const float3 diffuseMaterial = float3(1.0, 1.0, 1.0);	
+const float3 specularMaterial = float3(0.3, 0.3, 0.3);
+
+//------------------------------------------
+// a fényerõt számító fv.
+// l = light vector, r = reciprok négyzet radius: 1.0/(r*r)
+//------------------------------------------
+float SQR(float x) { return x*x; }
+float Attenuation(float3 Light)
+{
+	return 10.0 / dot(Light, Light);
+}
+
+//-----------------------------------------------------------------------------
+// Illumination function used in shading: all input vectors are normalized
+//-----------------------------------------------------------------------------
+float4 Illumination(float3 Light, float3 Normal, float3 View, float2 TexCoord, float Attenuation)
+{
+	// Blinn lighting
+	float3 Half = normalize(Light + View);
+	float Diffuse = dot(Normal, Light);
+	float Specular = dot(Normal, Half);
+	float4 Lighting = lit(Diffuse, Specular, 16);
+	float4 Color= tex2D(ColorMapSampler, TexCoord);
+
+	return float4(
+		Lighting.x * ambientMaterial * Color +
+		(Lighting.y * diffuseMaterial * Color +
+		Lighting.z * specularMaterial) * Attenuation, 1);
+}
Index: GTP/trunk/App/Demos/Illum/DepthOfField/shaders/CameraEffects.fx
===================================================================
--- GTP/trunk/App/Demos/Illum/DepthOfField/shaders/CameraEffects.fx	(revision 765)
+++ GTP/trunk/App/Demos/Illum/DepthOfField/shaders/CameraEffects.fx	(revision 765)
@@ -0,0 +1,91 @@
+// Number of outer filter taps
+#define NUM_DOF_TAPS 12
+float2 filterTaps[NUM_DOF_TAPS];
+
+
+#define SAMPLER_LINEAR(g_samplerMap, g_txMap);	\
+	sampler2D g_samplerMap = sampler_state {	\
+    Texture = <g_txMap>;						\
+    MinFilter = Linear;							\
+    MagFilter = Linear;							\
+    MipFilter = Linear;							\
+    AddressU  = WRAP;							\
+    AddressV  = WRAP;							\
+};
+
+texture ColorMap;
+SAMPLER_LINEAR(ColorMapSampler,	ColorMap);
+texture DepthMap;
+SAMPLER_LINEAR(DepthMapSampler, DepthMap);
+
+struct VS_INPUT {
+		float3 Position : POSITION;
+};
+
+struct VS_OUTPUT {
+        float4 hPosition : POSITION;     // point in normalized device space before homogeneous division
+        float2 TexCoord  : TEXCOORD0;
+};
+
+VS_OUTPUT DepthVS(VS_INPUT IN)
+{
+	VS_OUTPUT output;
+    
+    output.hPosition = half4(IN.Position, 1);
+    
+    output.TexCoord = IN.Position.xy * 0.5f + 0.5f; 
+    output.TexCoord.y *= -1;
+
+    return output;
+}
+//------------------------------------------------------------------------------------
+//
+// 
+//
+//------------------------------------------------------------------------------------
+const float maxCoC = 5;
+float4 DepthPS(VS_OUTPUT IN) : COLOR
+{
+	// Get center sample
+	float4 colorSum = tex2D(ColorMapSampler, IN.TexCoord);
+	float2 centerDepthBlur = tex2D(DepthMapSampler, IN.TexCoord);
+
+	// Compute CoC size based on blurriness
+	float sizeCoC = centerDepthBlur.y * maxCoC;
+
+	float totalContribution = 1.0f;
+
+	// Run through all taps
+	for (int i = 0; i < NUM_DOF_TAPS; i++)
+	{
+		// Compute tap coordinates
+		float2 tapCoord = IN.TexCoord + filterTaps[i] * sizeCoC;
+
+		// Fetch tap sample
+		float4 tapColor = tex2D(ColorMapSampler, tapCoord);
+		float2 tapDepthBlur = tex2D(DepthMapSampler, tapCoord);
+
+		// Compute tap contribution
+		float tapContribution = (tapDepthBlur.x > centerDepthBlur.x) ? 1.0f : tapDepthBlur.y;
+
+		// Accumulate color and contribution
+		colorSum += tapColor * tapContribution;
+		totalContribution += tapContribution;
+	}
+
+	// Normalize to get proper luminance
+	float4 finalColor = colorSum / totalContribution;
+
+	return finalColor;
+}
+//------------------------------------------------------------------------------------
+// Technique definitions
+//------------------------------------------------------------------------------------
+technique DepthOfField
+{													
+    pass p0											
+    {												
+	    VertexShader = compile vs_3_0 DepthVS();	
+	    PixelShader  = compile ps_3_0 DepthPS();	
+	}												
+}
Index: GTP/trunk/App/Demos/Illum/DepthOfField/shaders/BumpMapping.fx
===================================================================
--- GTP/trunk/App/Demos/Illum/DepthOfField/shaders/BumpMapping.fx	(revision 765)
+++ GTP/trunk/App/Demos/Illum/DepthOfField/shaders/BumpMapping.fx	(revision 765)
@@ -0,0 +1,112 @@
+float4x4 WorldViewProj;
+float4x4 WorldView;
+float4x4 WorldViewIT;
+float3 mCameraPos;		// model-space Camera position
+float3 mLightPos;		// model-space Light position
+float  focalDist;
+float  focalRange;
+//------------------------------------------------------------------------------------
+// macro definition for filtered samplers
+//------------------------------------------------------------------------------------
+#define SAMPLER_LINEAR(g_samplerMap, g_txMap);	\
+	sampler2D g_samplerMap = sampler_state {	\
+    Texture = <g_txMap>;						\
+    MinFilter = Linear;							\
+    MagFilter = Linear;							\
+    MipFilter = Linear;							\
+    AddressU  = WRAP;							\
+    AddressV  = WRAP;							\
+};
+
+texture ColorMap;
+SAMPLER_LINEAR(ColorMapSampler,	ColorMap);
+texture BumpMap;
+SAMPLER_LINEAR(BumpMapSampler,BumpMap);
+
+// Illumination functions
+#include "illum.hlsl"
+
+struct VS_INPUT {
+		float4 Position  : POSITION;
+		float3 Normal	 : NORMAL;					
+		float3 Binormal	 : BINORMAL;
+		float3 Tangent	 : TANGENT;
+		float4 TexCoord0 : TEXCOORD0;
+};
+
+struct VS_OUTPUT {
+        float4 hPosition : POSITION;     // point in normalized device space before homogeneous division
+        float2 TexCoord  : TEXCOORD0;    // texture coordinates
+        float3 tView     : TEXCOORD1;    // tangent space view vector
+        float3 tLight    : TEXCOORD2;    // tangent space light vector
+		float  Depth    : TEXCOORD3;
+};
+
+struct PS_OUTPUT {
+		float4 Color : COLOR0;
+		float4 Depth : COLOR1;
+};
+
+//------------------------------------------------------------------------------------
+//
+// Base vertex shader: vertex shader for all methods: calculates tangent-space
+//		tLight, tView, hPosition vectors
+//
+//------------------------------------------------------------------------------------
+VS_OUTPUT BumpVS(VS_INPUT IN)
+{
+        VS_OUTPUT output;
+   
+        // object-space tangent matrix
+		float3x3 Tan = float3x3(normalize(IN.Tangent), normalize(IN.Binormal), IN.Normal);
+        // position in view-space
+        float3 P = mul(IN.Position, WorldView);
+		// model-space view vector        
+		float3 mView = mCameraPos - IN.Position;
+		// model-space light vector
+		float3 mLight = mLightPos - IN.Position;
+		// tangent-space view vector
+		output.tView = mul(Tan, mView);
+		// tangent-space light vector
+		output.tLight =  mul(Tan, mLight);
+        // vertex position before homogenious division
+        output.hPosition = mul(IN.Position, WorldViewProj);
+		// tex coordinates passed to pixel shader
+        output.TexCoord = IN.TexCoord0;
+		output.Depth = output.hPosition.z;
+
+        return output;
+}
+//------------------------------------------------------------------------------------
+//
+// BumpPS: Bump Mapping pixel shader
+//
+//------------------------------------------------------------------------------------
+PS_OUTPUT BumpPS(VS_OUTPUT IN)
+{
+	PS_OUTPUT output;
+    // needs normalization because of linear interpolation
+    float3 View = normalize( IN.tView );
+    // needs normalization because of linear interpolation    
+    float3 Light = normalize( IN.tLight );
+    // get tangent-space normal from normal map
+    float3 Normal = tex2D(BumpMapSampler, IN.TexCoord).rgb;
+    // illumination calculation
+    output.Color = Illumination(Light, Normal, View, IN.TexCoord, Attenuation(IN.tLight));
+    
+    float blur = saturate(abs(IN.Depth - focalDist) * focalRange);
+    output.Depth = float4(IN.Depth, blur, 0, 0);
+
+    return output;
+}
+//------------------------------------------------------------------------------------
+// Technique definitions
+//------------------------------------------------------------------------------------
+technique BumpMapping
+{													
+    pass p0											
+    {												
+	    VertexShader = compile vs_3_0 BumpVS();	
+	    PixelShader  = compile ps_3_0 BumpPS();	
+	}												
+}
