I am working on some special case cubemaps. I have single materials (applied to numerous meshes) that I would like to change their cubemap texture at runtime. I have read that UMaterialInstanceDynamic is the way to go, but I would prefer just to modify the UMaterialInstance (a UMaterialInstanceConstant) as I have easy access to the material (as opposed to all the meshes).
I’ve looked through the UMaterialInstanceDynamic (in game) and UMaterialInstanceConstant (in editor) and they both eventually call UMaterialInstance::SetTextureParameterInternal when attempting to modify the texture at their appropriate runtime (game/editor). So I commented out the #if WITH_EDITOR in UMaterialInstanceConstant and my tests indicate that forcing UMaterialInstanceConstant to call SetTextureParameterInternal (both in editor and in game) results in the texture being changed as I desired.
The question I have is why is UMaterialInstanceConstant only a WITH_EDITOR class when the various set parameters actually work in game?
Any ideas?