Does a texture have something like a tick-function?

there’s an example out there from a livestream about using materials for fluid dynamics. its a combination of using inputs from blueprints to render textures to simulate fluids on a surface. i’ll try to find it for you. this should help you move forward i hope.

Found it! looks very promising, I will watch it and see if it helps. Thank you!

Hi guys,
I need some help.

Context:

I have a Polygon (just a 2D-object in my own representation that doesn’t matter here) and I want to simulate heat in the polygon. So I want to be able to ask “How hot is the polygon at a given point?”. I figured to represent the heat I could use a greyscale texture, where brighter values mean hotter, and darker values mean less hot and apply that to the polygon without rendering it, just using it internally. The things that I need to do now are to:

  1. create a UV Mapping for the polygon (I think I can figure this out)

  2. apply the texture without rendering it (no idea)

  3. Calculate the new heat values each frame, where basically heat from a pixel in the texture can “spread” to other pixels. I basically want my texture to have a tick-function. I just have no idea where this would go. On the texture? On the material? Does the polygon (which is a component) need to take care of this? I know that you can animate textures/materials and I think I would basically want to do that, I just don’t know where.

In order to do the computation I need to access each pixel, get the values of the neighboring pixels and have some DeltaTime.

I hope you can help me with any one of these or point me in the right direction. This should be easy I guess, I just don’t have any expertise with materials yet. Thanks!

All i know is to suggest making everything you need as params, then referencing those from your blueprints and control those materials in realtime.

I am a bit on the backfoot here. Params to what? The polygon-component? the material? The texture? And how do I control a material in realtime? I know very little about working with materials, so a deeper explenation or documentation links are appreciated!

ok sorry. So what you need is to make the variables you want to control into parameters. Right click on the node and convert to parameter. This way you can adjust it in realtime. It would be good for you to try to get to know Material Instancing before you get into controlling blueprint right away, this will help you understand what is possible. Then from your blueprint actor or level blueprint, you can make variables to control those material instances. Think of it as creating a bread crumb trail of communication between nodes. Material parameters inside materials can be anything from vectors to scalar params to boolean and even texture selection.

Ok I read a bit through material instancing, and have one concern. Materials seem to be very explicitly meant as a graphics tool. I am trying to use it as data only. I would not even render the material once. Will the values even be calculated if the material is not applied to anything? I feel like I’m trying to use materials so out of context that it may be more complicated than just doing the thing itsself in code. I think that maybe I should not use a texture but simply a 2D array of values and compute everything in the tick function of the component.