Sounds like you’re almost there.
Now you just need create a material that has a “Texture Parameter” like this (taken out of some of my code for something else):
and in your c++ code, create an instance of the material, and pass in the render target texture like:
UMaterial* material=LoadObject<UMaterial>(nullptr,TEXT("Material'/Game/M_MyMaterial.M_MyMaterial'"));
if(material) {
matInstance=UMaterialInstanceDynamic::Create(material,nullptr);
matInstance->SetTextureParameterValue(TEXT("Texture"),renderTarget); // sets the "Texture Paramter" to the rendertarget
matInstance->SetScalarParameterValue(TEXT("Resolution"),res); // used to find texel size
}
There’s a “Resolution” paramter too to calculate the texel size.
You get best results if you set the interpolation type to 'Nearest Neighbor" too.
