#include "common.h" #include "anomaly_shaders.h" #include "night_vision.h" ////////////////////////////////////////////////////////////////////////////////////////// #ifndef USE_MSAA Texture2D s_distort; #define EPSDEPTH 0.001 #else #ifndef SM_5 Texture2DMS s_distort; #else Texture2DMS s_distort; #endif #define EPSDEPTH 0.001 #endif ////////////////////////////////////////////////////////////////////////////////////////// float4 e_barrier; // x=norm(.8f), y=depth(.1f), z=clr float4 e_weights; // x=norm, y=depth, z=clr float4 e_kernel; // x=norm, y=depth, z=clr ////////////////////////////////////////////////////////////////////////////////////////// #include "mblur.h" #include "img_corrections.h" #include "tonemapping.h" ////////////////////////////////////////////////////////////////////////////////////////// // Pixel struct c2_out { float4 Color : SV_Target; #ifdef USE_MSAA float Depth : SV_Depth; #endif }; c2_out main( v2p_aa_AA I ) { c2_out res; res.Color = float4(0,0,0,0); int iSample = 0; gbuffer_data gbd = gbuffer_load_data(I.Tex0, I.HPos, iSample ); float depth = gbd.P.z; #ifdef USE_DISTORT #ifndef USE_MSAA float4 distort = s_distort.Sample(smp_nofilter, I.Tex0); #else // USE_MSAA float4 distort = s_distort.Load( int3( I.Tex0 * screen_res.xy, 0 ), iSample ); #endif // USE_MSAA float2 offset = (distort.xy-(127.0h/255.0h))*def_distort; // fix newtral offset float2 center = I.Tex0 + offset; gbuffer_data gbdx = gbuffer_load_data_offset(I.Tex0, center, I.HPos, iSample); float depth_x = gbdx.P.z; if ((depth_x+EPSDEPTH)