Skip to content

Commit

Permalink
着色器:将剩余AMD族转换为RT变体
Browse files Browse the repository at this point in the history
移除 AMD_CAS_RT 的预缩放限制;
`lite` 变体没有明显优势,已移除;
`RCAS` 变体由FSR简单裁切得来;
`EASU_chroma` 的原始变体由 deus0ww 裁切。
  • Loading branch information
hooke007 committed Jan 20, 2025
1 parent 3736f96 commit 2fee5ee
Show file tree
Hide file tree
Showing 10 changed files with 860 additions and 367 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,54 @@
// scaled you should probably use CAS-scaled.glsl instead. However this behavior can be overriden by changing the WHEN
// directives with "OUTPUT.w OUTPUT.h * LUMA.w LUMA.h * / 1.0 < !" which allows it to be used as a pre-upscale sharpener.

//!PARAM TRC
//!TYPE int
//!MINIMUM 0
//!MAXIMUM 6
4

//!PARAM GAMMA
//!TYPE float
//!MINIMUM 0.0
2.2

//!PARAM SHARP
//!TYPE float
//!MINIMUM 0.0
//!MAXIMUM 1.0
0.0

//!PARAM SLOW
//!TYPE int
//!MINIMUM 0
//!MAXIMUM 1
1

//!PARAM SLOW2
//!TYPE int
//!MINIMUM 0
//!MAXIMUM 1
0

//!PARAM TRC2
//!TYPE int
//!MINIMUM 0
//!MAXIMUM 6
4

//!PARAM GAMMA2
//!TYPE float
//!MINIMUM 0.0
2.2

//!HOOK LUMA
//!BIND HOOKED
//!DESC [AMD_CAS] FidelityFX Sharpening (Relinearization)
//!WHEN OUTPUT.w OUTPUT.h * LUMA.w LUMA.h * / 1.0 > ! OUTPUT.w OUTPUT.h * LUMA.w LUMA.h * / 1.0 < ! *
//!DESC [AMD_CAS_RT] FidelityFX Sharpening (Relinearization)

// User variables - Relinearization
// Compatibility
#define SOURCE_TRC 4 // Is needed to convert from source colorspace to linear light. 0 = None (Skip conversion), 1 = Rec709, 2 = PQ, 3 = sRGB, 4 = BT.1886, 5 = HLG, 6 = Custom
#define CUSTOM_GAMMA 2.2 // Custom power gamma curve to use if and when SOURCE_TRC is 6.
#define SOURCE_TRC TRC // Is needed to convert from source colorspace to linear light. 0 = None (Skip conversion), 1 = Rec709, 2 = PQ, 3 = sRGB, 4 = BT.1886, 5 = HLG, 6 = Custom
#define CUSTOM_GAMMA GAMMA // Custom power gamma curve to use if and when SOURCE_TRC is 6.

// Shader code

Expand Down Expand Up @@ -99,20 +138,19 @@ vec4 hook() {

//!HOOK LUMA
//!BIND HOOKED
//!DESC [AMD_CAS] FidelityFX Sharpening
//!WHEN OUTPUT.w OUTPUT.h * LUMA.w LUMA.h * / 1.0 > ! OUTPUT.w OUTPUT.h * LUMA.w LUMA.h * / 1.0 < ! *
//!DESC [AMD_CAS_RT] FidelityFX Sharpening

// User variables
// Intensity
#define SHARPENING 0.0 // Adjusts the range the shader adapts to high contrast (0 is not all the way off). Higher values = more high contrast sharpening. 0.0 to 1.0.
#define SHARPENING SHARP // Adjusts the range the shader adapts to high contrast (0 is not all the way off). Higher values = more high contrast sharpening. 0.0 to 1.0.

// Performance
#define CAS_BETTER_DIAGONALS 1 // If set to 0, drops certain math and texture lookup operations for better performance. 0 or 1.
#define CAS_GO_SLOWER 0 // If set to 1, disables the use of optimized approximate transcendental functions which might slightly increase accuracy in exchange of performance. 0 or 1.
#define CAS_BETTER_DIAGONALS SLOW // If set to 0, drops certain math and texture lookup operations for better performance. 0 or 1.
#define CAS_GO_SLOWER SLOW2 // If set to 1, disables the use of optimized approximate transcendental functions which might slightly increase accuracy in exchange of performance. 0 or 1.

// Compatibility
#define TARGET_TRC 4 // Is needed to convert from source colorspace to target colorspace. 0 = None (Skip conversion), 1 = Rec709, 2 = PQ, 3 = sRGB, 4 = BT.1886, 5 = HLG, 6 = Custom
#define CUSTOM_GAMMA 2.2 // Custom power gamma curve to use if and when TARGET_TRC is 6.
#define TARGET_TRC TRC2 // Is needed to convert from source colorspace to target colorspace. 0 = None (Skip conversion), 1 = Rec709, 2 = PQ, 3 = sRGB, 4 = BT.1886, 5 = HLG, 6 = Custom
#define CUSTOM_GAMMA GAMMA2 // Custom power gamma curve to use if and when TARGET_TRC is 6.

// Shader code

Expand Down Expand Up @@ -267,4 +305,5 @@ vec4 hook()
#endif

return pix;
}
}

154 changes: 0 additions & 154 deletions portable_config/shaders/AMD_CAS_lite2_rgb.glsl

This file was deleted.

85 changes: 0 additions & 85 deletions portable_config/shaders/AMD_CAS_lite_luma.glsl

This file was deleted.

Loading

0 comments on commit 2fee5ee

Please sign in to comment.