I am trying to edit post process materials dynamically but not able to do so till now…
I am adding the material to the playercamera then converting it to dynamic parameter but it doesn’t seem to be working.
Adding the material to the camera post-process bendable works. But I don’t think creating a UMaterialInstanceDynamic from the post process material seems to work.
FollowCamera->PostProcessSettings.Blendables.Add(PostProcessMaterial);
PostProcessDynamicMaterial->Create(Cast<UMaterialInterface>(FollowCamera->PostProcessSettings.Blendables[0]), this);
if (PostProcessDynamicMaterial)
{
PostProcessDynamicMaterial->SetScalarParameterValue("DesaturationParameter", 0.5);
}
Edit—
Forgot to use this
PostProcessDynamicMaterial = UMaterialInstanceDynamic::Create(PostProcessMaterial, this);