-
Notifications
You must be signed in to change notification settings - Fork 138
feat: HDR rendering #1692
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
feat: HDR rendering #1692
Changes from all commits
Commits
Show all changes
223 commits
Select commit
Hold shift + click to select a range
a378b5b
working
davo0411 d15f95d
fixes
davo0411 caf60d0
feat: remove tonemappers, upgrade entire pipeline to HDR
davo0411 737228b
fixes
davo0411 db3e990
feat: readd bloom
davo0411 d2301ef
feat: vanilla eye adapt
davo0411 05dbb77
feat: color correction
davo0411 29d8380
feat: HDR dynamic cubemaps
davo0411 14e9428
feat: works lol
davo0411 1186038
WORKING
davo0411 0121fc6
working
davo0411 3aa06fb
removed unnecessary
davo0411 ed67fdd
more removed
davo0411 ab80695
update (#29)
davo0411 c158e48
Merge branch 'hdr-output' of https://github.com/davo0411/skyrim-commu…
davo0411 528a435
fixes, removed more unnecessary
davo0411 016cf68
Update Color.hlsli
davo0411 eb0d42f
changed process
davo0411 c32013c
Merge branch 'dev' into hdr-output
davo0411 6d4ba43
style: 🎨 apply pre-commit.ci formatting
pre-commit-ci[bot] 4d648f8
separate UI working
davo0411 9f2a533
finally everything working together
davo0411 378ec3b
style: 🎨 apply pre-commit.ci formatting
pre-commit-ci[bot] d21a7bf
FG and non-fg working!
davo0411 228c03a
bajillion fixes
davo0411 e3fa950
Merge branch 'hdr-output' of https://github.com/davo0411/skyrim-commu…
davo0411 c7b7aa0
Update HDR.h
davo0411 29cf7fb
style: 🎨 apply pre-commit.ci formatting
pre-commit-ci[bot] bbd3f6b
fixes
davo0411 472947c
Merge branch 'hdr-output' of https://github.com/davo0411/skyrim-commu…
davo0411 ae91241
Update HDRDisplay.h
davo0411 8dc2aa5
style: 🎨 apply pre-commit.ci formatting
pre-commit-ci[bot] 578eaf0
cleaner menu
davo0411 7d9cdc0
Merge branch 'hdr-output' of https://github.com/davo0411/skyrim-commu…
davo0411 2f3c3fb
style: 🎨 apply pre-commit.ci formatting
pre-commit-ci[bot] 07744cc
ctd fix
davo0411 eb0820d
Merge branch 'doodlum:dev' into hdr-output
davo0411 6bda853
fixes
davo0411 1b51024
bajillion fixes
davo0411 6033647
fixed tonemapping
davo0411 2d09488
FG fixed.
davo0411 3668245
real this time
davo0411 578f0e4
fg ui properly fixed
davo0411 1e0984f
Fixed UI alpha
davo0411 374e244
ll fixes
davo0411 9a824e4
new metadata
davo0411 5c29216
fixes
davo0411 6349be4
Fixed hdr outputting
davo0411 79ee285
Delete reinhard.hlsl
davo0411 9a59bc7
Merge branch 'dev' into hdr-output
davo0411 d96759d
style: 🎨 apply pre-commit.ci formatting
pre-commit-ci[bot] ba82b41
feat: enable HDR warning, auto enable
davo0411 14ee19a
Merge branch 'hdr-output' of https://github.com/davo0411/skyrim-commu…
davo0411 8740855
style: 🎨 apply pre-commit.ci formatting
pre-commit-ci[bot] f7841f0
fixes, final test
davo0411 5f72b4f
style: 🎨 apply pre-commit.ci formatting
pre-commit-ci[bot] 5fc846b
flicker fix attempt again
davo0411 b95419d
New display mapping DICE, fixed UI flicker
davo0411 82736a2
Merge branch 'hdr-output' of https://github.com/davo0411/skyrim-commu…
davo0411 2f6c2d3
fixes, upgraded buffers, etc
davo0411 9701cde
Merge branch 'dev' into hdr-output
davo0411 8f7d8d3
style: 🎨 apply pre-commit.ci formatting
pre-commit-ci[bot] 5f35e1a
tonemapping changes, ui changes
davo0411 c389a2e
Merge branch 'hdr-output' of https://github.com/davo0411/skyrim-commu…
davo0411 d375dcb
style: 🎨 apply pre-commit.ci formatting
pre-commit-ci[bot] 93e9c1c
working again
davo0411 454e297
removed dice
davo0411 05d2a88
a lot of tweaks
davo0411 377e9ab
unclamped paperwhite
davo0411 f9f862c
bloom clamp, peaknit fix
davo0411 020aa2d
Update ISHDR.hlsl
davo0411 f48fa06
Merge branch 'hdr-output' of https://github.com/davo0411/skyrim-commu…
davo0411 63e9a80
style: 🎨 apply pre-commit.ci formatting
pre-commit-ci[bot] 12195cb
information update
davo0411 bcc6dec
linear contrast fix
davo0411 695165d
reordered
davo0411 3db3e3c
Update HDRDisplay.h
davo0411 185dd79
fixed my broken fg
davo0411 ccfd61b
looking good. everything working.
davo0411 9f1bb19
LL fix up
davo0411 5cd5e1e
color grading fixes
davo0411 63f3878
math and comment clean
davo0411 2dea270
rabbit fixes 1
davo0411 b062ad3
Update Lighting.hlsl
davo0411 fd623b8
rabbit cpp 1
davo0411 7798095
mutex lock suggested by rabbit. nuked sdr brightness ui slider
davo0411 5e1d187
bajillion rabbit crap
davo0411 19998bd
misc fixes
davo0411 d838f46
Update HDROutputCS.hlsl
davo0411 5fc49cd
Update UIBrightnessCS.hlsl
davo0411 3046dc2
Merge branch 'dev' into hdr-output
davo0411 0967a16
style: 🎨 apply pre-commit.ci formatting
pre-commit-ci[bot] c2f5087
Merge branch 'dev' into hdr-output
davo0411 46cac80
style: 🎨 apply pre-commit.ci formatting
pre-commit-ci[bot] 8ba051a
Update HDR.cpp
davo0411 5fca3da
cleanup comments / code, fix non-fg case
davo0411 6947f2c
background blur fix for hdr
davo0411 b9a8c18
more alpha fixes, background blur fix
davo0411 2f60b6c
Update Deferred.cpp
davo0411 db85084
doodlum comment 1
davo0411 a7728bc
Merge branch 'dev' into hdr-output
davo0411 5a9cd92
fix: conditional HDR upgrade for swapchain
davo0411 5e7009f
Merge branch 'hdr-output' of https://github.com/davo0411/skyrim-commu…
davo0411 588f360
Update DynamicCubemaps.cpp
davo0411 9d396bc
refactored setuibuffer
davo0411 f798bd4
Update Upscaling.cpp
davo0411 6395f0b
parameter cleanup
davo0411 c8adc0d
ini instead of hook for 64 bit
davo0411 0c3404a
style: 🎨 apply pre-commit.ci formatting
pre-commit-ci[bot] ef7fa09
cleanup
davo0411 71db4d6
Merge branch 'hdr-output' of https://github.com/davo0411/skyrim-commu…
davo0411 e973b21
force off with TAA
davo0411 a02bdfa
Merge branch 'doodlum:dev' into hdr-output
davo0411 5baefe0
Update HDR.cpp
davo0411 11e9ed9
TAA Fix comprehensive
davo0411 97476ad
style: 🎨 apply pre-commit.ci formatting
pre-commit-ci[bot] 7b4612d
loading screen fix yiupppeeee
davo0411 36a9791
Merge branch 'hdr-output' of https://github.com/davo0411/skyrim-commu…
davo0411 e2b3f58
style: 🎨 apply pre-commit.ci formatting
pre-commit-ci[bot] 5f4f3ec
Update ISHDR.hlsl
davo0411 d1810b8
Merge branch 'hdr-output' of https://github.com/davo0411/skyrim-commu…
davo0411 7e5f9b1
hdr rewrite into hdrdisplay, hook cleanup
davo0411 1ec7ecc
more fixes
davo0411 83d38e8
ui blend fix
davo0411 37c87b7
style: 🎨 apply pre-commit.ci formatting
pre-commit-ci[bot] 6cbaa84
Merge branch 'dev' into hdr-output
davo0411 69a4b06
Update ISHDR.hlsl
davo0411 43d807a
fix
davo0411 f3d0b78
Update ISHDR.hlsl
davo0411 31f7972
Update ISHDR.hlsl
davo0411 c9ab362
Update ISHDR.hlsl
davo0411 b83ac14
Fix: UI elements not rendering correctly
davo0411 c3fc49b
Merge branch 'dev' into hdr-output
davo0411 f3112c0
bloom fix
davo0411 fa0eaec
Update ISHDR.hlsl
davo0411 8c7a801
fixes
davo0411 c1ffe85
1
davo0411 1074d86
2
davo0411 704b4ee
3
davo0411 fed1193
style: 🎨 apply pre-commit.ci formatting
pre-commit-ci[bot] 7da31c2
Update ISHDR.hlsl
davo0411 8a6fd8f
Merge branch 'hdr-output' of https://github.com/davo0411/skyrim-commu…
davo0411 fc9fbee
HDR SUN
davo0411 29a201e
UI brightness fix
davo0411 3453e49
style: 🎨 apply pre-commit.ci formatting
pre-commit-ci[bot] 99d658d
Merge branch 'dev' into hdr-output
davo0411 0afbf5a
tonemapping changes
davo0411 0a45d75
tonemapping changes 2
davo0411 b1709f4
main menu brightness fix
davo0411 6d9fcb0
Update ISHDR.hlsl
davo0411 e7b69a5
Update Sky.hlsl
davo0411 2d91811
Update Sky.hlsl
davo0411 cbe8698
Update ISHDR.hlsl
davo0411 2692193
style: 🎨 apply pre-commit.ci formatting
pre-commit-ci[bot] a1b1490
Update Sky.hlsl
davo0411 5aa7d8a
Merge branch 'hdr-output' of https://github.com/davo0411/skyrim-commu…
davo0411 c46b095
style: 🎨 apply pre-commit.ci formatting
pre-commit-ci[bot] 196718d
proc sun v1
davo0411 080a17e
fix dev
davo0411 e6f16d9
Update Sky.hlsl
davo0411 42a13a3
Update Sky.hlsl
davo0411 0cdce8a
Merge branch 'dev' into hdr-output
davo0411 23a485c
more sun tweaks
davo0411 fb1732c
Merge branch 'hdr-output' of https://github.com/davo0411/skyrim-commu…
davo0411 d59668a
style: 🎨 apply pre-commit.ci formatting
pre-commit-ci[bot] 998f24f
Update Sky.hlsl
davo0411 273fd39
Merge branch 'hdr-output' of https://github.com/davo0411/skyrim-commu…
davo0411 25c906f
more sun fixes
davo0411 02daa14
style: 🎨 apply pre-commit.ci formatting
pre-commit-ci[bot] 6c23b36
Update Sky.hlsl
davo0411 9d2616d
fixes for nat
davo0411 dd8e283
Merge branch 'dev' into hdr-output
davo0411 d7de3f3
style: 🎨 apply pre-commit.ci formatting
pre-commit-ci[bot] c7fdfce
idk more attempts
davo0411 d97d564
Merge branch 'hdr-output' of https://github.com/davo0411/skyrim-commu…
davo0411 1ab5658
style: 🎨 apply pre-commit.ci formatting
pre-commit-ci[bot] d271563
Merge branch 'dev' into hdr-output
jiayev 083067b
fix shareddata buffer align
jiayev e26e074
Update HDRDisplay.cpp
davo0411 255b0f6
idk
davo0411 e64824c
style: 🎨 apply pre-commit.ci formatting
pre-commit-ci[bot] 5fa2570
Merge branch 'dev' into hdr-output
davo0411 72eb3a3
Revert "Update HDRDisplay.cpp"
jiayev 722b3db
fix(HDRDisplay): simplify menu state checks for UI brightness scaling
jiayev 424c676
Merge branch 'dev' into hdr-output
jiayev 5546098
Merge branch 'dev' into hdr-output
jiayev fbeee61
Merge branch 'dev' into hdr-output
jiayev b74b509
Merge branch 'dev' into hdr-output
jiayev a59d2e3
uncooking it
davo0411 7303e13
tweeekkkkkk
davo0411 93c5a8d
better
davo0411 71666ef
Update Sky.hlsl
davo0411 6b625af
style: 🎨 apply pre-commit.ci formatting
pre-commit-ci[bot] 42dd37c
Update HDROutputCS.hlsl
davo0411 5789e2e
Merge branch 'hdr-output' of https://github.com/davo0411/skyrim-commu…
davo0411 1d8bef2
style: 🎨 apply pre-commit.ci formatting
pre-commit-ci[bot] 0097d0c
Update DisplayMapping.hlsli
davo0411 c8456f8
Merge branch 'doodlum:dev' into hdr-output
davo0411 afe8aa5
fixes, comment removal
davo0411 3445ae1
Sun Blood occlusion mask
davo0411 fe42e14
Some UI fixes and nice-to-haves
davo0411 81635ac
Merge branch 'hdr-output' of https://github.com/davo0411/skyrim-commu…
davo0411 ebcaf2c
style: 🎨 apply pre-commit.ci formatting
pre-commit-ci[bot] 800d6a4
Merge branch 'dev' into hdr-output
jiayev 0afc5f5
musa changes
davo0411 70c7f58
Update HDRDisplay.h
davo0411 61ff10c
Merge branch 'doodlum:dev' into hdr-output
davo0411 7af5fd0
style: 🎨 apply pre-commit.ci formatting
pre-commit-ci[bot] fb25bdc
Update version in Upscaling.ini to 1-3-2
davo0411 45a39b3
code cleanup, comment cleanup
davo0411 2f5876d
Update HDROutputCS.hlsl
davo0411 402f1bd
Merge branch 'hdr-output' of https://github.com/davo0411/skyrim-commu…
davo0411 1b0ebea
style: 🎨 apply pre-commit.ci formatting
pre-commit-ci[bot] e9e4748
musa changes
davo0411 cbb4ad6
style: 🎨 apply pre-commit.ci formatting
pre-commit-ci[bot] e258b42
Update DisplayMapping.hlsli
davo0411 c413573
Update Upscaling.ini
davo0411 7186fda
Replace SrgbToLinearSigned with GammaToLinearSafe
davo0411 022b0cc
Change LinearToSrgbSigned to LinearToGammaSafe
davo0411 2f0d303
Merge branch 'dev' into hdr-output
alandtse cae5783
Update HDRDisplay.h
davo0411 33fa12d
Update HDROutputCS.hlsl
davo0411 6f019ba
Update ISHDR.hlsl
davo0411 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
|---|---|---|
| @@ -1,2 +1,2 @@ | ||
| [Info] | ||
| Version = 1-2-0 | ||
| Version = 1-2-1 |
This file contains hidden or 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,2 @@ | ||
| [Info] | ||
| Version = 1-0-0 |
100 changes: 100 additions & 0 deletions
100
features/HDR Display/Shaders/HDRDisplay/HDROutputCS.hlsl
This file contains hidden or 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,100 @@ | ||
| /** | ||
| * @file HDROutputCS.hlsl | ||
| * @brief HDR: gamma decode, paper-white × (nits/203), BT.2020, PQ. SDR: passthrough + UI. | ||
| */ | ||
|
|
||
| #include "Common/Color.hlsli" | ||
| #include "Common/SharedData.hlsli" | ||
|
|
||
| Texture2D<float4> SceneTex : register(t0); | ||
| Texture2D<float4> UITex : register(t1); | ||
| RWTexture2D<float4> HDROutput : register(u0); | ||
|
|
||
| cbuffer PerFrame : register(b0) | ||
| { | ||
| float enableHDR : packoffset(c0.x); | ||
| float paperWhite : packoffset(c0.y); | ||
| float peakNits : packoffset(c0.z); | ||
| float skipUIComposite : packoffset(c0.w); | ||
| float uiBrightness : packoffset(c1.x); | ||
| float isSceneLinear : packoffset(c1.y); | ||
| float isMainOrLoadingMenu : packoffset(c1.z); | ||
| float fgTweenMenuMidAlphaBoost : packoffset(c1.w); ///< TweenMenu: soften AA band when compositing here (UIBrightnessCS skips while paused) | ||
| } | ||
|
|
||
| [numthreads(8, 8, 1)] void main(uint3 dispatchID : SV_DispatchThreadID) { | ||
| uint width, height; | ||
| HDROutput.GetDimensions(width, height); | ||
| if (dispatchID.x >= width || dispatchID.y >= height) | ||
| return; | ||
|
|
||
| float4 scene = SceneTex[dispatchID.xy]; | ||
| float4 ui = UITex[dispatchID.xy]; | ||
|
|
||
| bool hdrEnabled = enableHDR > 0.5; | ||
| bool skipUI = skipUIComposite > 0.5; | ||
|
|
||
| float3 finalColor; | ||
|
|
||
| if (hdrEnabled) { | ||
| bool sceneIsLinear = isSceneLinear > 0.5; | ||
| float3 compositedColorLinear; | ||
|
|
||
| if (sceneIsLinear) { | ||
| float3 sceneLinear = max(0.0, scene.rgb); | ||
| if (skipUI) { | ||
| compositedColorLinear = sceneLinear; | ||
| } else { | ||
| float3 uiLinear = Color::SrgbToLinear(max(0.0, ui.rgb)); | ||
| if (!(isMainOrLoadingMenu > 0.5)) { // UI and scene can't be separated in main menu or loading screen | ||
| // scale UI brightness (multiplier based on paperWhite) | ||
| uiLinear *= uiBrightness; | ||
| } | ||
| compositedColorLinear = uiLinear + sceneLinear * (1.0 - ui.a); | ||
| } | ||
| } else { | ||
| float3 sceneGamma = scene.rgb; | ||
| float3 compositedColorGamma; | ||
| if (skipUI) { | ||
| compositedColorGamma = sceneGamma; | ||
| } else { | ||
| float3 uiGamma = ui.rgb; | ||
| if (!(isMainOrLoadingMenu > 0.5)) { // UI and scene can't be separated in main menu or loading screen | ||
| // scale UI brightness (multiplier based on paperWhite) | ||
| float3 uiLinear = Color::SrgbToLinear(max(0, uiGamma)); | ||
| uiLinear *= uiBrightness; | ||
| uiGamma = Color::LinearToSrgb(uiLinear); | ||
| } | ||
| #if 0 | ||
| if (fgTweenMenuMidAlphaBoost > 0.5 && ui.a > 1e-3) { | ||
| float midBand = smoothstep(0.3, 0.35, ui.a) * (1.0 - smoothstep(0.55, 0.6, ui.a)); | ||
| const float fgMidAlphaBoost = 0.12; | ||
| ui.a = saturate(ui.a + midBand * fgMidAlphaBoost); | ||
| } | ||
| #endif | ||
|
|
||
| compositedColorGamma = uiGamma + sceneGamma * (1.0 - ui.a); | ||
| } | ||
|
|
||
| // Non-LL path: ISHDR output is gamma-encoded at this stage. | ||
| compositedColorLinear = Color::GammaToLinearSafe(compositedColorGamma); | ||
| } | ||
|
|
||
| compositedColorLinear = Color::BT709ToBT2020(compositedColorLinear); | ||
| finalColor = Color::pq::Encode(max(0.0, compositedColorLinear), paperWhite); | ||
|
|
||
| finalColor = saturate(finalColor); | ||
| } else { | ||
| float3 sceneGamma = scene.rgb; | ||
|
|
||
| if (skipUI) { | ||
| finalColor = sceneGamma; | ||
| } else { | ||
| finalColor = ui.rgb + sceneGamma * (1.0 - ui.a); | ||
| } | ||
|
|
||
| finalColor = saturate(finalColor); | ||
| } | ||
|
|
||
| HDROutput[dispatchID.xy] = float4(finalColor, 1.0); | ||
| } |
67 changes: 67 additions & 0 deletions
67
features/HDR Display/Shaders/HDRDisplay/UIBrightnessCS.hlsl
This file contains hidden or 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,67 @@ | ||
| // Preprocess vanilla UI for Frame Gen compositing. | ||
| // HDR path converts UI to PQ/BT.2020 using configured paper white. | ||
| // SDR path keeps gamma UI and only clamps negatives. | ||
|
|
||
| #include "Common/Color.hlsli" | ||
|
|
||
| RWTexture2D<float4> UITex : register(u0); | ||
|
|
||
| cbuffer PerFrame : register(b0) | ||
| { | ||
| float enableHDR : packoffset(c0.x); ///< 1.0 = HDR output with PQ, 0.0 = SDR output with gamma | ||
| float paperWhite : packoffset(c0.y); ///< Reference white in nits (used by HDR UI conversion) | ||
| float peakNits : packoffset(c0.z); ///< Maximum display brightness in nits for HDR (unused here) | ||
| float skipUIComposite : packoffset(c0.w); ///< Unused in this shader | ||
| float uiBrightness : packoffset(c1.x); ///< UI brightness multiplier | ||
| float isSceneLinear : packoffset(c1.y); ///< Unused in this shader | ||
| float isMainOrLoadingMenu : packoffset(c1.z); ///< Unused; layout matches HDRDataCB | ||
| float fgTweenMenuMidAlphaBoost : packoffset(c1.w); ///< 1 = TweenMenu open: apply mid-alpha AA boost only for pause UI | ||
| } | ||
|
|
||
| [numthreads(8, 8, 1)] void main(uint3 dispatchID : SV_DispatchThreadID) { | ||
| // Bounds check to prevent UAV out-of-bounds reads/writes | ||
| uint width, height; | ||
| UITex.GetDimensions(width, height); | ||
| if (dispatchID.x >= width || dispatchID.y >= height) | ||
| return; | ||
|
|
||
| float4 ui = UITex[dispatchID.xy]; | ||
|
|
||
| bool hdrEnabled = enableHDR > 0.5; | ||
|
|
||
| if (hdrEnabled) { | ||
| // FidelityFX FG blends in PQ space, so UI must be PQ/BT.2020. | ||
| const float uiReferenceNits = max(paperWhite, 1.0); | ||
|
|
||
| if (ui.a > 0.001) { | ||
| // Pause menu only: raise coverage in the soft AA band to avoid washout. | ||
| float aIn = ui.a; | ||
| float aOut = aIn; | ||
| if (fgTweenMenuMidAlphaBoost > 0.5) { | ||
| float midBand = smoothstep(0.3, 0.35, aIn) * (1.0 - smoothstep(0.55, 0.6, aIn)); | ||
| const float fgMidAlphaBoost = 0.12; | ||
| aOut = saturate(aIn + midBand * fgMidAlphaBoost); | ||
| } | ||
|
|
||
| float3 uiStraight = ui.rgb / aIn; | ||
| float3 uiLinear = Color::SrgbToLinear(max(0, uiStraight)); | ||
| float3 uiBT2020 = Color::BT709ToBT2020(uiLinear); | ||
| float3 uiNits = uiBT2020 * uiReferenceNits * uiBrightness; | ||
| ui.rgb = Color::pq::Encode(uiNits / 10000.0, 10000.0) * aOut; | ||
| ui.a = aOut; | ||
| } else { | ||
| // Broken-alpha path: transform premultiplied color and keep alpha at 0. | ||
| float3 uiLinear = Color::SrgbToLinear(max(0, ui.rgb)); | ||
| float3 uiBT2020 = Color::BT709ToBT2020(uiLinear); | ||
| float3 uiNits = uiBT2020 * uiReferenceNits * uiBrightness; | ||
| ui.rgb = Color::pq::Encode(uiNits / 10000.0, 10000.0); | ||
| } | ||
| } else { | ||
| // SDR path: keep premultiplied gamma UI, clamp negatives only. | ||
| ui.rgb = max(0, ui.rgb); | ||
| UITex[dispatchID.xy] = ui; | ||
| return; | ||
| } | ||
|
|
||
| UITex[dispatchID.xy] = ui; | ||
| } | ||
This file contains hidden or 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 |
|---|---|---|
| @@ -1,2 +1,2 @@ | ||
| [Info] | ||
| Version = 1-3-1 | ||
| Version = 1-4-0 |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.