Merge pull request #310 from SHADE-DP/SP3-1-DebugDraw
Fix #307 and SHDebugDraw::WireCapsule is now made static
This commit is contained in:
commit
5994c83263
|
@ -104,6 +104,10 @@ namespace SHADE
|
||||||
auto subPass = renderGraph->GetNode("Debug Draw")->GetSubpass("Debug Draw");
|
auto subPass = renderGraph->GetNode("Debug Draw")->GetSubpass("Debug Draw");
|
||||||
subPass->AddExteriorDrawCalls([this](Handle<SHVkCommandBuffer> cmdBuffer, Handle<SHRenderer> renderer, uint32_t frameIndex)
|
subPass->AddExteriorDrawCalls([this](Handle<SHVkCommandBuffer> cmdBuffer, Handle<SHRenderer> renderer, uint32_t frameIndex)
|
||||||
{
|
{
|
||||||
|
// Set line width first
|
||||||
|
cmdBuffer->SetLineWidth(LineWidth);
|
||||||
|
|
||||||
|
// Draw
|
||||||
const uint32_t FRAME_IDX = gfxSystem->GetCurrentFrameIndex();
|
const uint32_t FRAME_IDX = gfxSystem->GetCurrentFrameIndex();
|
||||||
cmdBuffer->BeginLabeledSegment("SHDebugDraw (No Depth Test)");
|
cmdBuffer->BeginLabeledSegment("SHDebugDraw (No Depth Test)");
|
||||||
{
|
{
|
||||||
|
@ -128,6 +132,10 @@ namespace SHADE
|
||||||
auto subPassWithDepth = renderGraph->GetNode("Debug Draw with Depth")->GetSubpass("Debug Draw with Depth");
|
auto subPassWithDepth = renderGraph->GetNode("Debug Draw with Depth")->GetSubpass("Debug Draw with Depth");
|
||||||
subPassWithDepth->AddExteriorDrawCalls([this](Handle<SHVkCommandBuffer> cmdBuffer, Handle<SHRenderer> renderer, uint32_t frameIndex)
|
subPassWithDepth->AddExteriorDrawCalls([this](Handle<SHVkCommandBuffer> cmdBuffer, Handle<SHRenderer> renderer, uint32_t frameIndex)
|
||||||
{
|
{
|
||||||
|
// Set line width first
|
||||||
|
cmdBuffer->SetLineWidth(LineWidth);
|
||||||
|
|
||||||
|
// Draw
|
||||||
const uint32_t FRAME_IDX = gfxSystem->GetCurrentFrameIndex();
|
const uint32_t FRAME_IDX = gfxSystem->GetCurrentFrameIndex();
|
||||||
cmdBuffer->BeginLabeledSegment("SHDebugDraw (Depth Tested)");
|
cmdBuffer->BeginLabeledSegment("SHDebugDraw (Depth Tested)");
|
||||||
{
|
{
|
||||||
|
@ -506,7 +514,6 @@ namespace SHADE
|
||||||
if (batch.NumPoints[frameIndex] > 0)
|
if (batch.NumPoints[frameIndex] > 0)
|
||||||
{
|
{
|
||||||
cmdBuffer->BindPipeline(batch.Pipeline);
|
cmdBuffer->BindPipeline(batch.Pipeline);
|
||||||
cmdBuffer->SetLineWidth(LineWidth);
|
|
||||||
cmdBuffer->BindVertexBuffer(0, batch.VertexBuffers[frameIndex], 0);
|
cmdBuffer->BindVertexBuffer(0, batch.VertexBuffers[frameIndex], 0);
|
||||||
cmdBuffer->DrawArrays(batch.NumPoints[frameIndex], 1, 0, 0);
|
cmdBuffer->DrawArrays(batch.NumPoints[frameIndex], 1, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -205,7 +205,7 @@ namespace SHADE
|
||||||
/// <param name="color"></param>
|
/// <param name="color"></param>
|
||||||
/// <param name="color">Colour to draw with.</param>
|
/// <param name="color">Colour to draw with.</param>
|
||||||
/// <param name="depthTested">Whether or not drawn object will be occluded.</param>
|
/// <param name="depthTested">Whether or not drawn object will be occluded.</param>
|
||||||
void WireCapsule(const SHVec3& position, const SHQuaternion& rotation, float height, float radius, const SHColour& color = SHColour::WHITE, bool depthTested = false);
|
static void WireCapsule(const SHVec3& position, const SHQuaternion& rotation, float height, float radius, const SHColour& color = SHColour::WHITE, bool depthTested = false);
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------------*/
|
||||||
/* Persistent Draw Function Class "Folder" */
|
/* Persistent Draw Function Class "Folder" */
|
||||||
|
@ -388,7 +388,7 @@ namespace SHADE
|
||||||
/// <param name="color"></param>
|
/// <param name="color"></param>
|
||||||
/// <param name="color">Colour to draw with.</param>
|
/// <param name="color">Colour to draw with.</param>
|
||||||
/// <param name="depthTested">Whether or not drawn object will be occluded.</param>
|
/// <param name="depthTested">Whether or not drawn object will be occluded.</param>
|
||||||
void WireCapsule(const SHVec3& position, const SHQuaternion& rotation, float height, float radius, const SHColour& color = SHColour::WHITE, bool depthTested = false);
|
static void WireCapsule(const SHVec3& position, const SHQuaternion& rotation, float height, float radius, const SHColour& color = SHColour::WHITE, bool depthTested = false);
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Clears any persistent drawn debug primitives.
|
/// Clears any persistent drawn debug primitives.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
Loading…
Reference in New Issue