Index: GTP/trunk/App/Demos/Illum/Ogre/Media/materials/scripts/Diffuse.material
===================================================================
--- GTP/trunk/App/Demos/Illum/Ogre/Media/materials/scripts/Diffuse.material	(revision 1094)
+++ GTP/trunk/App/Demos/Illum/Ogre/Media/materials/scripts/Diffuse.material	(revision 1094)
@@ -0,0 +1,89 @@
+material GameTools/CubeMap/Reduce
+{ 
+
+   technique 
+   { 
+       pass 
+       { 
+       //depth_check off
+	   lighting off
+	
+	    vertex_program_ref GameTools/CubeMap/VertexPrograms/ReduceVS
+         {       
+           // param_named_auto worldViewProj worldviewproj_matrix
+	       // param_named_auto world world_matrix 
+         } 
+	 fragment_program_ref GameTools/CubeMap/FragmentPrograms/ReducePS
+         { 
+		//param_named_auto cameraPos camera_position	 
+         param_named nFace int 0
+         param_named CUBEMAP_SIZE int 256
+         //param_named RATE int 2
+         
+        } 
+		
+	 //Cube map for reflections and refractions	
+	 texture_unit
+	 {
+	   filtering point point point
+	   cubic_texture cubemap.jpg combinedUVW
+	   tex_address_mode clamp
+	  // env_map cubic_reflection
+	   colour_op modulate
+	 }
+
+
+	}
+    }
+}
+
+material GameTools/CubeMap/Diffuse 
+{ 
+   technique 
+   { 
+      pass 
+      { 
+		
+		IllumTechniques
+		{
+			RenderTechnique ReducedColorCubeMap
+			{
+				update_interval		3
+				distance_calc false
+				face_angle_calc false
+				update_all_face		false
+			}
+		}
+      
+
+		vertex_program_ref GameTools/DiffuseVS
+		{       
+		 param_named_auto worldViewProj worldviewproj_matrix 
+    		param_named_auto world world_matrix  
+        
+		} 
+		fragment_program_ref GameTools/DiffusePS
+		{ 
+			param_named_auto cameraPos camera_position
+			param_named REDUCED_CUBEMAP_SIZE int 8
+			param_named lastCenter float3 0 0 0		
+		} 
+		
+		//Cube map for reflections and refractions	
+		texture_unit
+		{
+			cubic_texture cubemap.jpg combinedUVW
+			tex_address_mode clamp
+			colour_op replace
+		}
+
+		//Cube map of distances
+		texture_unit
+		 {
+		   cubic_texture cubemap.jpg combinedUVW
+		   tex_address_mode clamp
+		   colour_op replace
+		 }
+	 }
+   }
+}
Index: GTP/trunk/App/Demos/Illum/Ogre/Media/materials/scripts/Particles.material
===================================================================
--- GTP/trunk/App/Demos/Illum/Ogre/Media/materials/scripts/Particles.material	(revision 1094)
+++ GTP/trunk/App/Demos/Illum/Ogre/Media/materials/scripts/Particles.material	(revision 1094)
@@ -0,0 +1,115 @@
+material GameTools/SpriteShader
+{ 
+
+   technique 
+   { 
+   	pass 
+      { 
+		
+		cull_hardware none
+		cull_software none
+		lighting off
+		scene_blend add
+		depth_write off
+
+		vertex_program_ref GameTools/SpriteVS
+			{       
+				param_named_auto worldViewProj worldviewproj_matrix 
+				param_named_auto worldView worldview_matrix
+				param_named_auto Proj projection_matrix	    
+			} 
+		fragment_program_ref  GameTools/SpritePS
+			{ 
+			 
+			}
+
+		texture_unit
+		{
+		texture flare.png
+		}
+
+       }
+    }
+}
+
+
+material GameTools/SBB
+{ 
+
+   technique 
+   { 
+   	pass 
+      { 
+	lighting off
+	
+	scene_blend src_alpha one
+	//scene_blend src_alpha one_minus_src_alpha
+	depth_write off
+	depth_check off
+	
+	 vertex_program_ref GameTools/SBBVS
+         {       
+            param_named_auto worldViewProj worldviewproj_matrix 
+            param_named_auto worldView worldview_matrix
+	    param_named_auto Proj projection_matrix
+	    param_named_auto width viewport_width 	
+	    param_named_auto height viewport_height 
+	    	
+	    
+         } 
+	 fragment_program_ref  GameTools/SBBPS
+         { 
+            param_named_auto farplane far_clip_distance	  
+	    param_named_auto nearplane near_clip_distance
+	   	  
+         }
+
+	 texture_unit
+	 {
+	   anim_texture smokealpha.tga 32 2.0
+		//texture flare.png
+	 }
+
+	 texture_unit
+	 {
+	   filtering none
+	 }
+	
+	 texture_unit
+	 {
+	   texture planck.tga
+	 }
+
+       }
+    }
+}
+
+material GameTools/HPS
+{ 
+
+   technique 
+   { 
+      pass 
+      { 
+		IllumTechniques
+		{
+			RenderTechnique HPS
+			{
+				particle_script GameTools/Little
+			}			
+		}
+		
+		scene_blend add
+		
+		lighting off		
+		depth_check off
+		
+	    texture_unit
+		{
+			texture 
+		}
+			 
+		
+	}
+  }
+}
Index: GTP/trunk/App/Demos/Illum/Ogre/Media/materials/scripts/GameTools.material
===================================================================
--- GTP/trunk/App/Demos/Illum/Ogre/Media/materials/scripts/GameTools.material	(revision 1081)
+++ GTP/trunk/App/Demos/Illum/Ogre/Media/materials/scripts/GameTools.material	(revision 1094)
@@ -1,35 +1,2 @@
-
-
-material GameTools/HPS
-{ 
-
-   technique 
-   { 
-      pass 
-      { 
-		IllumTechniques
-		{
-			RenderTechnique HPS
-			{
-				particle_script GameTools/Little
-			}			
-		}
-		
-		scene_blend add
-		
-		lighting off		
-		depth_check off
-		
-	    texture_unit
-		{
-			texture 
-		}
-			 
-		
-	}
-  }
-}
-
-
 material Flare
 {
@@ -103,233 +70,5 @@
 }
 
-material GameTools/PostProcBlack
-{
-	technique 
-   { 
-   	pass 
-      {
-		vertex_program_ref GameTools/PostProc1_VS
-         {       
-         } 
-		fragment_program_ref GameTools/PostProc_Black
-         { 
-	
-         }
-       }
-    }
-}
-material GameTools/PostProc1
-{
-	technique 
-   { 
-   	pass 
-      {
-		vertex_program_ref GameTools/PostProc1_VS
-         {       
-         } 
-		fragment_program_ref GameTools/PostProc1_PS
-         { 
-	
-         }
-        texture_unit
-		 {
-		   // filtering none
-			texture rockwall.tga		
-		 }
-      }
-   }
-}
 
-material GameTools/GlowCut
-{
-	technique 
-   { 
-   	pass 
-      {
-		vertex_program_ref GameTools/PostProc1_VS
-         {       
-         } 
-		fragment_program_ref GameTools/GlowCut_PS
-         { 
-			param_named_auto width viewport_width 	
-	        param_named_auto height viewport_height 
-	        
-         }
-        texture_unit
-		 {
-		    //filtering none
-			texture rockwall.tga		
-		 }
-		 texture_unit
-		 {
-		    //filtering none
-			texture rockwall.tga		
-		 }	
-      }
-   }
-}
-
-material GameTools/Luminance
-{
-	technique 
-   { 
-   	pass 
-      {
-		vertex_program_ref GameTools/PostProc1_VS
-         {       
-         } 
-		fragment_program_ref GameTools/Luminance_PS
-         { 
-			param_named_auto width viewport_width 	
-	        param_named_auto height viewport_height 
-	        
-         }
-        texture_unit
-		 {
-		    //filtering none
-			texture rockwall.tga		
-		 }		 
-		
-      }
-   }
-}
-
-
-
-material GameTools/GlowBlurH
-{
-	technique 
-   { 
-   	pass 
-      {
-		vertex_program_ref GameTools/PostProc1_VS
-         {       
-         } 
-		fragment_program_ref GameTools/GlowBlurH_PS
-         { 
-			param_named_auto width viewport_width 	
-	        param_named_auto height viewport_height 
-	        param_named Stretch float 3.2
-         }
-        texture_unit
-		 {
-		    tex_address_mode mirror 
-			texture rockwall.tga		
-		 }
-		 	
-      }
-   }
-}
-
-material GameTools/GlowBlurV
-{
-	technique 
-   { 
-   	pass 
-      {
-		vertex_program_ref GameTools/PostProc1_VS
-         {       
-         } 
-		fragment_program_ref GameTools/GlowBlurV_PS
-         { 
-			param_named_auto width viewport_width 	
-	        param_named_auto height viewport_height 
-	        param_named Stretch float 3.2
-         }
-        texture_unit
-		 {
-		    tex_address_mode mirror 
-			texture rockwall.tga		
-		 }		 
-      }
-   }
-}
-
-material GameTools/TextureCopy
-{
-	technique 
-   { 
-   	pass 
-      {
-		vertex_program_ref GameTools/PostProc1_VS
-         {       
-         } 
-		fragment_program_ref GameTools/TextureCopy_PS
-         { 
-			param_named_auto width viewport_width 	
-	        param_named_auto height viewport_height 
-	        
-         }
-        texture_unit
-		 {
-		   // filtering none
-			texture rockwall.tga		
-		 }		 
-      }
-   }
-}
-    
-material GameTools/GlowAdd
-{
-	technique 
-   { 
-   	pass 
-      {
-		vertex_program_ref GameTools/PostProc1_VS
-         {       
-         } 
-		fragment_program_ref GameTools/GlowAdd_PS
-         { 
-			param_named_auto width viewport_width 	
-	        param_named_auto height viewport_height 
-	        
-         }
-        texture_unit
-		 {
-		   // filtering none
-			texture rockwall.tga		
-		 }
-		  texture_unit
-		 {
-		   // filtering none
-			texture rockwall.tga		
-		 }
-      }
-   }
-}
-
-material GameTools/ToneMap
-{
-	technique 
-   { 
-   	pass 
-      {
-		vertex_program_ref GameTools/PostProc1_VS
-         {       
-         } 
-		fragment_program_ref GameTools/ToneMap_PS
-         { 
-			param_named_auto width viewport_width 	
-	        param_named_auto height viewport_height 
-	        param_named Gain float 0.5
-         }
-        texture_unit
-		 {
-		   // filtering none
-			texture rockwall.tga		
-		 }
-		  texture_unit
-		 {
-		   // filtering none
-			texture rockwall.tga		
-		 }
-		  texture_unit
-		 {
-		   // filtering none
-			texture rockwall.tga		
-		 }
-      }
-   }
-}
 
 material GameTools/UVShader
@@ -353,492 +92,4 @@
 }
 
-
-material GameTools/Caustic/Default 
-{ 
-
-   technique 
-   { 
-       pass 
-       { 
-		lighting off		
-
-		vertex_program_ref GameTools/Caustic/DefaultVS
-		{       
-         param_named_auto worldViewProj worldviewproj_matrix
-		 param_named_auto world world_matrix 
-		} 
-		fragment_program_ref GameTools/Caustic/DefaultPS
-		{ 
-		 param_named cubeMapCameraPosition float3 0 0 0	 
-		} 
-		
-	    texture_unit
-		{
-			filtering none				
-		}
-			 
-		texture_unit
-		{
-			//filtering linear linear linear			
-		}
-	}
-    }
-}
-
-material GameTools/SoftShadowReciever/Default 
-{ 
-
-   technique 
-   { 
-       pass 
-       { 
-		lighting off		
-
-		vertex_program_ref GameTools/SoftShadow/VertexPrograms/DefaultVS
-		{       
-         param_named_auto worldViewProj worldviewproj_matrix
-		 param_named_auto world world_matrix 
-		} 
-		fragment_program_ref GameTools/SoftShadow/FragmentPrograms/DefaultPS
-		{ 
-		 param_named cubeMapCameraPosition float3 0 0 0	 
-		} 
-		
-	    texture_unit
-		{
-			texture rockwall.tga
-			//texture cubbe.jpg
-			
-		}
-			 
-		texture_unit
-		{
-			//filtering linear linear linear
-			cubic_texture cubemap.jpg combinedUVW
-			env_map cubic_reflection		
-		}
-	}
-    }
-}
-
-material GameTools/SoftShadowReciever/Default2 
-{ 
-
-   technique 
-   { 
-       pass 
-       { 
-		lighting off		
-
-		vertex_program_ref GameTools/SoftShadow/VertexPrograms/DefaultVS
-		{       
-         param_named_auto world_IT inverse_transpose_world_matrix  
-		param_named_auto worldViewProj worldviewproj_matrix
-		 param_named_auto world world_matrix 
-		} 
-		fragment_program_ref GameTools/SoftShadow/FragmentPrograms/Default2PS
-		{ 
-		 param_named cubeMapCameraPosition float3 0 0 0	 
-		 param_named_auto cameraPos camera_position
-		 param_named_auto lightPosition light_position 0 
-		} 		
-	    
-		texture_unit
-		{
-			//filtering linear linear linear
-			cubic_texture cubemap.jpg combinedUVW
-			env_map cubic_reflection		
-		}
-	}
-    }
-}
-
-material GameTools/CausticSoftShadowReciever
-{ 
-
-   technique 
-   { 
-      pass 
-      { 
-		lighting off		
-
-		vertex_program_ref GameTools/CausticSoftShadowVS
-		{       
-         param_named_auto world_IT worldviewproj_matrix  
-		 param_named_auto worldViewProj worldviewproj_matrix
-		 param_named_auto world world_matrix 
-		} 
-		fragment_program_ref GameTools/CausticSoftShadowPS
-		{ 
-		 //param_named_auto world_IT inverse_worldview_matrix  
-		 param_named cubeMapCameraPosition float3 0 0 0	 
-		} 
-		
-	    texture_unit
-		{
-			//texture rockwall.tga
-			texture cubbe.jpg			
-		}
-			 
-		//texture_unit //caustic cubemap
-		//{
-		//	//filtering linear linear linear
-		//	cubic_texture cubemap.jpg combinedUVW			
-		//}
-		
-		//texture_unit  //softshadow cubemap
-		//{
-		//	//filtering linear linear linear
-		//	cubic_texture cubemap.jpg combinedUVW
-		//}
-		
-		texture_unit/bump
-		{
-			texture falnormal.dds
-		}
-	}
-  }
-}
-
-
-material GameTools/CubeMap/Default 
-{ 
-
-   technique 
-   { 
-       pass 
-       { 
-		lighting off
-	
-
-
-		vertex_program_ref GameTools/CubeMap/VertexPrograms/DefaultVS
-		 {       
-		     param_named_auto worldViewProj worldviewproj_matrix
-		    param_named_auto world world_matrix 
-		 } 
-		 fragment_program_ref GameTools/CubeMap/FragmentPrograms/DefaultPS
-		 { 
-			param_named_auto cameraPos camera_position	 
-		 } 
-			
-		//Cube map for reflections and refractions	
-		texture_unit
-		{
-			cubic_texture cubemap.jpg combinedUVW	
-			//env_map cubic_reflection	
-		}
-	 
-	
-	  }
-    }
-}
-
-
-
-material GameTools/CubeMap/Reduce
-{ 
-
-   technique 
-   { 
-       pass 
-       { 
-       //depth_check off
-	   lighting off
-	
-	    vertex_program_ref GameTools/CubeMap/VertexPrograms/ReduceVS
-         {       
-           // param_named_auto worldViewProj worldviewproj_matrix
-	       // param_named_auto world world_matrix 
-         } 
-	 fragment_program_ref GameTools/CubeMap/FragmentPrograms/ReducePS
-         { 
-		//param_named_auto cameraPos camera_position	 
-         param_named nFace int 0
-         param_named CUBEMAP_SIZE int 256
-         //param_named RATE int 2
-         
-        } 
-		
-	 //Cube map for reflections and refractions	
-	 texture_unit
-	 {
-	   filtering point point point
-	   cubic_texture cubemap.jpg combinedUVW
-	   tex_address_mode clamp
-	  // env_map cubic_reflection
-	   colour_op modulate
-	 }
-
-
-	}
-    }
-}
-
-
-
-material GameTools/CubeMap/Localized 
-{ 
-
-   technique 
-   { 
-   
-      pass 
-      { 
-		IllumTechniques
-		{
-			RenderTechnique ColorCubeMap
-			{
-				update_interval		0
-				distance_calc true 3.5					
-			}
-			RenderTechnique DistanceCubeMap
-			{
-				update_interval		0
-				distance_calc true 3.5						
-			}
-			RenderTechnique CausticCaster
-			{
-									
-			}
-			
-		 }
-      
-      
-	 vertex_program_ref GameTools/CubeMap/VertexPrograms/LocalizedVS
-     {       
-            param_named_auto worldViewProj worldviewproj_matrix 
-    	    param_named_auto world world_matrix 
-     } 
-	 fragment_program_ref 	GameTools/CubeMap/FragmentPrograms/LocalizedPS
-     { 
-		param_named_auto cameraPos camera_position
-		param_named_auto lightPosition light_position 0
-	 } 
-		
-	 //Cube map for reflections and refractions	
-	 texture_unit
-	 {
-	   cubic_texture cubemap.jpg combinedUVW
-	   tex_address_mode clamp
-	   colour_op replace
-	 }
-
-	//Cube map of distances
-	 texture_unit
-	 {
-	   cubic_texture cubemap.jpg combinedUVW
-	   tex_address_mode clamp
-	   colour_op replace
-	 }
-
-
-	}
-    }
-}
-
-
-material GameTools/Localized_NOCAUSTIC 
-{ 
-
-   technique 
-   { 
-   
-      pass 
-      { 
-		IllumTechniques
-		{
-			RenderTechnique ColorCubeMap
-			{
-				update_interval		0
-				distance_calc true 3.5					
-			}
-			RenderTechnique DistanceCubeMap
-			{
-				update_interval		0
-				distance_calc true 3.5						
-			}	
-			
-		 }
-      
-      
-	 vertex_program_ref GameTools/CubeMap/VertexPrograms/LocalizedVS
-     {       
-            param_named_auto worldViewProj worldviewproj_matrix 
-    	    param_named_auto world world_matrix 
-     } 
-	 fragment_program_ref 	GameTools/CubeMap/FragmentPrograms/LocalizedPS
-     { 
-		param_named_auto cameraPos camera_position
-		param_named_auto lightPosition light_position 0
-	 } 
-		
-	 //Cube map for reflections and refractions	
-	 texture_unit
-	 {
-	   cubic_texture cubemap.jpg combinedUVW
-	   tex_address_mode clamp
-	   colour_op replace
-	 }
-
-	//Cube map of distances
-	 texture_unit
-	 {
-	   cubic_texture cubemap.jpg combinedUVW
-	   tex_address_mode clamp
-	   colour_op replace
-	 }
-
-
-	}
-    }
-}
-
-material GameTools/CubeMap/LocalizedBump 
-{ 
-
-   technique 
-   { 
-   
-      pass 
-      { 
-	 vertex_program_ref GameTools/CubeMap/VertexPrograms/LocalizedBumpVS
-     {       
-            param_named_auto worldViewProj worldviewproj_matrix 
-    	    param_named_auto world world_matrix 
-     } 
-	 fragment_program_ref 	GameTools/CubeMap/FragmentPrograms/LocalizedBumpPS
-     { 
-		param_named_auto cameraPos camera_position
-		param_named_auto lightPosition light_position 0
-	 } 
-		
-	 //Cube map for reflections and refractions	
-	 texture_unit
-	 {
-	   cubic_texture cubemap.jpg combinedUVW
-	   tex_address_mode clamp
-	   colour_op replace
-	 }
-
-	//Cube map of distances
-	 texture_unit
-	 {
-	   cubic_texture cubemap.jpg combinedUVW
-	   tex_address_mode clamp
-	   colour_op replace
-	 }
-	 
-	 //normal map
-	 texture_unit
-	 {
-	   texture atheneNormalMapNew.dds
-		//texture atheneNormalMap.png
-	 }
-	 texture_unit
-	 {
-	   texture atheneDisplacementMap.bmp
-	 }
-
-
-	}
-    }
-}
-
-material GameTools/CubeMap/Diffuse 
-{ 
-   technique 
-   { 
-      pass 
-      { 
-		
-		IllumTechniques
-		{
-			RenderTechnique ReducedColorCubeMap
-			{
-				update_interval		3
-				distance_calc false
-				face_angle_calc false
-				update_all_face		false
-			}
-		}
-      
-
-		vertex_program_ref GameTools/DiffuseVS
-		{       
-		 param_named_auto worldViewProj worldviewproj_matrix 
-    		param_named_auto world world_matrix  
-        
-		} 
-		fragment_program_ref GameTools/DiffusePS
-		{ 
-			param_named_auto cameraPos camera_position
-			param_named REDUCED_CUBEMAP_SIZE int 8
-			param_named lastCenter float3 0 0 0		
-		} 
-		
-		//Cube map for reflections and refractions	
-		texture_unit
-		{
-			cubic_texture cubemap.jpg combinedUVW
-			tex_address_mode clamp
-			colour_op replace
-		}
-
-		//Cube map of distances
-		texture_unit
-		 {
-		   cubic_texture cubemap.jpg combinedUVW
-		   tex_address_mode clamp
-		   colour_op replace
-		 }
-	 }
-   }
-}
-
-
-
-material GameTools/CubeMap/LocalizedMetal 
-{ 
-
-   technique 
-   { 
-      pass 
-      { 
-	 vertex_program_ref GameTools/CubeMap/VertexPrograms/LocalizedVS
-         {       
-            param_named_auto worldViewProj worldviewproj_matrix 
-    	    param_named_auto world world_matrix
-	    
-         } 
-	 fragment_program_ref 	GameTools/CubeMap/FragmentPrograms/LocalizedMetalPS
-         { 
-	    param_named_auto cameraPos camera_position
-	    param_named n float3 0.21 0.96 1.17
-	    param_named k float3 4.16 2.57 2.32
-	 } 
-		
-	 //Cube map for reflections and refractions	
-	 texture_unit
-	 {
-	   cubic_texture cubemap.jpg combinedUVW
-	   tex_address_mode clamp
-	   colour_op replace
-	 }
-
-	//Cube map of distances
-	 texture_unit
-	 {
-	   cubic_texture cubemap.jpg combinedUVW
-	   tex_address_mode clamp
-	   colour_op replace
-	 }
-
-
-	}
-    }
-}
-
-
 material GameTools/DistanceShader
 { 
@@ -861,77 +112,4 @@
     }
 }
-
-
-material GameTools/PhotonMapCaustic
-{ 
-   technique 
-   { 
-
-   	pass 
-      { 
-		 vertex_program_ref GameTools/CubeMap/VertexPrograms/LocalizedVS
-         {       
-            param_named_auto worldViewProj worldviewproj_matrix 
-    	    param_named_auto world world_matrix	    
-    	    param_named_auto worldIT inverse_transpose_world_matrix
-         } 
-		 fragment_program_ref  GameTools/PhotonMapCausticPS
-        { 
-			param_named_auto cameraPos camera_position
-			param_named lastCenter float3 0 0 0
-         }
-         
-         //Cube map for reflections and refractions	
-		texture_unit
-		{
-			cubic_texture 
-			filtering none
-			//tex_address_mode clamp			
-		}	
-
-       }
-    }
-}
-
-
-material GameTools/PhotonMapSoftShadow
-{ 
-   technique 
-   { 
-   	pass 
-      { 
-		 vertex_program_ref GameTools/CubeMap/VertexPrograms/LocalizedVS
-         {       
-            param_named_auto worldViewProj worldviewproj_matrix 
-    	    param_named_auto world world_matrix	    
-         } 
-		 fragment_program_ref  GameTools/PhotonMapSoftShadowPS
-         { 
-			param_named_auto cameraPos camera_position
-			param_named lastCenter float3 0 0 0
-         }
-         
-         //Cube map for reflections and refractions	
-		texture_unit
-		{
-			cubic_texture cubemap.jpg combinedUVW
-			tex_address_mode clamp
-			colour_op replace
-			env_map cubic_reflection
-		}
-
-		//Cube map of distances
-		texture_unit
-		{
-			cubic_texture cubemap.jpg combinedUVW
-			tex_address_mode clamp
-			colour_op replace
-		}
-       }
-    }
-}
-
-
-
 
 material GameTools/SceneCameraDepthShader
@@ -984,128 +162,2 @@
     }
 }
-
-material GameTools/Cau
-{ 
-   technique 
-   { 
-   	pass 
-      
-		cull_hardware none
-		cull_software none
-		lighting off
-		scene_blend add
-		scene_blend src_alpha one
-		depth_write off
-
-		vertex_program_ref GameTools/CauVS
-         {       
-            param_named_auto worldViewProj worldviewproj_matrix 
-            param_named_auto worldView worldview_matrix
-			param_named_auto Proj projection_matrix
-			param_named_auto resolution viewport_width
-			param_named CauSpriteSize float 1.0	    
-         } 
-		fragment_program_ref  GameTools/CauPS
-        { 
-			param_named CauSpriteIntens float 1.0
-        }
-         
-	    texture_unit
-		{
-			vertex_texture true
-			texture flare.png
-		}
-		texture_unit
-		{
-			texture PowerOfPhotonHitTexel.dds
-		}
-
-       }
-    }
-}
-
-material GameTools/SpriteShader
-{ 
-
-   technique 
-   { 
-   	pass 
-      { 
-		
-		cull_hardware none
-		cull_software none
-		lighting off
-		scene_blend add
-		depth_write off
-
-		vertex_program_ref GameTools/SpriteVS
-			{       
-				param_named_auto worldViewProj worldviewproj_matrix 
-				param_named_auto worldView worldview_matrix
-				param_named_auto Proj projection_matrix	    
-			} 
-		fragment_program_ref  GameTools/SpritePS
-			{ 
-			 
-			}
-
-		texture_unit
-		{
-		texture flare.png
-		}
-
-       }
-    }
-}
-
-
-material GameTools/SBB
-{ 
-
-   technique 
-   { 
-   	pass 
-      { 
-	lighting off
-	
-	scene_blend src_alpha one
-	//scene_blend src_alpha one_minus_src_alpha
-	depth_write off
-	depth_check off
-	
-	 vertex_program_ref GameTools/SBBVS
-         {       
-            param_named_auto worldViewProj worldviewproj_matrix 
-            param_named_auto worldView worldview_matrix
-	    param_named_auto Proj projection_matrix
-	    param_named_auto width viewport_width 	
-	    param_named_auto height viewport_height 
-	    	
-	    
-         } 
-	 fragment_program_ref  GameTools/SBBPS
-         { 
-            param_named_auto farplane far_clip_distance	  
-	    param_named_auto nearplane near_clip_distance
-	   	  
-         }
-
-	 texture_unit
-	 {
-	   anim_texture smokealpha.tga 32 2.0
-		//texture flare.png
-	 }
-
-	 texture_unit
-	 {
-	   filtering none
-	 }
-	
-	 texture_unit
-	 {
-	   texture planck.tga
-	 }
-
-       }
-    }
-}
Index: GTP/trunk/App/Demos/Illum/Ogre/Media/materials/scripts/GlassHead.material
===================================================================
--- GTP/trunk/App/Demos/Illum/Ogre/Media/materials/scripts/GlassHead.material	(revision 1094)
+++ GTP/trunk/App/Demos/Illum/Ogre/Media/materials/scripts/GlassHead.material	(revision 1094)
@@ -0,0 +1,132 @@
+material GameTools/PhotonMapCaustic
+{ 
+   technique 
+   { 
+
+      pass 
+      { 
+	 vertex_program_ref GameTools/CubeMap/VertexPrograms/LocalizedVS
+         {       
+            param_named_auto worldViewProj worldviewproj_matrix 
+    	    param_named_auto world world_matrix	    
+    	    param_named_auto worldIT inverse_transpose_world_matrix
+         } 
+	 fragment_program_ref  GameTools/PhotonMapCausticPS
+         { 
+	    param_named_auto cameraPos camera_position
+	    param_named lastCenter float3 0 0 0
+         }
+
+         //distanec cubemap
+         texture_unit
+	 {
+	   cubic_texture 
+	   filtering none
+	 }	
+
+       }
+    }
+}
+
+material GameTools/Cau
+{ 
+   technique 
+   { 
+        pass
+	{
+		cull_hardware none
+		cull_software none
+		lighting off
+		scene_blend add
+		scene_blend src_alpha one
+		depth_write off
+		point_sprites on
+
+		vertex_program_ref GameTools/CauVS
+	        {       
+        	    param_named_auto worldViewProj worldviewproj_matrix 
+	            param_named_auto worldView worldview_matrix
+		    param_named_auto Proj projection_matrix
+		    param_named_auto resolution viewport_width
+		    param_named CauSpriteSize float 10.0	    
+	        } 
+		fragment_program_ref  GameTools/CauPS
+        	{ 
+		    param_named CauSpriteIntens float 0.15
+		    param_named color float3 0.7 0.7 0.5
+		}
+         
+	    	texture_unit
+		{
+			vertex_texture true
+			texture flare.png
+		}
+		texture_unit
+		{
+			texture PowerOfPhotonHitTexel.dds
+		}
+
+       }
+    }
+}
+
+
+material GameTools/CausticGlass
+{ 
+
+   technique 
+   { 
+   
+      pass 
+      { 
+		IllumTechniques
+		{
+			RenderTechnique ColorCubeMap
+			{
+				update_interval		0
+				distance_calc true 3.5					
+			}
+			RenderTechnique DistanceCubeMap
+			{
+				update_interval		0
+				distance_calc true 3.5						
+			}
+			RenderTechnique CausticCaster
+			{
+				attenuation	0					
+			}
+			
+		 }
+      
+      
+	 vertex_program_ref GameTools/CubeMap/VertexPrograms/LocalizedVS
+     	 {       
+            param_named_auto worldViewProj worldviewproj_matrix 
+    	    param_named_auto world world_matrix 
+     	 } 
+	 fragment_program_ref 	GameTools/CubeMap/FragmentPrograms/LocalizedPS
+     	 { 
+		param_named_auto cameraPos camera_position
+		param_named_auto lightPosition light_position 0
+	 } 
+		
+	 //Cube map for reflections and refractions	
+	 texture_unit
+	 {
+	   cubic_texture cubemap.jpg combinedUVW
+	   tex_address_mode clamp
+	   colour_op replace
+	 }
+
+	//Cube map of distances
+	 texture_unit
+	 {
+	   cubic_texture cubemap.jpg combinedUVW
+	   tex_address_mode clamp
+	   colour_op replace
+	 }
+
+
+	}
+    }
+}
Index: GTP/trunk/App/Demos/Illum/Ogre/Media/materials/scripts/kupola.material
===================================================================
--- GTP/trunk/App/Demos/Illum/Ogre/Media/materials/scripts/kupola.material	(revision 1085)
+++ GTP/trunk/App/Demos/Illum/Ogre/Media/materials/scripts/kupola.material	(revision 1094)
@@ -13,10 +13,10 @@
 			RenderTechnique CausticReciever
 			{
+				max_caster_count	10
+			}
+			//RenderTechnique DepthShadowReciever
+			//{
 				
-			}
-			RenderTechnique DepthShadowReciever
-			{
-				
-			}
+			//}
 		}
 		
@@ -66,10 +66,10 @@
 				RenderTechnique CausticReciever
 				{
+					max_caster_count	10
+				}
+				//RenderTechnique DepthShadowReciever
+				//{
 					
-				}
-				RenderTechnique DepthShadowReciever
-				{
-					
-				}
+				//}
 			}
 			
Index: GTP/trunk/App/Demos/Illum/Ogre/Media/materials/scripts/Glow.material
===================================================================
--- GTP/trunk/App/Demos/Illum/Ogre/Media/materials/scripts/Glow.material	(revision 1094)
+++ GTP/trunk/App/Demos/Illum/Ogre/Media/materials/scripts/Glow.material	(revision 1094)
@@ -0,0 +1,229 @@
+material GameTools/PostProcBlack
+{
+	technique 
+   { 
+   	pass 
+      {
+		vertex_program_ref GameTools/PostProc1_VS
+         {       
+         } 
+		fragment_program_ref GameTools/PostProc_Black
+         { 
+	
+         }
+       }
+    }
+}
+material GameTools/PostProc1
+{
+	technique 
+   { 
+   	pass 
+      {
+		vertex_program_ref GameTools/PostProc1_VS
+         {       
+         } 
+		fragment_program_ref GameTools/PostProc1_PS
+         { 
+	
+         }
+        texture_unit
+		 {
+		   // filtering none
+			texture rockwall.tga		
+		 }
+      }
+   }
+}
+
+material GameTools/GlowCut
+{
+	technique 
+   { 
+   	pass 
+      {
+		vertex_program_ref GameTools/PostProc1_VS
+         {       
+         } 
+		fragment_program_ref GameTools/GlowCut_PS
+         { 
+			param_named_auto width viewport_width 	
+	        param_named_auto height viewport_height 
+	        
+         }
+        texture_unit
+		 {
+		    //filtering none
+			texture rockwall.tga		
+		 }
+		 texture_unit
+		 {
+		    //filtering none
+			texture rockwall.tga		
+		 }	
+      }
+   }
+}
+
+material GameTools/Luminance
+{
+	technique 
+   { 
+   	pass 
+      {
+		vertex_program_ref GameTools/PostProc1_VS
+         {       
+         } 
+		fragment_program_ref GameTools/Luminance_PS
+         { 
+			param_named_auto width viewport_width 	
+	        param_named_auto height viewport_height 
+	        
+         }
+        texture_unit
+		 {
+		    //filtering none
+			texture rockwall.tga		
+		 }		 
+		
+      }
+   }
+}
+
+
+
+material GameTools/GlowBlurH
+{
+	technique 
+   { 
+   	pass 
+      {
+		vertex_program_ref GameTools/PostProc1_VS
+         {       
+         } 
+		fragment_program_ref GameTools/GlowBlurH_PS
+         { 
+			param_named_auto width viewport_width 	
+	        param_named_auto height viewport_height 
+	        param_named Stretch float 3.2
+         }
+        texture_unit
+		 {
+		    tex_address_mode mirror 
+			texture rockwall.tga		
+		 }
+		 	
+      }
+   }
+}
+
+material GameTools/GlowBlurV
+{
+	technique 
+   { 
+   	pass 
+      {
+		vertex_program_ref GameTools/PostProc1_VS
+         {       
+         } 
+		fragment_program_ref GameTools/GlowBlurV_PS
+         { 
+			param_named_auto width viewport_width 	
+	        param_named_auto height viewport_height 
+	        param_named Stretch float 3.2
+         }
+        texture_unit
+		 {
+		    tex_address_mode mirror 
+			texture rockwall.tga		
+		 }		 
+      }
+   }
+}
+
+material GameTools/TextureCopy
+{
+	technique 
+   { 
+   	pass 
+      {
+		vertex_program_ref GameTools/PostProc1_VS
+         {       
+         } 
+		fragment_program_ref GameTools/TextureCopy_PS
+         { 
+			param_named_auto width viewport_width 	
+	        param_named_auto height viewport_height 
+	        
+         }
+        texture_unit
+		 {
+		   // filtering none
+			texture rockwall.tga		
+		 }		 
+      }
+   }
+}
+    
+material GameTools/GlowAdd
+{
+	technique 
+   { 
+   	pass 
+      {
+		vertex_program_ref GameTools/PostProc1_VS
+         {       
+         } 
+		fragment_program_ref GameTools/GlowAdd_PS
+         { 
+			param_named_auto width viewport_width 	
+	        param_named_auto height viewport_height 
+	        
+         }
+        texture_unit
+		 {
+		   // filtering none
+			texture rockwall.tga		
+		 }
+		  texture_unit
+		 {
+		   // filtering none
+			texture rockwall.tga		
+		 }
+      }
+   }
+}
+
+material GameTools/ToneMap
+{
+	technique 
+   { 
+   	pass 
+      {
+		vertex_program_ref GameTools/PostProc1_VS
+         {       
+         } 
+		fragment_program_ref GameTools/ToneMap_PS
+         { 
+			param_named_auto width viewport_width 	
+	        param_named_auto height viewport_height 
+	        param_named Gain float 0.5
+         }
+        texture_unit
+		 {
+		   // filtering none
+			texture rockwall.tga		
+		 }
+		  texture_unit
+		 {
+		   // filtering none
+			texture rockwall.tga		
+		 }
+		  texture_unit
+		 {
+		   // filtering none
+			texture rockwall.tga		
+		 }
+      }
+   }
+}
Index: GTP/trunk/App/Demos/Illum/Ogre/Media/materials/programs/GameTools_Cau.hlsl
===================================================================
--- GTP/trunk/App/Demos/Illum/Ogre/Media/materials/programs/GameTools_Cau.hlsl	(revision 916)
+++ GTP/trunk/App/Demos/Illum/Ogre/Media/materials/programs/GameTools_Cau.hlsl	(revision 1094)
@@ -10,4 +10,6 @@
 	float2 center		: TEXCOORD2;
 	float4 position		: TEXCOORD3;
+	float pSize			: PSIZE;
+	float dist			: TEXCOORD4;
 };
 
@@ -24,9 +26,9 @@
      
    float radius = CauSpriteSize;
-   float2 offset = 2.0 * texCoord.zw * radius;
-   
+   OUT.pSize = radius;
    float4 cPosition;  
 
-   float4 pos = tex2Dlod(PhotonHitMap, float4(position.x, 1.0 - position.y,0,0)).rgba;
+  float4 pos = tex2Dlod(PhotonHitMap, float4(position.x, 1.0 - position.y,0,0)).rgba;
+//	float4 pos = float4(0,0,-0.5,1);
    if(pos.a == 0)//no photon hit
    {
@@ -40,29 +42,14 @@
 		cPosition = mul(worldView, wPosition);
 		OUT.center = cPosition.xy;
-		cPosition.xy += offset;				
 		OUT.position = cPosition;	
-		OUT.hPosition = mul(Proj, cPosition);
-		
-		/* 
-		//rotate to camera
-		cPosition = mul(worldView, wPosition);
-				
-		float3 C = cPosition.xyz;
-		float3 right = cross(C, float3(0,1,0));
-		float3 up = cross(right, C);
-		
-		float3 cOffset = offset.x * right + offset.y * up;
-		cPosition.xy += float2(-0.5/resolution, -0.5/resolution);
-		OUT.center = cPosition.xy;
-		cPosition.xyz += cOffset;				
-		OUT.position = cPosition;	
-		OUT.hPosition = mul(Proj, cPosition);
-		*/
+		OUT.hPosition = mul(Proj, cPosition);		
 	 }	
   
-   OUT.r.x = abs(offset.x);
+   OUT.r.x = radius;
    OUT.r.y = radius;
    OUT.texCoord = texCoord;
-   OUT.color = 1;       
+   OUT.color = 1; 
+   OUT.color = float4(pos);
+   OUT.dist = length(pos.xyz);
    
    return OUT;
@@ -71,15 +58,15 @@
 
 float4 CauPS(VS_OUT IN,
+		uniform float3 color,
 		uniform sampler2D intensityTex : register(s1)
 		 ):COLOR
 {
 
-  float2 texcoord = (IN.center - IN.position.xy) / IN.r.x;
-  texcoord = (texcoord + 1.0) * 0.5;
-  float intens = tex2D(intensityTex, texcoord).r;
-  IN.color = intens * CauSpriteIntens;
- 
-  return IN.color;
-  
+ // float2 texcoord = (IN.center - IN.position.xy) / IN.r.x;
+ // texcoord = (texcoord + 1.0) * 0.5;
+  IN.color.rgb = color;
+  float intens = tex2D(intensityTex, IN.texCoord).r;
+  IN.color.a = intens * CauSpriteIntens;
+  return IN.color;  
 }
 
Index: GTP/trunk/App/Demos/Illum/Ogre/Media/materials/programs/_oldGameTools_DepthShadow.hlsl
===================================================================
--- GTP/trunk/App/Demos/Illum/Ogre/Media/materials/programs/_oldGameTools_DepthShadow.hlsl	(revision 1094)
+++ GTP/trunk/App/Demos/Illum/Ogre/Media/materials/programs/_oldGameTools_DepthShadow.hlsl	(revision 1094)
@@ -0,0 +1,81 @@
+///////depth map
+struct VS_OUT
+{
+	float4 hPosition	: POSITION;
+	float4 Position	: TEXCOORD0;
+};
+
+VS_OUT hDepthVS(float4 position : POSITION,	
+		uniform float4x4 worldView,
+		uniform float4x4 worldViewProj)
+{
+  
+  VS_OUT OUT;
+  OUT.hPosition = mul(worldViewProj, position);
+  OUT.Position = mul(worldView, position);
+  OUT.Position.z *= -1.0;
+  return OUT;
+}
+
+
+
+float4 DepthPS(VS_OUT IN ):COLOR
+{
+	float dist = length(IN.Position.xyz);
+	return float4(dist, dist, dist, 1);	
+}
+
+///////////////Shadow
+
+struct VS_OUT_SHADOW
+{
+	float4 hPosition	: POSITION;
+	float4 Position		: TEXCOORD0;
+};
+
+VS_OUT_SHADOW depthShadowVS(float4 position : POSITION,	
+		uniform float4x4 world,
+		uniform float4x4 worldViewProj)
+{
+  VS_OUT_SHADOW OUT;
+  OUT.hPosition = mul(worldViewProj, position);
+  OUT.Position = mul(world, position);
+  return OUT;
+}
+
+
+float4 depthShadowPS(VS_OUT_SHADOW IN,
+					uniform float4x4 lightView,
+					uniform float4x4 lightViewProj,
+					uniform sampler2D depthShadowMap ):COLOR
+{
+	float bias = 0.0;
+	float4 shadowColor = float4(0.4, 0.4, 0.4, 1.0);
+
+	float4 light = 1;
+	
+	float4 lightCamPos = mul(lightView, IN.Position);
+	float d = length(lightCamPos.xyz);
+	
+	float4 lightScreenPos = mul(lightViewProj, IN.Position);
+	lightScreenPos = lightScreenPos / lightScreenPos.w ;
+	float dist = length(lightScreenPos.xy);
+	
+	if(dist < 1.0 && lightCamPos.z < 0)
+	{
+		lightScreenPos = ( lightScreenPos + 1.0 ) / 2.0;
+		lightScreenPos.y = 1.0 - lightScreenPos.y;
+		float4 storedDepth = tex2D(depthShadowMap, lightScreenPos.xy);
+			
+		
+		if(storedDepth.r + bias < d)
+			light = shadowColor;
+		if(storedDepth.r == 0)
+			light = 1;			
+	}
+	else
+		light = 1;
+		
+	return light;	
+}
+
Index: GTP/trunk/App/Demos/Illum/Ogre/Media/materials/programs/GameTools_Localized_EnvMap.hlsl
===================================================================
--- GTP/trunk/App/Demos/Illum/Ogre/Media/materials/programs/GameTools_Localized_EnvMap.hlsl	(revision 1060)
+++ GTP/trunk/App/Demos/Illum/Ogre/Media/materials/programs/GameTools_Localized_EnvMap.hlsl	(revision 1094)
@@ -24,4 +24,5 @@
 {
 	float4 color = texCUBE( cm, float3(coord.xy, - coord.z) );
+	color.a = 1;
 	return color;
 }
Index: GTP/trunk/App/Demos/Illum/Ogre/Media/materials/programs/GameTools_Caustic.hlsl
===================================================================
--- GTP/trunk/App/Demos/Illum/Ogre/Media/materials/programs/GameTools_Caustic.hlsl	(revision 1085)
+++ GTP/trunk/App/Demos/Illum/Ogre/Media/materials/programs/GameTools_Caustic.hlsl	(revision 1094)
@@ -40,11 +40,12 @@
 	float dist = readDistanceCubeMap(distanceCube, dir);
 	
-	float EPSILON = 0.1;
+	float EPSILON = 1.0;
 
-	//if(mydist > dist + EPSILON) caustic = 0;
-	 caustic *= max(attenuation - mydist, 0) / attenuation;
-		
+	if(mydist > dist + EPSILON) caustic = 0;
+	//caustic.rgb *= max(attenuation - mydist, 0.0) / attenuation;
+			
 	Color = caustic;
-		
+	Color += attenuation;
+	Color.a = 1;	
 	return Color;
 }
