I cache all parameters like this:
Dictionary<string, Vector3> _cachedVector3 = new Dictionary<string, Vector3>();
void SetValue(string key, Vector3 value) {
if (this._cachedVector3[key] == value) return;
//
this._cachedVector3[key] = value;
this.Parameters[key].SetValue(value);
}
I have the same code for Matrix,Vector4, float ect.
do you mean sorting meshes in each models or in the entire scene ?
I don’t sort them actually but it’s a good idea.
I don’t use MRT do you have some link where I can learn more about MRT ?