Download

how to define global MaterialExpression

how can I setup custom global material expression modifiable at runtime (like CameraPositionWS)?

still wonder if it is possible.

and was able solve problem in hands with MaterialInstances and MaterialParameterCollections.



..
global_mpc = new ConstructorHelpers::FObjectFinder<UMaterialParameterCollection>(TEXT("material_parameter_collection_path"));

..
mega_material = LoadObject<UMaterial>(this, TEXT("mega_material_path"));
material_instance = UMaterialInstanceDynamic::Create(mega_material, this);

..

SetMaterial(0, material_instance)
..

UKismetMaterialLibrary::SetVectorParameterValue(GetWorld(), global_mpc->Object, TEXT("value_name"), FLinearColor(val_0, val_1, val_2, val_3));