Sincos( 6.28318548*sampleJitter.y, Dir.y, Dir.x) įloat3 fIL = tex2Dlod(SamplerColorBypass, float4(sampleUV, 0,sampleMIP + MXAO_MIPLEVEL_IL)).xyz įloat3 tN = tex2Dlod(SamplerSurfaceNormal, float4(sampleUV, 0,sampleMIP + MXAO_MIPLEVEL_IL)).xyz * 2.0 - 1.0 įIL = fIL - fIL* saturate( dot(V,tN)* rsqrt(VdotV)* 2.0) Ĭolor += float4(fIL*fAO,fAO - fAO * dot(fIL, 0.333)) Ĭolor = saturate(color/(( 1.0-MXAO_SAMPLE_NORMAL_BIAS)*MXAO.samples)) Ĭolor = pow(color, 1.0 / lerp(MXAO_AMOUNT_COARSE, MXAO_AMOUNT_FINE, layerID)) Ĭolor = lerp( tex2D(SamplerSSAOTSS,),color, 0.2) SetupAOParameters(MXAO, P, layerID, scaledRadius, falloffFactor) P += N * P.z / RESHADE_DEPTH_LINEARIZATION_FAR_PLANE Void PS_AmbientObscurance( in MXAO_VSOUT MXAO, out float4 color : SV_Target0)įloat2 sampleJitter = GetSampleJitter( floor(), 4) įloat3 P = GetPositionLOD(, MXAO, 0) įloat3 N = tex2D(SamplerSurfaceNormal, ).xyz * 2.0 - 1.0 įloat layerID = ( + ) % 2.0 If( GetLinearDepth() >= MXAO_FADE_DEPTH_END
Void PS_StencilSetup( in MXAO_VSOUT MXAO, out float4 color : SV_Target0) Normal = float4( normalize( cross(grady1,gradx1)) * 0.5 + 0.5, 0.0) Ĭolor = tex2D(ReShade::BackBuffer, ) ĭepth = GetLinearDepth()*RESHADE_DEPTH_LINEARIZATION_FAR_PLANE Grady1 = lerp(grady1, grady2, abs(grady1.z) > abs(grady2.z)) Int blurqualityTweak = (MXAO_GLOBAL_RENDER_SCALE abs(gradx2.z)) MXAO_VSOUT VS_MXAO( in uint id : SV_VertexID) Uniform float MXAO_FADE_DEPTH_START = 0.2 Uniform bool MXAO_DEBUG_VIEW_ENABLE = false Uniform float MXAO_SAMPLE_RADIUS_SECONDARY = 0.2
Uniform float MXAO_SSIL_SATURATION = 1.00 Uniform float MXAO_GLOBAL_RENDER_SCALE = 1.0 Uniform float MXAO_SAMPLE_NORMAL_BIAS = 0.2 Uniform int MXAO_GLOBAL_SAMPLE_QUALITY_PRESET = 1 #define MXAO_ENABLE_TSS 0 // Combines the current frame AO with older frames to improve quality a LOT, at the expense of some ghosting. #define MXAO_TWO_LAYER 0 // Splits MXAO into two separate layers that allow for both large and fine AO. #define MXAO_SMOOTHNORMALS 0 // This feature makes low poly surfaces smoother, especially useful on older games. #define MXAO_ENABLE_IL 0 //Ğnables Indirect Lighting calculation. 0 = fullscreen, 1 = 1/2 screen width/height, 2 = 1/4 screen width/height and so forth. #define MXAO_MIPLEVEL_IL 2 // Miplevel of IL texture. Best results: IL MipLevel = AO MipLevel + 2
#define MXAO_MIPLEVEL_AO 0 // Miplevel of AO texture. Ambient Obscurance with Indirect Lighting "MXAO" 3.1.0 by Marty McFly visit /MartyMcModding for news/updates