Fix sRGB handling on clear colours

This commit is contained in:
baldurk
2016-07-10 18:10:06 +02:00
parent f96be406d2
commit 6608a965ed
6 changed files with 20 additions and 23 deletions
+2 -2
View File
@@ -42,10 +42,10 @@ void main(void)
(ab.x > 64 && ab.y > 64)
)
{
color_out = vec4(sqrt(lightCol.rgb), 1);
color_out = vec4(darkCol.rgb*darkCol.rgb, 1);
}
else
{
color_out = vec4(sqrt(darkCol.rgb), 1);
color_out = vec4(lightCol.rgb*lightCol.rgb, 1);
}
}
+2 -2
View File
@@ -303,10 +303,10 @@ float4 RENDERDOC_CheckerboardPS(float4 IN : SV_Position) : SV_Target0
(ab.x > 64 && ab.y > 64)
)
{
return float4(sqrt(WireframeColour.rgb), 1);
return float4(WireframeColour.rgb*WireframeColour.rgb, 1);
}
return float4(sqrt(Channels.rgb), 1);
return float4(Channels.rgb*Channels.rgb, 1);
}
////////////////////////////////////////////////////////////////////////////////////////////
+2 -2
View File
@@ -39,10 +39,10 @@ void main(void)
(ab.x > 64 && ab.y > 64)
)
{
color_out = vec4(sqrt(checker.lightCol.rgb), 1);
color_out = vec4(checker.darkCol.rgb*checker.darkCol.rgb, 1);
}
else
{
color_out = vec4(sqrt(checker.darkCol.rgb), 1);
color_out = vec4(checker.lightCol.rgb*checker.lightCol.rgb, 1);
}
}
+3 -3
View File
@@ -339,7 +339,7 @@ void ReplayOutput::DisplayContext()
if((m_Config.m_Type != eOutputType_TexDisplay) || (m_ContextX < 0.0f && m_ContextY < 0.0f) ||
(m_RenderData.texDisplay.texid == ResourceId()))
{
m_pDevice->RenderCheckerboard(Vec3f(0.666f, 0.666f, 0.666f), Vec3f(0.333f, 0.333f, 0.333f));
m_pDevice->RenderCheckerboard(Vec3f(0.81f, 0.81f, 0.81f), Vec3f(0.57f, 0.57f, 0.57f));
m_pDevice->FlipOutputWindow(m_PixelContext.outputID);
return;
}
@@ -573,7 +573,7 @@ void ReplayOutput::DisplayMesh()
m_pDevice->BindOutputWindow(m_MainOutput.outputID, false);
m_pDevice->ClearOutputWindowColour(m_MainOutput.outputID, color);
m_pDevice->ClearOutputWindowDepth(m_MainOutput.outputID, 1.0f, 0);
m_pDevice->RenderCheckerboard(Vec3f(0.666f, 0.666f, 0.666f), Vec3f(0.333f, 0.333f, 0.333f));
m_pDevice->RenderCheckerboard(Vec3f(0.81f, 0.81f, 0.81f), Vec3f(0.57f, 0.57f, 0.57f));
return;
}
@@ -588,7 +588,7 @@ void ReplayOutput::DisplayMesh()
m_pDevice->BindOutputWindow(m_MainOutput.outputID, true);
m_pDevice->ClearOutputWindowDepth(m_MainOutput.outputID, 1.0f, 0);
m_pDevice->RenderCheckerboard(Vec3f(0.666f, 0.666f, 0.666f), Vec3f(0.333f, 0.333f, 0.333f));
m_pDevice->RenderCheckerboard(Vec3f(0.81f, 0.81f, 0.81f), Vec3f(0.57f, 0.57f, 0.57f));
m_pDevice->ClearOutputWindowDepth(m_MainOutput.outputID, 1.0f, 0);
+4 -4
View File
@@ -659,8 +659,8 @@ namespace renderdoc
public float offx = 0.0f, offy = 0.0f;
public FloatVector lightBackgroundColour = new FloatVector(0.666f, 0.666f, 0.666f);
public FloatVector darkBackgroundColour = new FloatVector(0.333f, 0.333f, 0.333f);
public FloatVector lightBackgroundColour = new FloatVector(0.81f, 0.81f, 0.81f);
public FloatVector darkBackgroundColour = new FloatVector(0.57f, 0.57f, 0.57f);
public TextureDisplayOverlay overlay = TextureDisplayOverlay.None;
};
@@ -712,8 +712,8 @@ namespace renderdoc
public int channelExtract = -1;
public AlphaMapping alpha = AlphaMapping.Discard;
public FloatVector alphaCol = new FloatVector(0.666f, 0.666f, 0.666f);
public FloatVector alphaColSecondary = new FloatVector(0.333f, 0.333f, 0.333f);
public FloatVector alphaCol = new FloatVector(0.81f, 0.81f, 0.81f);
public FloatVector alphaColSecondary = new FloatVector(0.57f, 0.57f, 0.57f);
public int jpegQuality = 90;
};
+7 -10
View File
@@ -2293,13 +2293,13 @@ namespace renderdocui.Windows
int numX = (int)Math.Ceiling((float)rect.Width / 64.0f);
int numY = (int)Math.Ceiling((float)rect.Height / 64.0f);
Brush dark = new SolidBrush(Color.FromArgb((int)(255 * Math.Sqrt(Math.Sqrt(darkBack.x))),
(int)(255 * Math.Sqrt(Math.Sqrt(darkBack.y))),
(int)(255 * Math.Sqrt(Math.Sqrt(darkBack.z)))));
Brush dark = new SolidBrush(Color.FromArgb((int)(255 * darkBack.x),
(int)(255 * darkBack.y),
(int)(255 * darkBack.z)));
Brush light = new SolidBrush(Color.FromArgb((int)(255 * Math.Sqrt(Math.Sqrt(lightBack.x))),
(int)(255 * Math.Sqrt(Math.Sqrt(lightBack.y))),
(int)(255 * Math.Sqrt(Math.Sqrt(lightBack.z)))));
Brush light = new SolidBrush(Color.FromArgb((int)(255 * lightBack.x),
(int)(255 * lightBack.y),
(int)(255 * lightBack.z)));
for (int x = 0; x < numX; x++)
{
@@ -2330,10 +2330,7 @@ namespace renderdocui.Windows
renderContainer.Invalidate();
if (m_Output == null || m_Core.Renderer == null)
{
if (backcolorPick.Checked)
e.Graphics.Clear(colorDialog.Color);
else
DrawCheckerboard(e.Graphics, render.DisplayRectangle);
DrawCheckerboard(e.Graphics, render.DisplayRectangle);
return;
}