Add Quad Overdraw debug view mode

This commit is contained in:
Wojtek Figat
2021-10-07 14:59:06 +02:00
parent 949766e3a0
commit 1af5ec8492
22 changed files with 473 additions and 5 deletions

View File

@@ -201,7 +201,7 @@ void ParticleMaterialShader::Unload()
bool ParticleMaterialShader::Load()
{
_drawModes = DrawPass::Depth | DrawPass::Forward;
_drawModes = DrawPass::Depth | DrawPass::Forward | DrawPass::QuadOverdraw;
GPUPipelineState::Description psDesc = GPUPipelineState::Description::Default;
psDesc.DepthTestEnable = (_info.FeaturesFlags & MaterialFeaturesFlags::DisableDepthTest) == 0;
psDesc.DepthWriteEnable = (_info.FeaturesFlags & MaterialFeaturesFlags::DisableDepthWrite) == 0;
@@ -210,6 +210,17 @@ bool ParticleMaterialShader::Load()
auto vsMesh = _shader->GetVS("VS_Model");
auto vsRibbon = _shader->GetVS("VS_Ribbon");
#if USE_EDITOR
// Quad Overdraw
psDesc.PS = _shader->GetPS("PS_QuadOverdraw");
psDesc.VS = vsSprite;
_cacheSprite.QuadOverdraw.Init(psDesc);
psDesc.VS = vsMesh;
_cacheModel.QuadOverdraw.Init(psDesc);
psDesc.VS = vsRibbon;
_cacheRibbon.QuadOverdraw.Init(psDesc);
#endif
// Check if use transparent distortion pass
if (_shader->HasShader("PS_Distortion"))
{