So I have programitcally generated a texture that is needed by many many materials. I would like to make this texture “globally” available.
Ideally I would add it to a Material Parameter Collection and then all the materials that need it could just use that Material Parameter Collection (similar to glsl uniforms). However MPC only allows Scalar and Vector not a Texture.
This particular texture is of the form PF_R32_FLOAT:
UTexture* retVal = UTexture2D::CreateTransient(
SrcWidth,
SrcHeight,
PF_R32_FLOAT
);
So that may limit my options. I could iterate through each material and set this as a material parameter but that seems pretty ineffiecent, and then I would have to detect any newly created materials and add the parameter to those. How do I make this transient texture globally available , and how do I reference it in my materials?