When a define mapped parameter is “set”, the shader gets recompiled only if the value has changed. So if we have:
MaterialDef TeamBar {
MaterialParameters {
Float param1
}
Technique {
...
Defines {
PARAM1_IS_SET : param1
}
}
}
The shader will be compiled whenever the param1 changes it value instead of just being compiled if the param is set/removed.
So my question is: is it possible to do it work like?:
MaterialDef TeamBar {
MaterialParameters {
Float param1
}
Technique {
...
Defines {
PARAM1_IS_SET : param1 != 0
}
}
}
So the shader only gets compiled if the condition (PARAM1_IS_SET) changes it value (being this one based on if the param param1 is != 0)?