I’m trying to animate a volume texture material by using a sequence of volume textures. The problem is that I can’t find a way to input anything other than a single image into a volume texture. I’ve created a media texture, a flipbook, and a render target but none of them are able to be pumped into the input of a volume texture. Anyone got a creative way of solving this problem?
screenshots here Imgur: The magic of the Internet
I currently have the same task.
I have a thousand 8k volumetric timesteps of a cyclone simulation and want to load them into the volume texture as an animation. This is currently only possible with workarounds. [This is my current work in progress solution][1], but since I can animate around 200 timesteps already I’ll tell you how I did it and how I think you should be able to animate any number of timesteps.
I use a material with a texture parameter of the texture you want to change. You then create an actor blueprint that creates a dynamic material instance of your material. Set the new dynamic material, where you want it, I use the volumetric cloud component, but your cube works as well.
You also need the series of volume textures. If you only have a few it is possible and faster to load all of them in your memory using a list of volume textures in the actor for example. If like me you can’t because it’s bit to large, then I currently don’t have a working prototype, but what I’m trying is using soft object references and the garbage collector to only the instances I currently use. I’m trying something similar using the Asset Manager with loading and unloading. But as far as I understand it the editor never unloads anything you ever loaded in a session, so I don’t know yet, if this works.
For the actual animation you create a delayed for loop (you have to build that yourself, because you can’t delay the inbuild for each loop) and set the texture parameter value of your dynamic material to the next volumetric texture in your series. For me I have a pretty slow animation so use a timeline and in the material a lerp between two volume textures and once I am 0 or 1 of the lerp, I exchange the currently invisible volume texture.
I’m new to unreal engine and there is probably a more elegant solution to this. I hope this helps you.
[1]: 201229_reddit_promo.mp4 - Google Drive
Update: I build a working prototype with the assetmanager and the build project only has 250mb of ram usage at all times. Meaning the assets get unloaded properly.