mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-13 03:33:48 +00:00
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:
parent
13fb5cd5b9
commit
af14de2bb7
19 changed files with 626 additions and 12 deletions
|
|
@ -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());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue