mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-06 01:50:38 +00:00
Bake in range-select min and max when opening a pixel history view
* I'm not sure if this 'hidden' latched UI state is good or bad, but it means the colours are visible if you've adjusted the range way outside of 0-1.
This commit is contained in:
@@ -41,7 +41,7 @@ namespace renderdocui.Windows
|
||||
{
|
||||
Core m_Core;
|
||||
|
||||
public PixelHistoryView(Core core, FetchTexture tex, Point pt, PixelModification[] history)
|
||||
public PixelHistoryView(Core core, FetchTexture tex, Point pt, float rangemin, float rangemax, PixelModification[] history)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
@@ -60,6 +60,8 @@ namespace renderdocui.Windows
|
||||
(tex.creationFlags & TextureCreationFlags.SwapBuffer) > 0;
|
||||
bool floatTex = (!uintTex && !sintTex);
|
||||
|
||||
float rangesize = (rangemax - rangemin);
|
||||
|
||||
foreach (PixelModification mod in history)
|
||||
{
|
||||
string name = "name";
|
||||
@@ -146,9 +148,9 @@ namespace renderdocui.Windows
|
||||
|
||||
if (floatTex)
|
||||
{
|
||||
float r = Helpers.Clamp(mod.preMod.value.f[0], 0.0f, 1.0f);
|
||||
float g = Helpers.Clamp(mod.preMod.value.f[1], 0.0f, 1.0f);
|
||||
float b = Helpers.Clamp(mod.preMod.value.f[2], 0.0f, 1.0f);
|
||||
float r = Helpers.Clamp((mod.preMod.value.f[0] - rangemin) / rangesize, 0.0f, 1.0f);
|
||||
float g = Helpers.Clamp((mod.preMod.value.f[1] - rangemin) / rangesize, 0.0f, 1.0f);
|
||||
float b = Helpers.Clamp((mod.preMod.value.f[2] - rangemin) / rangesize, 0.0f, 1.0f);
|
||||
|
||||
if (srgbTex)
|
||||
{
|
||||
@@ -159,9 +161,9 @@ namespace renderdocui.Windows
|
||||
|
||||
node.IndexedBackColor[3] = Color.FromArgb((int)(255.0f * r), (int)(255.0f * g), (int)(255.0f * b));
|
||||
|
||||
r = Helpers.Clamp(mod.postMod.value.f[0], 0.0f, 1.0f);
|
||||
g = Helpers.Clamp(mod.postMod.value.f[1], 0.0f, 1.0f);
|
||||
b = Helpers.Clamp(mod.postMod.value.f[2], 0.0f, 1.0f);
|
||||
r = Helpers.Clamp((mod.postMod.value.f[0] - rangemin) / rangesize, 0.0f, 1.0f);
|
||||
g = Helpers.Clamp((mod.postMod.value.f[1] - rangemin) / rangesize, 0.0f, 1.0f);
|
||||
b = Helpers.Clamp((mod.postMod.value.f[2] - rangemin) / rangesize, 0.0f, 1.0f);
|
||||
|
||||
if (srgbTex)
|
||||
{
|
||||
|
||||
@@ -2562,7 +2562,8 @@ namespace renderdocui.Windows
|
||||
|
||||
this.BeginInvoke(new Action(() =>
|
||||
{
|
||||
PixelHistoryView hist = new PixelHistoryView(m_Core, CurrentTexture, m_PickedPoint, history);
|
||||
PixelHistoryView hist = new PixelHistoryView(m_Core, CurrentTexture, m_PickedPoint,
|
||||
m_TexDisplay.rangemin, m_TexDisplay.rangemax, history);
|
||||
hist.Show(DockPanel);
|
||||
}));
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user