//center enviroment around camera and pass the enviroment direction
Out.pos = mul( float4( Pos.xyz + view_position, 1) , view_proj_matrix);
Out.dir = Pos.xyz;
// animate texture coordinate of the wood texture over the teapot
Output.TexCoord0 = Input.TexCoord0 + time_0_1 * 50;
// sample and output the enviroment map color return texCUBE(EnviromentTexture, dir);
float2 offset = tex3D(DistortionMapTexture,
float3(4* texCoord.x, 4* texCoord.y+8*time_0_1, time_0_1)).xy;
offset = ((offset*2.0)-1.0)*OffsetScale;
// Fetch render target with the texture offset applied
float fade = pow(dot(texCoord2, texCoord2), particleShape);
return float4(tex2D(finalResultTexture, texCoord.xy+offset).xyz,(1 - fade));
// fetch color from first render target texture
float4 col1 = tex2D(TempBlurTexture, texCoord);
// fetch color from second render target texture
float4 col2 = tex2D(finalResultTexture, texCoord);
// interpolate between the two colors from the two render targets
return lerp( col1, col2, blur_factor);
// simply outpting the pos without transforming it
Output.Pos = float4( inPos.xy, 0, 1 );
// Texture coordinate are setup so that the full texture
// is mapped completely into screen
Output.TexCoord.x = 0.5 * ( 1 + inPos.x - viewport_inverse_width);
Output.TexCoord.y = 0.5 * ( 1 - inPos.y - viewport_inverse_height);