mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-05 17:40:39 +00:00
Inherit channel visibility from viewer, display inherited state
* A label is shown at the top of the pixel history showing the range display and visible channels. The channel visibility behaves the same as in the texture viewer - 2 or more and the other channels display as black and 1 channel displays grayscale.
This commit is contained in:
+48
-3
@@ -34,10 +34,50 @@
|
||||
TreelistView.TreeListColumn treeListColumn4 = ((TreelistView.TreeListColumn)(new TreelistView.TreeListColumn("BeforeCol", "")));
|
||||
TreelistView.TreeListColumn treeListColumn5 = ((TreelistView.TreeListColumn)(new TreelistView.TreeListColumn("After", "After")));
|
||||
TreelistView.TreeListColumn treeListColumn6 = ((TreelistView.TreeListColumn)(new TreelistView.TreeListColumn("AfterCol", "")));
|
||||
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
|
||||
this.historyContext = new System.Windows.Forms.Label();
|
||||
this.eventsHidden = new System.Windows.Forms.Label();
|
||||
this.events = new TreelistView.TreeListView();
|
||||
this.tableLayoutPanel1.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.events)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// tableLayoutPanel1
|
||||
//
|
||||
this.tableLayoutPanel1.ColumnCount = 1;
|
||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
|
||||
this.tableLayoutPanel1.Controls.Add(this.events, 0, 2);
|
||||
this.tableLayoutPanel1.Controls.Add(this.historyContext, 0, 0);
|
||||
this.tableLayoutPanel1.Controls.Add(this.eventsHidden, 0, 1);
|
||||
this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);
|
||||
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
|
||||
this.tableLayoutPanel1.RowCount = 3;
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
|
||||
this.tableLayoutPanel1.Size = new System.Drawing.Size(386, 478);
|
||||
this.tableLayoutPanel1.TabIndex = 2;
|
||||
//
|
||||
// historyContext
|
||||
//
|
||||
this.historyContext.AutoSize = true;
|
||||
this.historyContext.Location = new System.Drawing.Point(3, 0);
|
||||
this.historyContext.Name = "historyContext";
|
||||
this.historyContext.Size = new System.Drawing.Size(378, 52);
|
||||
this.historyContext.TabIndex = 2;
|
||||
this.historyContext.Text = "***code overwritten preview*** Preview colours displayed in visible range {min} -" +
|
||||
" {max} with {red, blue, green} channels.\r\n\r\nRight click to debug an event, or hi" +
|
||||
"de failed events.";
|
||||
//
|
||||
// eventsHidden
|
||||
//
|
||||
this.eventsHidden.AutoSize = true;
|
||||
this.eventsHidden.Location = new System.Drawing.Point(3, 52);
|
||||
this.eventsHidden.Name = "eventsHidden";
|
||||
this.eventsHidden.Size = new System.Drawing.Size(0, 13);
|
||||
this.eventsHidden.TabIndex = 3;
|
||||
//
|
||||
// events
|
||||
//
|
||||
treeListColumn1.AutoSizeMinSize = 10;
|
||||
@@ -66,12 +106,12 @@
|
||||
treeListColumn6});
|
||||
this.events.Cursor = System.Windows.Forms.Cursors.Arrow;
|
||||
this.events.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.events.Location = new System.Drawing.Point(0, 0);
|
||||
this.events.Location = new System.Drawing.Point(3, 68);
|
||||
this.events.MultiSelect = false;
|
||||
this.events.Name = "events";
|
||||
this.events.RowOptions.ItemHeight = 96;
|
||||
this.events.RowOptions.ShowHeader = false;
|
||||
this.events.Size = new System.Drawing.Size(386, 478);
|
||||
this.events.Size = new System.Drawing.Size(380, 407);
|
||||
this.events.TabIndex = 1;
|
||||
this.events.Text = "History Events";
|
||||
this.events.ViewOptions.ShowLine = false;
|
||||
@@ -83,11 +123,13 @@
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(386, 478);
|
||||
this.Controls.Add(this.events);
|
||||
this.Controls.Add(this.tableLayoutPanel1);
|
||||
this.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.Name = "PixelHistoryView";
|
||||
this.ShowHint = WeifenLuo.WinFormsUI.Docking.DockState.DockRight;
|
||||
this.Text = "Pixel History";
|
||||
this.tableLayoutPanel1.ResumeLayout(false);
|
||||
this.tableLayoutPanel1.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.events)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
@@ -96,5 +138,8 @@
|
||||
#endregion
|
||||
|
||||
private TreelistView.TreeListView events;
|
||||
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
|
||||
private System.Windows.Forms.Label historyContext;
|
||||
private System.Windows.Forms.Label eventsHidden;
|
||||
}
|
||||
}
|
||||
@@ -41,7 +41,9 @@ namespace renderdocui.Windows
|
||||
{
|
||||
Core m_Core;
|
||||
|
||||
public PixelHistoryView(Core core, FetchTexture tex, Point pt, float rangemin, float rangemax, PixelModification[] history)
|
||||
public PixelHistoryView(Core core, FetchTexture tex, Point pt,
|
||||
float rangemin, float rangemax, bool[] channels,
|
||||
PixelModification[] history)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
@@ -52,7 +54,48 @@ namespace renderdocui.Windows
|
||||
|
||||
m_Core = core;
|
||||
|
||||
Text += String.Format(" on {0} for ({1}, {2})", tex.name, pt.X, pt.Y);
|
||||
Text = String.Format("Pixel History on {0} for ({1}, {2})", tex.name, pt.X, pt.Y);
|
||||
|
||||
string channelStr = "";
|
||||
int numChannels = 0;
|
||||
int channelIdx = 0;
|
||||
|
||||
if (channels[0])
|
||||
{
|
||||
channelStr += "R";
|
||||
numChannels++;
|
||||
channelIdx = 0;
|
||||
}
|
||||
if (channels[1])
|
||||
{
|
||||
channelStr += "G";
|
||||
numChannels++;
|
||||
channelIdx = 1;
|
||||
}
|
||||
if (channels[2])
|
||||
{
|
||||
channelStr += "B";
|
||||
numChannels++;
|
||||
channelIdx = 2;
|
||||
}
|
||||
|
||||
channelStr += " channel";
|
||||
if (numChannels > 1)
|
||||
channelStr += "s";
|
||||
|
||||
// if alpha channel is enabled it only does anything if the
|
||||
// other channels are all disabled. There is no RGBA preview
|
||||
if (numChannels == 0 && channels[3])
|
||||
{
|
||||
channelStr = "Alpha";
|
||||
numChannels = 1;
|
||||
channelIdx = 3;
|
||||
}
|
||||
|
||||
historyContext.Text = String.Format("Preview colours displayed in visible range {0} - {1} with {2} visible.",
|
||||
Formatter.Format(rangemin), Formatter.Format(rangemax), channelStr) + Environment.NewLine;
|
||||
historyContext.Text += Environment.NewLine;
|
||||
historyContext.Text += "Right click to debug an event, or hide failed events.";
|
||||
|
||||
bool uintTex = (tex.format.compType == FormatComponentType.UInt);
|
||||
bool sintTex = (tex.format.compType == FormatComponentType.SInt);
|
||||
@@ -170,9 +213,24 @@ namespace renderdocui.Windows
|
||||
|
||||
if (floatTex || numComps == 0)
|
||||
{
|
||||
float r = Helpers.Clamp((mod.preMod.col.value.f[0] - rangemin) / rangesize, 0.0f, 1.0f);
|
||||
float g = Helpers.Clamp((mod.preMod.col.value.f[1] - rangemin) / rangesize, 0.0f, 1.0f);
|
||||
float b = Helpers.Clamp((mod.preMod.col.value.f[2] - rangemin) / rangesize, 0.0f, 1.0f);
|
||||
float r = mod.preMod.col.value.f[0];
|
||||
float g = mod.preMod.col.value.f[1];
|
||||
float b = mod.preMod.col.value.f[2];
|
||||
|
||||
if (numChannels == 1)
|
||||
{
|
||||
r = g = b = mod.preMod.col.value.f[channelIdx];
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!channels[0]) r = 0.0f;
|
||||
if (!channels[1]) g = 0.0f;
|
||||
if (!channels[2]) b = 0.0f;
|
||||
}
|
||||
|
||||
r = Helpers.Clamp((r - rangemin) / rangesize, 0.0f, 1.0f);
|
||||
g = Helpers.Clamp((g - rangemin) / rangesize, 0.0f, 1.0f);
|
||||
b = Helpers.Clamp((b - rangemin) / rangesize, 0.0f, 1.0f);
|
||||
|
||||
if(numComps == 0)
|
||||
r = g = b = Helpers.Clamp((mod.preMod.depth - rangemin) / rangesize, 0.0f, 1.0f);
|
||||
@@ -186,9 +244,24 @@ 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.col.value.f[0] - rangemin) / rangesize, 0.0f, 1.0f);
|
||||
g = Helpers.Clamp((mod.postMod.col.value.f[1] - rangemin) / rangesize, 0.0f, 1.0f);
|
||||
b = Helpers.Clamp((mod.postMod.col.value.f[2] - rangemin) / rangesize, 0.0f, 1.0f);
|
||||
r = mod.postMod.col.value.f[0];
|
||||
g = mod.postMod.col.value.f[1];
|
||||
b = mod.postMod.col.value.f[2];
|
||||
|
||||
if (numChannels == 1)
|
||||
{
|
||||
r = g = b = mod.postMod.col.value.f[channelIdx];
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!channels[0]) r = 0.0f;
|
||||
if (!channels[1]) g = 0.0f;
|
||||
if (!channels[2]) b = 0.0f;
|
||||
}
|
||||
|
||||
r = Helpers.Clamp((r - rangemin) / rangesize, 0.0f, 1.0f);
|
||||
g = Helpers.Clamp((g - rangemin) / rangesize, 0.0f, 1.0f);
|
||||
b = Helpers.Clamp((b - rangemin) / rangesize, 0.0f, 1.0f);
|
||||
|
||||
if (numComps == 0)
|
||||
r = g = b = Helpers.Clamp((mod.postMod.depth - rangemin) / rangesize, 0.0f, 1.0f);
|
||||
|
||||
@@ -2589,7 +2589,9 @@ namespace renderdocui.Windows
|
||||
this.BeginInvoke(new Action(() =>
|
||||
{
|
||||
PixelHistoryView hist = new PixelHistoryView(m_Core, CurrentTexture, m_PickedPoint,
|
||||
m_TexDisplay.rangemin, m_TexDisplay.rangemax, history);
|
||||
m_TexDisplay.rangemin, m_TexDisplay.rangemax,
|
||||
new bool[] { m_TexDisplay.Red, m_TexDisplay.Green, m_TexDisplay.Blue, m_TexDisplay.Alpha },
|
||||
history);
|
||||
hist.Show(DockPanel);
|
||||
}));
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user