Index: /GTP/trunk/App/Demos/Illum/Ogre/Media/materials/scripts/GameTools_HPS.material
===================================================================
--- /GTP/trunk/App/Demos/Illum/Ogre/Media/materials/scripts/GameTools_HPS.material	(revision 1336)
+++ /GTP/trunk/App/Demos/Illum/Ogre/Media/materials/scripts/GameTools_HPS.material	(revision 1339)
@@ -2,6 +2,6 @@
 {
 	source GameTools_HPS_Smoke_S.hlsl
-	entry_point VP
-	target vs_2_0
+	entry_point HPS_Smoke_S_VS
+	target vs_3_0
 } 
 
@@ -9,6 +9,91 @@
 {
 	source GameTools_HPS_Smoke_S.hlsl
-	entry_point FP
+	entry_point HPS_Smoke_S_PS
 	target ps_3_0
 } 
 
+
+
+material HPS_SMOKE_S
+{
+	technique
+	{
+		pass
+		{			
+			vertex_program_ref HPS_Smoke_S_VS
+			{       
+				param_named_auto worldViewProj worldviewproj_matrix 
+				param_named_auto worldView worldview_matrix
+				param_named_auto Proj projection_matrix	    
+			} 
+			fragment_program_ref  HPS_Smoke_S_PS
+			{ 
+				param_named_auto Proj projection_matrix
+			}
+			
+			depth_check off
+			//scene_blend_op min
+			//scene_blend_op_alpha add
+			scene_blend one one
+
+		}
+	}
+}
+
+
+vertex_program HPS_Smoke_L_VS hlsl
+{
+	source GameTools_HPS_Smoke_L.hlsl
+	entry_point HPS_Smoke_L_VS
+	target vs_3_0
+} 
+
+fragment_program HPS_Smoke_L_PS hlsl
+{
+	source GameTools_HPS_Smoke_L.hlsl
+	entry_point HPS_Smoke_L_PS
+	target ps_3_0
+} 
+
+
+
+material HPS_SMOKE_L
+{
+	technique
+	{
+		pass
+		{	
+			IllumTechniques
+			{
+				RenderTechnique HPS
+				{
+					particle_script GameTools/Little
+					perspective false
+				}			
+			}
+				
+			vertex_program_ref HPS_Smoke_L_VS
+			{       
+				param_named_auto worldViewProj worldviewproj_matrix 
+				param_named_auto worldView worldview_matrix
+				param_named_auto Proj projection_matrix	    
+			} 
+			fragment_program_ref  HPS_Smoke_L_PS
+			{ 
+				param_named_auto Proj projection_matrix
+			}
+			
+			//depth_check off			
+			//scene_blend_alpha add
+			
+			texture_unit
+			{
+				
+			}
+
+		}
+	}
+}
+
+
+
Index: /GTP/trunk/App/Demos/Illum/Ogre/Media/materials/programs/GameTools_HPS_Smoke_S.hlsl
===================================================================
--- /GTP/trunk/App/Demos/Illum/Ogre/Media/materials/programs/GameTools_HPS_Smoke_S.hlsl	(revision 1336)
+++ /GTP/trunk/App/Demos/Illum/Ogre/Media/materials/programs/GameTools_HPS_Smoke_S.hlsl	(revision 1339)
@@ -2,55 +2,67 @@
 struct VS_OUT
 {
-	float4 hPosition : POSITION;
-	float4 cPosition : TEXCOORD0;
-	float  radius	 : TEXCOORD2;
-	float4 texCoord	 : TEXCOORD1;
+	float4 hPosition	: POSITION;
+	float4 cPosition	: TEXCOORD1;
+	float2 texCoord		: TEXCOORD0;
+	float r				: TEXCOORD2;	
+	float4 center		: TEXCOORD3;
 };
 
-VS_OUT VP(float4 mPosition : POSITION,
-		  uniform float4x4 worldView,
-		  uniform float4x4 Proj,
-		  uniform float4x4 worldViewProj
-		  float2 texCoord :TEXCOORD0)
+VS_OUT HPS_Smoke_S_VS (float4 position : POSITION,	
+		float4 texCoord : TEXCOORD0,
+		
+		uniform float4x4 worldView,
+		uniform float4x4 Proj,
+		uniform float4x4 worldViewProj)
 {
- VS_OUT Out;
- Out.texCoord.xy = texCoord; 
- Out.texCoord.zw = (texCoord * 2.0) - 1.0; 
+	VS_OUT OUT;
+  
+	float2 offset = texCoord.zw;
+	float4 cPosition;   
+	cPosition = mul(worldView, position);
+	OUT.center = cPosition;	
+	cPosition.xy += offset;				
+	OUT.cPosition = cPosition;
+	OUT.r = abs(texCoord.z);		
  
- float2 offset = texCoord.zw;
- float4 cPosition = mul(worldView, mPosition);
- cPosition.xy += offset;
-   
- Out.hPosition = mul( Proj, cPosition );
- Out.cPosition = cPosition;
- Out.radius = abs(offset.x);
- 
-  return OUT;
+    OUT.hPosition = mul( Proj, cPosition );
+     
+    OUT.texCoord = texCoord.xy;    
+	return OUT;
+} 
+
+
+float4 HPS_Smoke_S_PS(VS_OUT IN,
+						uniform float4x4 Proj,
+						uniform sampler2D Texture	) : COLOR
+{
+	float4 Color = 0;
+	float f = 0;
+	float b = 1;
+	float alpha = 0;
+		
+	float d = length( IN.cPosition.xyz - IN.center.xyz);
+	
+	if( d < IN.r )
+	{	 
+	 float w = sqrt( IN.r * IN.r - d * d );
+	 float4 fPosition = IN.cPosition;
+	 float4 bPosition = IN.cPosition;
+	 fPosition.z -= w;
+	 bPosition.z += w;
+	 fPosition = mul(Proj, fPosition);
+	 bPosition = mul(Proj, bPosition);
+	 f = (fPosition.z / fPosition.w + 1.0) / 2.0;
+	 b = (bPosition.z / bPosition.w + 1.0) / 2.0;
+	 alpha = w / IN.r;	
+	}
+	else
+	 discard;
+	
+	Color.r = f;
+	Color.g = 1 - b;
+	Color.a = alpha;
+	
+	
+	return Color; 
 }
-
-float4 FP(VS_OUT In,
-		  uniform float4x4 Proj,
-		  uniform sampler2D Texture):COLOR
-{
-	float4 color = 1;
-	float front = 0;
-	float back = 1;
-	
-	float4 tex = tex2D(Texture, In.texCoord.xy);
-	float d = length(In.TexCoord.zw);
-	float w = sqrt(In.radius * In.radius - d * d);
-	if(d < r)
-	{
-		float4 positionF; float4 positionB;
-		positionF = positionB = In.cPosition;
-		positionF.z -= w;
-		positionB.z += w;
-		positionF = mul(Proj, positionF);
-		positionB = mul(Proj, positionB);
-		positionF = (positionF / positionF.w + 1.0) / 2.0;
-		positionB = (positionB / positionB.w + 1.0) / 2.0;
-	}
-	color.rgb = positionF.z;
-	
-	return color;
-}
Index: /GTP/trunk/App/Demos/Illum/Ogre/Media/particle/GameTools.particle
===================================================================
--- /GTP/trunk/App/Demos/Illum/Ogre/Media/particle/GameTools.particle	(revision 1336)
+++ /GTP/trunk/App/Demos/Illum/Ogre/Media/particle/GameTools.particle	(revision 1339)
@@ -1,7 +1,7 @@
 GameTools/DemoParticle1
 {
-	//renderer sprite
-	//material        GameTools/SpriteShader
-	material		GameTools/HPS
+	renderer sprite
+	material        GameTools/SBB
+	//material		GameTools/HPS
     particle_width  200
     particle_height 200
@@ -44,5 +44,6 @@
 GameTools/Big
 {
-	material		GameTools/HPS
+	//material		GameTools/HPS
+	material		HPS_SMOKE_L
 	//material		Flare
     particle_width  200
@@ -87,5 +88,7 @@
 GameTools/Little
 {
-	material        Flare
+	//material        Flare
+	material        HPS_SMOKE_S
+	renderer sprite
     particle_width  20
     particle_height 20
