UE4: SubUV node

Hey all! I’ve been doing some experiment in UE4 over the weekend using a looping fire texture, but I’ve run into a two problems that I was hoping somebody had some more insight on :slight_smile:

1: I’ve been trying to distort my fire texture (A simple spritesheet, 8x8) by plugging some panning noise into the Particle SubUV nodes “UVs” input to make the fire more lively. However, Unreal seems to completely ignore whatever input goes into it. Does Particle SubUV not accept UV input, or is there some kind of toggle I need to check?

2: Since my texture can endlessly loop, I’m using the “SubUV movie” node to control the framerate of it in Cascade. Currently I’ve set it up using a constant curve with the framerate being set to 24 FPS at spawn and 12 FPS by the end of the particles lifetime. This works fine when I try it - The framerate starts at 24 FPS when the particle spawns and then steadily slows down to 12 FPS as it should.

However, I would like to introduce additional randomness into the effect by randomizing my starting frame. But when I try to randomize my starting frame by setting the “starting frame” parameter to 0, the framerate appears to break completely and it just seems to jump to random values during the duration of the effect. This seems like something you would usually solve by checking the Spawn Time Only box, but I can’t find that option on the SubUV Movie node. Any ideas?

1 Like

so the ParticleSubUV node is a special Texture node that overrides the UV input to allow frame blending in casade. You know the Interpolation option Linear Blend instead of Linear in the Required module? This is what allows it to do the blending. As such you can’t use it in conjunction with UV distortion (i presume its hardcoded to blend 2 uv’s together so that input pin just gets ignored) If you use a normal Texture node then your shader logic should work as normal. Generally the extra visual quality for flipbooks you get from the blending isnt super important these days as we can afford larger flipbook textures with more than 9 or 16 frames.

As for using a constant curve for your flipbook - it may look like it’s working properly but it probably isnt - in my quick test i was getting the flipbook reversing direction when changing it over time. Basically any time you’re trying to dynamically change the speed of something in Unreal it’s a pain due to how most things loop over time (ie panners or flipbooks) - unfortunately Time and Time+delta Time aren’t next to each other in the loop so you get that flickering.

I totally agree that there should be a Spawn Time Only option but currently it’s only the Dynamic Parameters Node that has that - currently there’s no way to do a range of frame rates in cascade without duplicating the emitter.

The solution i tend to use for this sort of problem is to move all the logic to the shader. With the Flipbook material function its very easy to set up a Dynamic Parameter to be your Speed multiplier and then you can use the Spawn Time Only option. As for slowing down over time, depending on the flipbook you can just lerp from a fast one to a slow one in the shader, but you have to do this after you’ve applied time to the flipbook.

Hope that helps!

SubUV node, to my knowledge, is the only one of the two that will properly run through a sequence on meshes too.

I have to disagree with you a bit here. From my experience blending can get very important for flipbooks, even for the players. You don’t just have endless resources at your disposal usually. And even then if you can lower the amount of frames required for the desired animation you can up the resolution of each frame. Motion-vector based frame blending can be very beneficial in some scenarios to preserve resolution and a neat thing about it is that you can just quality-switch it out for other specs.

In any case I’ve had the best results when building all of the blending myself in the material aswell like you were saying. If you need more “Spawn Time Only” parameters you can use the color modules in Cascade, and use them as data in the material. Then you just drive the actual color through a material instance instead. That should usually be good enough for things like fire.

or, if you can afford it, use one of the dynamic outputs to control a hueshift.
that way you can use the whole particle color node & module for other things.

And regarding the distortion you can check out one of the YouTube tutotials Bill Kladis did. It was a class about UDK fires and it had UV distortion.

1 Like