Skip to content

Histogram view improvements #589

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 36 commits into from
May 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
68acb9c
some very incomplete stuff...
FrancescoC-unity Apr 22, 2020
ccb3a84
sync point, rough working version
FrancescoC-unity Apr 23, 2020
297f0d4
Mostly working for now, moving onto debug vis and maybe revisit.
FrancescoC-unity Apr 24, 2020
d25ccf9
Commit as I need branch switching - Start debug modes
FrancescoC-unity Apr 27, 2020
64cad47
Add a bunch of debug mode and start of histogram
FrancescoC-unity Apr 29, 2020
f2b71e0
Delimiters indicator with bars
FrancescoC-unity Apr 29, 2020
86be36d
Add another option for percentile exttremes
FrancescoC-unity Apr 29, 2020
db33844
fix warning
FrancescoC-unity Apr 30, 2020
a277a56
Moving debug modes
FrancescoC-unity Apr 30, 2020
c533cfd
Label bar separate (invisible otherwise)
FrancescoC-unity Apr 30, 2020
8cca38f
Push change to bar indicator
FrancescoC-unity Apr 30, 2020
f319156
remove fancy background of histogram frame
FrancescoC-unity Apr 30, 2020
7fc3237
Small triangle instead of indicator bars
FrancescoC-unity May 4, 2020
2573a9d
Target exposure indicator
FrancescoC-unity May 4, 2020
cda2dce
add some margin
FrancescoC-unity May 4, 2020
f5d1d79
Add an X at center
FrancescoC-unity May 4, 2020
cae8e6e
Metering PiP
FrancescoC-unity May 4, 2020
2d59944
Draw tonemap curve and use tonemapped texture for view
FrancescoC-unity May 5, 2020
7f83e1a
Share some code
FrancescoC-unity May 5, 2020
d002b89
Curve remapping for histogram and fix some warning
FrancescoC-unity May 5, 2020
9187bbb
Some comments fixup
FrancescoC-unity May 5, 2020
beb9b39
Simple comment changes
FrancescoC-unity May 6, 2020
9f7ee5f
Revert debug symbol in shader
FrancescoC-unity May 6, 2020
a544903
Changelog
FrancescoC-unity May 6, 2020
a330cb3
Merge branch 'HDRP/staging' into HDRP/histogram-exposure
sebastienlagarde May 6, 2020
12632b6
review fixups
FrancescoC-unity May 6, 2020
e4345d8
Merge branch 'HDRP/histogram-exposure' of https://github.com/Unity-Te…
FrancescoC-unity May 6, 2020
b43f83a
print exposure values in debug view
FrancescoC-unity May 11, 2020
6ca31ab
commit but it is nothing, need to switch branch
FrancescoC-unity May 11, 2020
1f846b3
Add option to center histogram around exposure (fixed tonemap curve)
FrancescoC-unity May 15, 2020
3601cfd
change color of text
FrancescoC-unity May 18, 2020
4c29bd7
Merge branch 'HDRP/staging' into HDRP/histogram-view-improvements
FrancescoC-unity May 25, 2020
61a7315
fixup debug display merge issue
FrancescoC-unity May 25, 2020
64cf829
fixup merge issues
FrancescoC-unity May 25, 2020
de2cbb3
fixup issue with tonemap curve
FrancescoC-unity May 25, 2020
7b7bf4e
Merge branch 'HDRP/staging' into HDRP/histogram-view-improvements
sebastienlagarde May 28, 2020
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
Original file line number Diff line number Diff line change
Expand Up @@ -919,6 +919,13 @@ void RegisterLightingDebug()
getter = () => data.lightingDebugSettings.showTonemapCurveAlongHistogramView,
setter = value => data.lightingDebugSettings.showTonemapCurveAlongHistogramView = value
});
exposureFoldout.children.Add(
new DebugUI.BoolField()
{
displayName = "Center Around Exposure",
getter = () => data.lightingDebugSettings.centerHistogramAroundMiddleGrey,
setter = value => data.lightingDebugSettings.centerHistogramAroundMiddleGrey = value
});
}

exposureFoldout.children.Add(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ float3 GetTextureDataDebug(uint paramId, float2 uv, Texture2D tex, float4 texelS
// color is current screen color
// color of the font to use
// direction is 1 or -1 and indicate fixedUnormCoord block shift
void DrawCharacter(uint asciiValue, float3 fontColor, uint2 currentUnormCoord, inout uint2 fixedUnormCoord, inout float3 color, int direction)
void DrawCharacter(uint asciiValue, float3 fontColor, uint2 currentUnormCoord, inout uint2 fixedUnormCoord, inout float3 color, int direction, int fontTextScaleWidth)
{
// Are we inside a font display block on the screen ?
uint2 localCharCoord = currentUnormCoord - fixedUnormCoord;
Expand All @@ -145,15 +145,20 @@ void DrawCharacter(uint asciiValue, float3 fontColor, uint2 currentUnormCoord, i
// normalized coordinate
float2 normTexCoord = float2(unormTexCoord) / float2(DEBUG_FONT_TEXT_WIDTH * DEBUG_FONT_TEXT_COUNT_X, DEBUG_FONT_TEXT_HEIGHT * DEBUG_FONT_TEXT_COUNT_Y);

#if UNITY_UV_STARTS_AT_TOP
#if UNITY_UV_STARTS_AT_TOP
normTexCoord.y = 1.0 - normTexCoord.y;
#endif
#endif

float charColor = SAMPLE_TEXTURE2D_LOD(_DebugFont, s_point_clamp_sampler, normTexCoord, 0).r;
color = color * (1.0 - charColor) + charColor * fontColor;
}

fixedUnormCoord.x += DEBUG_FONT_TEXT_SCALE_WIDTH * direction;
fixedUnormCoord.x += fontTextScaleWidth * direction;
}

void DrawCharacter(uint asciiValue, float3 fontColor, uint2 currentUnormCoord, inout uint2 fixedUnormCoord, inout float3 color, int direction)
{
DrawCharacter(asciiValue, fontColor, currentUnormCoord, fixedUnormCoord, color, direction, DEBUG_FONT_TEXT_SCALE_WIDTH);
}

// Shortcut to not have to file direction
Expand Down
Loading