texture Shader0Tex < bool hidden = true; string NTM = "shader"; int NTMIndex = 0; >; sampler2D Shader0Sampler = sampler_state { Texture = ; MinFilter = Point; MagFilter = Point; MipFilter = None; AddressU = Clamp; AddressV = Clamp; }; texture Shader1Tex < bool hidden = true; string NTM = "shader"; int NTMIndex = 1; >; sampler2D Shader1Sampler = sampler_state { Texture = ; MinFilter = Point; MagFilter = Point; MipFilter = None; AddressU = Clamp; AddressV = Clamp; }; texture Shader2Tex < bool hidden = true; string NTM = "shader"; int NTMIndex = 2; >; sampler2D Shader2Sampler = sampler_state { Texture = ; MinFilter = Point; MagFilter = Point; MipFilter = None; AddressU = Clamp; AddressV = Clamp; }; texture Shader3Tex < bool hidden = true; string NTM = "shader"; int NTMIndex = 3; >; sampler2D Shader3Sampler = sampler_state { Texture = ; MinFilter = Point; MagFilter = Point; MipFilter = None; AddressU = Clamp; AddressV = Clamp; }; float4x4 matModelToProj : WORLDVIEWPROJ; float4x4 matView : VIEW; void VS(float4 in_position : POSITION, float2 in_uv : TEXCOORD0, out float4 out_position : POSITION, out float2 out_uv : TEXCOORD0, out float3 out_eye : TEXCOORD1 ) { out_position = mul(in_position, matModelToProj); float3 temp = in_position*2.0-1.0; temp.z = -1.0; out_eye = normalize((float3(temp.x, temp.y, -temp.z))); out_uv = in_uv; } float4 PS(float2 in_uv : TEXCOORD0, out float4 out_mrt : COLOR1) : COLOR0 { out_mrt = tex2D(Shader1Sampler, in_uv); return tex2D(Shader0Sampler, in_uv); } technique PassThrough < bool UsesNiRenderState = true; bool UsesNiLightState = false; > { pass P0 { VertexShader = compile vs_2_0 VS(); PixelShader = compile ps_2_0 PS(); } } float4 PT_ALL_PS(float2 in_uv : TEXCOORD0, float3 in_eye : TEXCOORD1, out float4 out_mrt : COLOR1) : COLOR0 { float4 pos_depth = tex2D(Shader1Sampler, in_uv); out_mrt = pos_depth; float4 colorbuffer = tex2D(Shader0Sampler, in_uv); float4 particlebuffer = tex2D(Shader2Sampler, in_uv); //Do alpha blending float4 out_color; /* out_color.r = pos_depth.a / 9000.0f; out_color.g = pos_depth.a / 9000.0f; out_color.b = pos_depth.a / 9000.0f; out_color.a = 1.0f; return out_color; */ out_color.rgb = (particlebuffer.rgb * particlebuffer.a*4.0f)+ (colorbuffer.rgb * (1.0f - particlebuffer.a)) ; out_color.a = saturate ((particlebuffer.a * particlebuffer.a ) + (colorbuffer.rgb * (1.0f - particlebuffer.a))) ; return out_color; } technique PassThroughAll < bool UsesNiRenderState = true; bool UsesNiLightState = false; > { pass P0 { VertexShader = compile vs_2_0 VS(); PixelShader = compile ps_2_0 PT_ALL_PS(); } }