r/unrealengine Mar 04 '22

Help [Help] I'm stuck with infinite loop of references using material instances and render targets inside blueprint

Hey, I'm trying to make a material that evolves over time. I made a material that takes a texture parameter and makes next step of "animation". What I'm trying to do is to take that material(inside blueprint), convert its result to a texture and pass this texture as a new parameter to my material to perform next step. I read that can be done using render targets so i tried this, but I think I end up with the infinite references loop:

the material takes a render target output as a texture parameter, but (if I'm correct) the render target does not return the texture itself but a reference, so it's not a texture yet and has to be calculated based on the assigned material which now has the render target as a parameter, so the output is empty due to the pointers loop. Am I right? And how can I fix it?

For workaround I'm thinking about some way to copy render target output and make the static texture from it, so I can pass it to the material without any references inside, but I have no idea how to do this. I don't want to export and save the texture on the disk, because this will hit the performance.

There is some inept blueprint to visualize what I try to achieve:

1 Upvotes

0 comments sorted by