Overhaul depth preview rendering:

* Replace Jet color map with grayscale
* Added Shift + \ hotkey to toggle preview
* Added Shift + [, Shift + ] hotkeys to change contrast
* Added Shift + ;, Shift + ' hotkeys to change offset
This commit is contained in:
Paul Chote
2021-07-25 00:28:29 +01:00
committed by reaperrr
parent 91c5f2cabe
commit 962d6496bd
9 changed files with 342 additions and 31 deletions

View File

@@ -20,7 +20,51 @@ namespace OpenRA.Traits
public bool CombatGeometry;
public bool RenderGeometry;
public bool ScreenMap;
public bool DepthBuffer;
public bool ActorTags;
// The depth buffer may have been left enabled by the previous world
// Initializing this as dirty forces us to reset the default rendering before the first render
bool depthBufferDirty = true;
bool depthBuffer;
public bool DepthBuffer
{
get => depthBuffer;
set
{
depthBuffer = value;
depthBufferDirty = true;
}
}
float depthBufferContrast = 1f;
public float DepthBufferContrast
{
get => depthBufferContrast;
set
{
depthBufferContrast = value;
depthBufferDirty = true;
}
}
float depthBufferOffset;
public float DepthBufferOffset
{
get => depthBufferOffset;
set
{
depthBufferOffset = value;
depthBufferDirty = true;
}
}
public void UpdateDepthBuffer()
{
if (depthBufferDirty)
{
Game.Renderer.WorldSpriteRenderer.SetDepthPreview(DepthBuffer, DepthBufferContrast, DepthBufferOffset);
depthBufferDirty = false;
}
}
}
}