Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 2 additions & 82 deletions Shaders/BioShock Series/Luma_SMAA_impl.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -5,86 +5,6 @@

#define SMAA_RT_METRICS float4(LumaSettings.GameSettings.InvOutputRes, LumaSettings.GameSettings.OutputRes)
#define SMAA_PRESET_ULTRA
#define SMAA_PREDICATION 1
#define SMAA_CUSTOM_SL
SamplerState LinearSampler : register(s0);
SamplerState PointSampler : register(s1);
#define SMAATexture2D(tex) Texture2D tex
#define SMAATexturePass2D(tex) tex
#define SMAASampleLevelZero(tex, coord) tex.SampleLevel(LinearSampler, coord, 0)
#define SMAASampleLevelZeroPoint(tex, coord) tex.SampleLevel(PointSampler, coord, 0)
#define SMAASampleLevelZeroOffset(tex, coord, offset) tex.SampleLevel(LinearSampler, coord, 0, offset)
#define SMAASample(tex, coord) tex.Sample(LinearSampler, coord)
#define SMAASamplePoint(tex, coord) tex.Sample(PointSampler, coord)
#define SMAASampleOffset(tex, coord, offset) tex.Sample(LinearSampler, coord, offset)
#define SMAA_FLATTEN [flatten]
#define SMAA_BRANCH [branch]
#define SMAATexture2DMS2(tex) Texture2DMS<float4, 2> tex
#define SMAALoad(tex, pos, sample) tex.Load(pos, sample)
#define SMAA_PREDICATION 1
#define SMAAGather(tex, coord) tex.Gather(LinearSampler, coord, 0)
#include "../Includes/SMAA.hlsl"

Texture2D tex0 : register(t0);
Texture2D tex1 : register(t1);
Texture2D tex2 : register(t2);

void fullscreen_triangle(uint id, out float4 position, out float2 texcoord)
{
texcoord = float2((id << 1) & 2, id & 2);
position = float4(texcoord * float2(2.0, -2.0) + float2(-1.0, 1.0), 0.0, 1.0);
}

// SMAAEdgeDetection
//

void smaa_edge_detection_vs(uint id : SV_VertexID, out float4 position : SV_Position, out float2 texcoord : TEXCOORD0, out float4 offset[3] : TEXCOORD1)
{
fullscreen_triangle(id, position, texcoord);
SMAAEdgeDetectionVS(texcoord, offset);
}

float2 smaa_edge_detection_ps(float4 position : SV_Position, float2 texcoord : TEXCOORD0, float4 offset[3] : TEXCOORD1) : SV_Target
{
// tex0 = colorTexGamma
// tex1 = predicationTex
return SMAAColorEdgeDetectionPS(texcoord, offset, tex0, tex1);
}

//

// SMAABlendingWeightCalculation
//

void smaa_blending_weight_calculation_vs(uint id : SV_VertexID, out float4 position : SV_Position, out float2 texcoord : TEXCOORD0, out float2 pixcoord : TEXCOORD1, out float4 offset[3] : TEXCOORD2)
{
fullscreen_triangle(id, position, texcoord);
SMAABlendingWeightCalculationVS(texcoord, pixcoord, offset);
}

float4 smaa_blending_weight_calculation_ps(float4 position : SV_Position, float2 texcoord : TEXCOORD0, float2 pixcoord : TEXCOORD1, float4 offset[3] : TEXCOORD2) : SV_Target
{
// tex0 = edgesTex
// tex1 = areaTex
// tex2 = searchTex
return SMAABlendingWeightCalculationPS(texcoord, pixcoord, offset, tex0, tex1, tex2, 0);
}

//

// SMAANeighborhoodBlending
//

void smaa_neighborhood_blending_vs(uint id : SV_VertexID, out float4 position : SV_Position, out float2 texcoord : TEXCOORD0, out float4 offset : TEXCOORD1)
{
fullscreen_triangle(id, position, texcoord);
SMAANeighborhoodBlendingVS(texcoord, offset);
}

float4 smaa_neighborhood_blending_ps(float4 position : SV_Position, float2 texcoord : TEXCOORD0, float4 offset : TEXCOORD1) : SV_Target
{
// tex0 = colorTex
// tex1 = blendTex
return SMAANeighborhoodBlendingPS(texcoord, offset, tex0, tex1);
}

//
#include "../Includes/SMAA_Passes.hlsl"
20 changes: 0 additions & 20 deletions Shaders/Borderlands 2 and The Pre-Sequel/Luma_BL2TPS_Sharpen.hlsl

This file was deleted.

76 changes: 9 additions & 67 deletions Shaders/Borderlands 2 and The Pre-Sequel/Luma_SMAA_impl.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -28,78 +28,20 @@ cbuffer SmaaMetricsCB : register(b1)
// half-way point simply means "the extract called this a silhouette". Calibrate its tolerance, not this number.
#define SMAA_PREDICATION_STRENGTH 0.5
#define SMAA_PREDICATION_THRESHOLD 0.5
#define SMAA_CUSTOM_SL
SamplerState LinearSampler : register(s0);
SamplerState PointSampler : register(s1);
#define SMAATexture2D(tex) Texture2D tex
#define SMAATexturePass2D(tex) tex
#define SMAASampleLevelZero(tex, coord) tex.SampleLevel(LinearSampler, coord, 0)
#define SMAASampleLevelZeroPoint(tex, coord) tex.SampleLevel(PointSampler, coord, 0)
#define SMAASampleLevelZeroOffset(tex, coord, offset) tex.SampleLevel(LinearSampler, coord, 0, offset)
#define SMAASample(tex, coord) tex.Sample(LinearSampler, coord)
#define SMAASamplePoint(tex, coord) tex.Sample(PointSampler, coord)
#define SMAASampleOffset(tex, coord, offset) tex.Sample(LinearSampler, coord, offset)
#define SMAA_FLATTEN [flatten]
#define SMAA_BRANCH [branch]
#define SMAATexture2DMS2(tex) Texture2DMS<float4, 2> tex
#define SMAALoad(tex, pos, sample) tex.Load(pos, sample)
#define SMAAGather(tex, coord) tex.Gather(LinearSampler, coord, 0)
#define SMAAGather(tex, coord) tex.Gather(LinearSampler, coord, 0)
// Color.hlsl only for the re-encode helper. Neither it (it includes only Math.hlsl) nor the self-contained SMAA.hlsl
// has a DEVELOPMENT/TEST conditional, so every entry point stays byte-identical across the two define sets.
#include "../Includes/Color.hlsl"
#include "../Includes/SMAA.hlsl"

Texture2D tex0 : register(t0);
Texture2D tex1 : register(t1);
Texture2D tex2 : register(t2);

void fullscreen_triangle(uint id, out float4 position, out float2 texcoord)
{
texcoord = float2((id << 1) & 2, id & 2);
position = float4(texcoord * float2(2.0, -2.0) + float2(-1.0, 1.0), 0.0, 1.0);
}

// SMAAEdgeDetection
void smaa_edge_detection_vs(uint id : SV_VertexID, out float4 position : SV_Position, out float2 texcoord : TEXCOORD0, out float4 offset[3] : TEXCOORD1)
{
fullscreen_triangle(id, position, texcoord);
SMAAEdgeDetectionVS(texcoord, offset);
}

float2 smaa_edge_detection_ps(float4 position : SV_Position, float2 texcoord : TEXCOORD0, float4 offset[3] : TEXCOORD1) : SV_Target
{
// tex0 = colorTexGamma (the gamma-encoded LDR snapshot)
// tex1 = predicationTex (plane-deviation edge-ness; null fallback -> reads 0, scale 1.0 = plain ULTRA threshold)
return SMAAColorEdgeDetectionPS(texcoord, offset, tex0, tex1);
}

// SMAABlendingWeightCalculation
void smaa_blending_weight_calculation_vs(uint id : SV_VertexID, out float4 position : SV_Position, out float2 texcoord : TEXCOORD0, out float2 pixcoord : TEXCOORD1, out float4 offset[3] : TEXCOORD2)
{
fullscreen_triangle(id, position, texcoord);
SMAABlendingWeightCalculationVS(texcoord, pixcoord, offset);
}

float4 smaa_blending_weight_calculation_ps(float4 position : SV_Position, float2 texcoord : TEXCOORD0, float2 pixcoord : TEXCOORD1, float4 offset[3] : TEXCOORD2) : SV_Target
{
// tex0 = edgesTex, tex1 = areaTex, tex2 = searchTex
return SMAABlendingWeightCalculationPS(texcoord, pixcoord, offset, tex0, tex1, tex2, 0);
}
// tex0 = colorTexGamma (the gamma-encoded LDR snapshot)
// tex1 = predicationTex (plane-deviation edge-ness; null fallback -> reads 0, scale 1.0 = plain ULTRA threshold)

// SMAANeighborhoodBlending
void smaa_neighborhood_blending_vs(uint id : SV_VertexID, out float4 position : SV_Position, out float2 texcoord : TEXCOORD0, out float4 offset : TEXCOORD1)
{
fullscreen_triangle(id, position, texcoord);
SMAANeighborhoodBlendingVS(texcoord, offset);
}
// tex0 = colorTex, the LINEAR decode of the LDR (Luma_BL2TPS_SMAALinearize says why); tex1 = blendTex. Re-encode
// with the tonemap's own linear_to_gamma, so both sides move together if DefaultGamma ever does; GCT_MIRROR brings
// the dither's negative half at black back out unclamped. One encode only: the RTV is never an SRGB view. Alpha
// is left as the blend produced it (the tonemap writes o0.w = 0). No HDR tail.
#define SMAA_NEIGHBORHOOD_OUTPUT(color, position) color.rgb = linear_to_gamma(color.rgb, GCT_MIRROR);

float4 smaa_neighborhood_blending_ps(float4 position : SV_Position, float2 texcoord : TEXCOORD0, float4 offset : TEXCOORD1) : SV_Target
{
// tex0 = colorTex, the LINEAR decode of the LDR (Luma_BL2TPS_SMAALinearize says why); tex1 = blendTex. Re-encode
// with the tonemap's own linear_to_gamma, so both sides move together if DefaultGamma ever does; GCT_MIRROR brings
// the dither's negative half at black back out unclamped. One encode only: the RTV is never an SRGB view. Alpha
// is left as the blend produced it (the tonemap writes o0.w = 0). No HDR tail.
float4 color = SMAANeighborhoodBlendingPS(texcoord, offset, tex0, tex1);
color.rgb = linear_to_gamma(color.rgb, GCT_MIRROR);
return color;
}
#include "../Includes/SMAA_Passes.hlsl"
20 changes: 0 additions & 20 deletions Shaders/Borderlands GOTY Enhanced/Luma_BL_Sharpen.hlsl

This file was deleted.

2 changes: 1 addition & 1 deletion Shaders/Borderlands GOTY Enhanced/Luma_BL_Tonemap.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#include "../Includes/ColorGradingLUT.hlsl" // SimpleGamutClip
#include "../Includes/DICE.hlsl" // DICETonemap / DefaultDICESettings
#include "../Includes/Reinhard.hlsl" // Reinhard::ReinhardPiecewise: soft hue reference
#include "Includes/MacLeodBoynton.hlsl" // MacLeodBoynton::HueOnlyBT2020 (RenoDX-derived hue/purity model)
#include "../Includes/MacLeodBoynton.hlsl" // MacLeodBoynton::HueOnlyBT2020 (RenoDX-derived hue/purity model)
// clang-format on

// HDR / vanilla. 1 = extended UE3 grade + DICE display map (default). 0 = vanilla clamped SDR reference.
Expand Down
Loading
Loading