Set Texture Parameter Value Not Working for Dynamic Material Instance in Blueprints

I’m trying to create a system similar to power washing simulator where you can use render targets to change the material at runtime to represent what you’ve washed and what is still dirty. The problem is I am going to have multiple instances of the same mesh using the same material so I can’t use a standard material instances unless I wanted to create a lot of duplicate blueprints and materials.
Following a tutorial on youtube I am able to make it work the standard way where I create a render target in the content browser and apply it directly to the material.




But when I try to create a render target in blueprints and then apply it to the dynamic material instance it doesn’t work.

It just uses the original render target I created in the content browser instead of the newly created one.

I eventually thought that maybe I just needed to apply the Dynamic Material Instance to the static mesh again but when I do that the static mesh becomes transparent.
Here’s the Blueprint

And here is what happens to the mesh.


I can’t for the life of me find out how to do this anywhere online without it just saying to create a new render target or material instance. Again I could have dozens of the same mesh and they each need their own dynamically created render target for the effect.

It possible the material param is not accepting the canvas render target, try to replace it with this node:
image

*Make sure the material is properly setup as well like parameter name.

Same issue as before, doesn’t seem to properly set the texture parameter in the Dynamic Material Instance properly.
Here’s the materials I’m using for the painting functionality.



And then here’s the blueprint code again.


I tried to do it both with and without setting the Static Mesh material to the Dynamic Material Instance and both ways it has the same issues as before. Doesn’t work full stop when I don’t apply the Dynamic Material Instance to the Static Mesh and the mesh turns invisible when I do.

Edit: I just used a print string to check the memory size of both the generated render target and the RenderTarget Texture Parameter within the Dynamic Material Instance and they are the same whenever I change the Render Targets resolution so the parameter is being applied to the Dynamic Material Instance, but for some reason that is not coming through on the static mesh unless I apply the material to the static mesh after the fact which results in the mesh becoming transparent.

I’m dumb. I had accidentally been trying to apply the Marker material to the mesh instead of creating a separate dynamic material instance for the static mesh’s material. Simple fix. Everything works now.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.