Download

Dynamic Materials with Scalar, Vector, and Texture Parameters

I want to have a lot of meshes in my scene using dynamic materials. Since this is a forest environment, I was hoping to use the foliage tools to layout everything. However, I have discovered that I cannot use DMIs on foliage instances. For people wanting to alter textures on foliage instances, we are told to use Material Parameter Collections. This is fine for most of the parameters I’m changing on the dynamic material, all but one of which are scalars and vectors. However, one material parameter I need to change dynamically is a texture coming from a Canvas Render Target 2D. Since Material Parameter Collections cannot take a texture as a parameter, this means I cannot use the foliage tool, correct?

So it seems to mean that I’m going to have to hand place all the meshes in the scene, which is going to be time consuming. Is there an alternative method? In terms of performance, what is the best approach to something like this?

I think you can do it with some procedural foliage blueprint.
For example, you can place it by some kind of tracing algorithm and assign MID to it.
Then manipulate textures in that blueprint.

Can you explain in a bit more detail what you mean?
Do you just mean using some method for calculating position in a BP and then adding meshes?

You can do this quite easily with blueprints. You start by making new blueprint that inherits FoliageInstancedStaticMeshComponent. Then you can set material for your foliages from that blueprint.
Edit: There is Component class named variable at foliage settings. Set that to your new blueprint class.

Yes, you can use tracing to get some random world locations and set spawn foliage meshes there.
Read here for examples