Implements a Material Instance viewer to the material editor to see a feature-filtered dump of the generated shaders for a given material.

This commit is contained in:
Areloch 2019-05-17 01:48:45 -05:00
parent 13fb5cd5b9
commit af14de2bb7
19 changed files with 626 additions and 12 deletions

View file

@ -44,7 +44,7 @@
// We need to include customMaterialDefinition for ShaderConstHandles::init
#include "materials/customMaterialDefinition.h"
#include "gui/controls/guiTreeViewCtrl.h"
#include "ts/tsShape.h"
///
@ -1421,3 +1421,26 @@ void ProcessedShaderMaterial::dumpMaterialInfo()
Con::printf( " [%i] %s", i, shader->describeSelf().c_str() );
}
}
void ProcessedShaderMaterial::getMaterialInfo(GuiTreeViewCtrl* tree, U32 item)
{
for (U32 i = 0; i < getNumPasses(); i++)
{
const ShaderRenderPassData* passData = _getRPD(i);
if (passData == NULL)
continue;
char passStr[64];
dSprintf(passStr, 64, "Pass Number: %i", i);
U32 passItem = tree->insertItem(item, passStr);
const GFXShader * shader = passData->shader;
if (shader == NULL)
tree->insertItem(passItem, "[NULL shader]");
else
tree->insertItem(passItem, shader->describeSelf().c_str());
}
}