forked from clshortfuse/renodx
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'clshortfuse:main' into main
- Loading branch information
Showing
14 changed files
with
548 additions
and
193 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#include "./DICE.hlsl" | ||
#include "./shared.h" | ||
|
||
float3 applyDICE(float3 untonemapped) { | ||
DICESettings config = DefaultDICESettings(); | ||
config.Type = 3u; | ||
config.ShoulderStart = 0.5f; | ||
|
||
const float paperWhite = injectedData.toneMapGameNits / renodx::color::srgb::REFERENCE_WHITE; | ||
const float peakWhite = injectedData.toneMapPeakNits / renodx::color::srgb::REFERENCE_WHITE; | ||
|
||
return DICETonemap(untonemapped * paperWhite, peakWhite, config) / paperWhite; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
void main(uint id: SV_VERTEXID, out float4 pos: SV_POSITION, out float2 uv: TEXCOORD0) { | ||
uv.x = (id == 1) ? 2.0 : 0.0; | ||
uv.y = (id == 2) ? 2.0 : 0.0; | ||
pos = float4(uv * float2(2.0, -2.0) + float2(-1.0, 1.0), 0.0, 1.0); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#include "./shared.h" | ||
|
||
SamplerState sourceSampler_s : register(s0); | ||
Texture2D<float4> sourceTexture : register(t0); | ||
|
||
void main( | ||
float4 vpos: SV_Position, | ||
float2 texcoord: TEXCOORD, | ||
out float4 output: SV_Target0) { | ||
float4 color = sourceTexture.Sample(sourceSampler_s, texcoord.xy); | ||
|
||
// Linearize with 2.2 Gamma and scale paper white | ||
float3 linearizedColor = renodx::color::gamma::DecodeSafe(color.rgb, 2.2); | ||
linearizedColor *= injectedData.toneMapUINits / renodx::color::srgb::REFERENCE_WHITE; | ||
|
||
output.rgba = float4(linearizedColor, color.a); | ||
} |
Oops, something went wrong.