mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-13 03:33:48 +00:00
Changes for get necesary sampler names for OpenGL shaders.
This commit is contained in:
parent
79e158d528
commit
1ac8fab884
11 changed files with 155 additions and 23 deletions
|
|
@ -138,9 +138,22 @@ bool CustomMaterial::onAdd()
|
|||
return false;
|
||||
}
|
||||
|
||||
mSamplerNames[i] = entry->slotName + dStrlen(samplerDecl);
|
||||
mSamplerNames[i].insert(0, '$');
|
||||
mTexFilename[i] = entry->value;
|
||||
// Assert sampler names are defined on ShaderData
|
||||
S32 pos = -1;
|
||||
String samplerName = entry->slotName + dStrlen(samplerDecl);
|
||||
samplerName.insert(0, '$');
|
||||
mShaderData->hasSamplerDef(samplerName, pos);
|
||||
|
||||
if(pos == -1)
|
||||
{
|
||||
const char *error = (avar("CustomMaterial(%s) bind sampler[%s] and is not present on ShaderData(%s)",
|
||||
getName(), samplerName.c_str(), mShaderDataName.c_str() ));
|
||||
Con::errorf(error);
|
||||
GFXAssertFatal(0, error);
|
||||
continue;
|
||||
}
|
||||
mSamplerNames[pos] = samplerName;
|
||||
mTexFilename[pos] = entry->value;
|
||||
++i;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue