Index: /data/branches/environment/materials/Godrays.material
===================================================================
--- /data/branches/environment/materials/Godrays.material	(revision 8346)
+++ /data/branches/environment/materials/Godrays.material	(revision 8346)
@@ -0,0 +1,58 @@
+/**
+*
+* \author Markus Wegmann
+*
+**/
+
+
+material Godrays/Raw/Sun // Renders the sun as a single colored sphere. Z-buffering is enabled.
+{
+    technique
+    {
+        pass
+        {
+            ambient 1.0 1.0 1.0 1.0
+            lightning off
+        }
+    }
+}
+
+material Godrays/Raw/Obstacle // Renders the sun as a single colored sphere. Z-buffering is enabled.
+{
+    technique
+    {
+        pass
+        {
+            ambient 0.0 0.0 0.0 1.0
+            lightning off
+        }
+    }
+}
+
+
+fragment_program GodrayBlurFragmentProgram cg
+{
+    source Godrays_blur.cg
+    entry_point godray_blur
+    profiles ps_3_0 fp40
+}
+
+
+material Godrays/Blur/RadialBlur
+{
+    technique
+    {
+        
+        pass
+        {
+            fragment_program_ref GodrayBlurFragmentProgram
+            { 
+                param_indexed 0 float2 0.0 0.0
+                param_indexed 1 float 1.0
+                param_indexed 2 float 0.1
+                param_indexed 3 float 0.7
+                // The raw decal has to be loaded manually by api.
+            }
+        }
+    }
+}
Index: /data/branches/environment/programs/Godrays_blur.cg
===================================================================
--- /data/branches/environment/programs/Godrays_blur.cg	(revision 8345)
+++ /data/branches/environment/programs/Godrays_blur.cg	(revision 8346)
@@ -1,7 +1,7 @@
 /**
 *
-* @brief Godrays_*.cg is a radial blur based shader implementation of the natural effects of godrays (ray light scattering).
+* \brief Godrays_*.cg is a radial blur based shader implementation of the natural effects of godrays (ray light scattering). The vertex function ScreenQuadVS() skips the default wvp-transform, that is irrelevant for screenspace effects.
 *
-* @author Markus Wegmann
+* \author Markus Wegmann
 *
 **/
@@ -25,32 +25,12 @@
 }
 
-OneTexelVertex ScreenQuadVSWithLightPosition(
-		float3 Position : POSITION, 
-		float2 UV	: TEXCOORD0,
-		
-		uniform float4x4 viewProj,
-		uniform float4 sunLightPosition,
-		
-		out float2 projSunLightPosition : TEXCOORD1
-) {
-    OneTexelVertex OUT = (OneTexelVertex)0;
-    OUT.Position = float4(Position, 1);
-    OUT.UV = float2(UV.xy);
-	
-	projSunLightPosition = (mul(viewProj, float4(0,0,0,1))).xy;
-	projSunLightPosition = float2(0.5, 0.5) + projSunLightPosition / 35;
-	
-    return OUT;
-}
-
 //// Fragment Shader ////
 
 void godray_blur(
         OneTexelVertex IN,
-
-		float2 projSunLightPosition : TEXCOORD1,
 		
         out float4 oColor: COLOR,
         
+        uniform float2 projSunLightPosition,
         uniform float exposure, 
         uniform float decay,
@@ -59,5 +39,5 @@
 
 {
-	const int NUM_SAMPLES = 36;
+	const int NUM_SAMPLES = 35;
 	
 	float2 texCoord = IN.UV;
@@ -113,8 +93,8 @@
 > = 0.8;
 
-float4 SunLightPosition : Position <
+float2 ProjSunLightPosition : Position <
     string UIName =  "Sun Light Position";
     string Space = "World";
-> = {0, 0, 0, 1};
+> = {0, 0};
 
 float4 SkyColor <
@@ -181,9 +161,4 @@
     string UIWidget = "None";
 > = 1.0;
-
-float2 ViewportSize : VIEWPORTPIXELSIZE <
-    string UIName="Screen Size";
-    string UIWidget="None";
->;
 
 technique Main <
@@ -212,6 +187,7 @@
 		BlendEnable = false;
 		
-		VertexShader = compile vp40 ScreenQuadVSWithLightPosition(VpXf, SunLightPosition);
+		VertexShader = compile vp40 ScreenQuadVS();
     	FragmentProgram = compile fp40 godray_blur(
+            ProjSunLightPosition,
 			GodrayExposure, 
 			GodrayDecay, 
Index: /data/branches/environment/programs/Godrays_raw.cg
===================================================================
--- /data/branches/environment/programs/Godrays_raw.cg	(revision 8345)
+++ /data/branches/environment/programs/Godrays_raw.cg	(revision 8346)
@@ -1,9 +1,9 @@
 /**
 *
-* @brief
+* \brief
 * Godrays_*.cg is a radial blur based shader implementation of the natural effects of godrays (ray light scattering).
-* Godrays_raw.cg includes the shader programs for the preparating step.
+* Godrays_raw.cg includes the shader programs for the preparating step. Is only of representative use.
 *
-* @author Markus Wegmann
+* \author Markus Wegmann
 *
 **/
