begun adding uniform hooks

This commit is contained in:
Areloch 2017-10-07 14:36:58 -05:00
parent 512c4515fc
commit 5019478aad
3 changed files with 64 additions and 3 deletions

View file

@ -485,6 +485,8 @@ void Material::initPersistFields()
addProtectedField("customShaderFeature", TypeRealString, NULL, &protectedSetCustomShaderFeature, &defaultProtectedGetFn,
"Do not modify, for internal use.", AbstractClassRep::FIELD_HideInInspectors);
addProtectedField("CustomShaderFeatureUniforms", TypeRealString, NULL, &protectedSetCustomShaderFeatureUniforms, &defaultProtectedGetFn,
"Do not modify, for internal use.", AbstractClassRep::FIELD_HideInInspectors);
Parent::initPersistFields();
}
@ -516,6 +518,29 @@ bool Material::protectedSetCustomShaderFeature(void *object, const char *index,
return false;
}
bool Material::protectedSetCustomShaderFeatureUniforms(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);
if (index != NULL)
{
char featureName[256] = { 0 };
U32 id = 0;
dSscanf(index, "%s_%i", featureName, id);
String uniformName = data;
bool tmp = true;
}
return false;
}
bool Material::onAdd()
{
if (Parent::onAdd() == false)