mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-12 19:31:41 +00:00
Initial implementation of Custom Shader Features.
This commit is contained in:
parent
f9b7f66571
commit
dc5e502dec
12 changed files with 595 additions and 9 deletions
|
|
@ -483,6 +483,9 @@ void Material::initPersistFields()
|
|||
|
||||
endGroup( "Behavioral" );
|
||||
|
||||
addProtectedField("customShaderFeature", TypeRealString, NULL, &protectedSetCustomShaderFeature, &defaultProtectedGetFn,
|
||||
"Do not modify, for internal use.", AbstractClassRep::FIELD_HideInInspectors);
|
||||
|
||||
Parent::initPersistFields();
|
||||
}
|
||||
|
||||
|
|
@ -500,6 +503,19 @@ bool Material::writeField( StringTableEntry fieldname, const char *value )
|
|||
return Parent::writeField( fieldname, value );
|
||||
}
|
||||
|
||||
bool Material::protectedSetCustomShaderFeature(void *object, const char *index, const char *data)
|
||||
{
|
||||
Material *material = static_cast< Material* >(object);
|
||||
|
||||
CustomShaderFeatureData* customFeature;
|
||||
if (!Sim::findObject(data, customFeature))
|
||||
return false;
|
||||
|
||||
material->mCustomShaderFeatures.push_back(customFeature);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Material::onAdd()
|
||||
{
|
||||
if (Parent::onAdd() == false)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue