mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-17 13:43: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
54b4d2eaaf
commit
2479d388f2
19 changed files with 626 additions and 12 deletions
|
|
@ -37,6 +37,8 @@
|
|||
#include "core/util/safeDelete.h"
|
||||
#include "ts/tsShape.h"
|
||||
|
||||
#include "gui/controls/guiTreeViewCtrl.h"
|
||||
|
||||
class MatInstParameters;
|
||||
|
||||
class MatInstanceParameterHandle : public MaterialParameterHandle
|
||||
|
|
@ -591,3 +593,35 @@ void MatInstance::dumpShaderInfo() const
|
|||
|
||||
mProcessedMaterial->dumpMaterialInfo();
|
||||
}
|
||||
|
||||
void MatInstance::getShaderInfo(GuiTreeViewCtrl* tree, U32 item) const
|
||||
{
|
||||
if (mMaterial == NULL)
|
||||
{
|
||||
Con::errorf("Trying to get Material information on an invalid MatInstance");
|
||||
return;
|
||||
}
|
||||
|
||||
if (mProcessedMaterial == NULL)
|
||||
{
|
||||
Con::printf(" [no processed material!]");
|
||||
return;
|
||||
}
|
||||
|
||||
const FeatureSet features = mProcessedMaterial->getFeatures();
|
||||
|
||||
String featureDesc = "";
|
||||
for (U32 i = 0; i < features.getCount(); i++)
|
||||
{
|
||||
const FeatureType& ft = features.getAt(i);
|
||||
|
||||
featureDesc += ft.getName();
|
||||
|
||||
if(i+1 < features.getCount())
|
||||
featureDesc += ", ";
|
||||
}
|
||||
|
||||
U32 newItem = tree->insertItem(item, featureDesc);
|
||||
|
||||
mProcessedMaterial->getMaterialInfo(tree, newItem);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue