Add toggle to disable gamma 'correction' of linear data. Closes #58

* The explanation is in the FAQ but the short explanation is that most
  data e.g. normal maps are conventionally displayed as if they contained
  SRGB data, so RenderDoc does the same so things look as expected.
This commit is contained in:
baldurk committed 2014-07-04 17:02:11 +01:00
1 parent 0fbdcbc83c
commit 75353bd190
11 files changed
+207 -109

No files matched your search

+2
View File
@@ -1396,6 +1396,7 @@ void D3D11DebugManager::PickPixel(ResourceId texture, uint32_t x, uint32_t y, ui
texDisplay.Red = texDisplay.Green = texDisplay.Blue = texDisplay.Alpha = true;
texDisplay.HDRMul = -1.0f;
texDisplay.linearDisplayAsGamma = true;
texDisplay.mip = mip;
texDisplay.CustomShader = ResourceId();
texDisplay.sliceFace = sliceFace;
@@ -2048,6 +2049,7 @@ ResourceId D3D11DebugManager::ApplyCustomShader(ResourceId shader, ResourceId te
disp.texid = texid;
disp.lightBackgroundColour = disp.darkBackgroundColour = FloatVector(0,0,0,0);
disp.HDRMul = -1.0f;
disp.linearDisplayAsGamma = true;
disp.mip = mip;
disp.overlay = eTexOverlay_None;
disp.rangemin = 0.0f;
+1 -1
View File
@@ -3464,7 +3464,7 @@ bool D3D11DebugManager::RenderTexture(TextureDisplay cfg)
pixelData.OutputDisplayFormat |= TEXDISPLAY_SINT_TEX;
srvOffset = 20;
}
if(!IsSRGBFormat(details.texFmt))
if(!IsSRGBFormat(details.texFmt) && cfg.linearDisplayAsGamma)
{
pixelData.OutputDisplayFormat |= TEXDISPLAY_GAMMA_CURVE;
}
+1
View File
@@ -198,6 +198,7 @@ void GLReplay::PickPixel(ResourceId texture, uint32_t x, uint32_t y, uint32_t sl
texDisplay.Red = texDisplay.Green = texDisplay.Blue = texDisplay.Alpha = true;
texDisplay.HDRMul = -1.0f;
texDisplay.linearDisplayAsGamma = true;
texDisplay.mip = mip;
texDisplay.CustomShader = ResourceId();
texDisplay.sliceFace = sliceFace;
+1
View File
@@ -60,6 +60,7 @@ struct TextureDisplay
float scale;
bool32 Red, Green, Blue, Alpha;
float HDRMul;
bool32 linearDisplayAsGamma;
ResourceId CustomShader;
uint32_t mip;
uint32_t sliceFace;
+1
View File
@@ -361,6 +361,7 @@ bool ReplayOutput::Display()
disp.Red = disp.Green = disp.Blue = true;
disp.Alpha = false;
disp.HDRMul = -1.0f;
disp.linearDisplayAsGamma = true;
disp.mip = 0;
disp.CustomShader = ResourceId();
disp.texid = m_pDevice->GetLiveID(m_Thumbnails[i].texture);