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.
Enhanced HDR Features for The Town of Light (#58)
* thetownoflight: rename gamma adjust shader * thetownoflight: move tonemap to colorgrade, add final shaders, add peak and paper whitesliders, add grunge shader * thetownoflight: undo code skip in gamma adjust shader, rename gammaadjust to postprocessandgammaadjust, add links * thetownoflight: fix inaccurate comments * thetownoflight: add more comments
- Loading branch information
Showing
7 changed files
with
460 additions
and
47 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
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); | ||
} |
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
Oops, something went wrong.