<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -21,7 +21,7 @@ namespace Harmony.Components.Particles
         public RenderTarget2D PositionRenderTarget;
         public RenderTarget2D VelocityRenderTarget;
         public RenderTarget2D ColorRenderTarget;
-        public RenderTarget2D AgeRenderTarget;
+        public RenderTarget2D LifeRenderTarget;
         public RenderTarget2D TemporaryRenderTarget;
         public DepthStencilBuffer DepthStencilBuffer;
         public VertexBuffer ParticlesVertexBuffer;
@@ -62,7 +62,7 @@ namespace Harmony.Components.Particles
             TemporaryRenderTarget = new RenderTarget2D(graphics.GraphicsDevice,  Budget, Budget, 1, SurfaceFormat.Vector4, MultiSampleType.None, 0);
             PositionRenderTarget = new RenderTarget2D(graphics.GraphicsDevice,   Budget, Budget, 1, SurfaceFormat.Vector4, MultiSampleType.None, 0);
             VelocityRenderTarget = new RenderTarget2D(graphics.GraphicsDevice,   Budget, Budget, 1, SurfaceFormat.Vector4, MultiSampleType.None, 0);
-            AgeRenderTarget = new RenderTarget2D(graphics.GraphicsDevice, Budget, Budget, 1, SurfaceFormat.Vector4, MultiSampleType.None, 0);
+            LifeRenderTarget = new RenderTarget2D(graphics.GraphicsDevice, Budget, Budget, 1, SurfaceFormat.Vector4, MultiSampleType.None, 0);
             ColorRenderTarget = new RenderTarget2D(graphics.GraphicsDevice, Budget, Budget, 1, SurfaceFormat.Vector4, MultiSampleType.None, 0);
 
             DepthStencilBuffer = new DepthStencilBuffer(graphics.GraphicsDevice, Budget, Budget, graphics.GraphicsDevice.DepthStencilBuffer.Format);
@@ -158,7 +158,7 @@ namespace Harmony.Components.Particles
             {
                 PhysicsShader.Data.Parameters[&quot;PositionMap&quot;].SetValue(PositionRenderTarget.GetTexture());
                 PhysicsShader.Data.Parameters[&quot;VelocityMap&quot;].SetValue(VelocityRenderTarget.GetTexture());
-                PhysicsShader.Data.Parameters[&quot;LifeMap&quot;].SetValue(AgeRenderTarget.GetTexture());
+                PhysicsShader.Data.Parameters[&quot;LifeMap&quot;].SetValue(LifeRenderTarget.GetTexture());
                 PhysicsShader.Data.Parameters[&quot;ColorMap&quot;].SetValue(ColorRenderTarget.GetTexture());
             }
 
@@ -193,16 +193,16 @@ namespace Harmony.Components.Particles
 
         private void SimulateParticles(GameTime gameTime)
         {
-            var random = new Random();
+            var rand = new Random();
 
-            PhysicsShader.Data.Parameters[&quot;Random&quot;].SetValue((float) random.NextDouble());
+            PhysicsShader.Data.Parameters[&quot;Random&quot;].SetValue((float) rand.NextDouble());
 
             var time = (float) gameTime.TotalGameTime.TotalSeconds;
             PhysicsShader.Data.Parameters[&quot;Time&quot;].SetValue(time);
             PhysicsShader.Data.Parameters[&quot;TimeDelta&quot;].SetValue((float)gameTime.ElapsedGameTime.TotalSeconds);
             //physicsEffect.Parameters[&quot;displacementMap&quot;].SetValue(morphRenderTarget.GetTexture());
 
-            Wind += new Vector4((float)random.NextDouble() - 0.5f, (float)random.NextDouble() - 0.5f, (float)random.NextDouble() - 0.5f, 0);
+            Wind += new Vector4((float)rand.NextDouble() - 0.5f, (float)rand.NextDouble() - 0.5f, (float)rand.NextDouble() - 0.5f, 0);
             Vector4 windUnit = Wind;
             windUnit.Normalize();
             if (Wind.Length() &gt; 10.0f)
@@ -219,13 +219,13 @@ namespace Harmony.Components.Particles
 
             if (!Reset)
             {
-                DoPhysicsPass(&quot;ResetLife&quot;, AgeRenderTarget);
+                DoPhysicsPass(&quot;ResetLife&quot;, LifeRenderTarget);
                 DoPhysicsPass(&quot;ResetColor&quot;, ColorRenderTarget);
                 DoPhysicsPass(&quot;ResetVelocity&quot;, VelocityRenderTarget);
                 DoPhysicsPass(&quot;ResetPosition&quot;, PositionRenderTarget);
                 Reset = true;
             }
-            DoPhysicsPass(&quot;UpdateLife&quot;, AgeRenderTarget);
+            DoPhysicsPass(&quot;UpdateLife&quot;, LifeRenderTarget);
             DoPhysicsPass(&quot;UpdateColor&quot;, ColorRenderTarget);
             DoPhysicsPass(&quot;UpdateVelocity&quot;, VelocityRenderTarget);
             DoPhysicsPass(&quot;UpdatePosition&quot;, PositionRenderTarget);
@@ -257,6 +257,7 @@ namespace Harmony.Components.Particles
             ParticleShader.Data.Parameters[&quot;PositionMap&quot;].SetValue(PositionRenderTarget.GetTexture());
             ParticleShader.Data.Parameters[&quot;ColorMap&quot;].SetValue(ColorRenderTarget.GetTexture());
             ParticleShader.Data.Parameters[&quot;VelocityMap&quot;].SetValue(VelocityRenderTarget.GetTexture());
+            ParticleShader.Data.Parameters[&quot;LifeMap&quot;].SetValue(LifeRenderTarget.GetTexture());
 
             var random = new Random();
             ParticleShader.Data.Parameters[&quot;Random&quot;].SetValue((float)random.NextDouble());</diff>
      <filename>Harmony/Components/Particles/ParticleSystem.cs</filename>
    </modified>
    <modified>
      <diff>@@ -51,6 +51,17 @@ sampler VelocitySampler = sampler_state
     AddressV  = Clamp;
 };
 
+texture LifeMap;
+sampler LifeSampler = sampler_state
+{
+    Texture   = &lt;LifeMap&gt;;
+    MipFilter = None;
+    MinFilter = Point;
+    MagFilter = Point;
+    AddressU  = Clamp;
+    AddressV  = Clamp;
+};
+
 struct VS_INPUT {
     float4 VertexData				: POSITION;
     float4 Color				: COLOR0;
@@ -72,6 +83,8 @@ struct VS_INPUT {
 	    float4 ParticleData : TEXCOORD4;
 	    
 	    float Size		:PSIZE0;
+	    
+	    float4 Life : TEXCOORD5;
 	};
 struct PS_INPUT
     {
@@ -85,6 +98,7 @@ struct PS_INPUT
         float4 ParticleColor : TEXCOORD1;
         float4 WorldPosition : TEXCOORD2;
         float4 Velocity : TEXCOORD3;
+        float4 Life : TEXCOORD5;
     };
 
 float ScreenHeight = 600;
@@ -114,6 +128,9 @@ VS_OUTPUT Transform(VS_INPUT In)
     
 	Out.Size = SizeModifier * Projection._m11 / Out.Position.w * ScreenHeight / 2 * 1.0f;
 	
+	//float4 particleColor = tex2D(ColorSampler, float2(In.ParticleData.x, In.ParticleData.y));
+    Out.Life = tex2Dlod(LifeSampler, float4(In.VertexData.x, In.VertexData.y, 0, 0));
+	
     return Out;
 }
 
@@ -122,7 +139,8 @@ float4 ApplyTexture(PS_INPUT In) : COLOR
 //return In.Velocity;
 	// return velocity
     //return (input.Color * 0.25f) + (float4(1, 1, 1, 1) * 0.25f);
-    float4 particleColor = tex2D(ColorSampler, float2(In.ParticleData.x, In.ParticleData.y));
+
+    float age = In.Life.x;
 
 	// wtf?
 	//float2 textureCoordinate;
@@ -135,7 +153,10 @@ float4 ApplyTexture(PS_INPUT In) : COLOR
     // dead code
     //float dist = length(In.WorldPosition);
     
-	float4 textureColor = tex2D(TextureSampler, In.TextureCoordinate) * float4(1,1,1,0.66f);// * particleColor;
+    //float alpha = 1.0f - (age / 20.0f);
+    float4 redVec = float4(1,1,0.5f,1) * (1.0f - (age / 10.0f));
+    float4 blueVec = float4(0.5f,1,1,1) * age / 10.0f;
+	float4 textureColor = tex2D(TextureSampler, In.TextureCoordinate) * redVec;// * blueVec;// * particleColor;
 	return textureColor;
 }
     </diff>
      <filename>Harmony/Content/Shaders/Particle.fx</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>688125dd53ed67b1c87ca670a6baf80461044a3f</id>
    </parent>
  </parents>
  <author>
    <name>pyrotechnick</name>
    <email>pyrotechnick@feistystudios.com</email>
  </author>
  <url>http://github.com/feistystudios/StringTheory/commit/a7fe59bdd8b44dbbba2e3401c1ab9a003902d7a5</url>
  <id>a7fe59bdd8b44dbbba2e3401c1ab9a003902d7a5</id>
  <committed-date>2009-10-19T23:03:58-07:00</committed-date>
  <authored-date>2009-10-19T23:03:58-07:00</authored-date>
  <message>Test</message>
  <tree>3a2cc853f5cf778e43456a509f1753970d87d573</tree>
  <committer>
    <name>pyrotechnick</name>
    <email>pyrotechnick@feistystudios.com</email>
  </committer>
</commit>
