Material Panner with parameter value goes too fast when changing

[Video explanation][1]

Update 1: [Video with more information of problem][2]

Update 2:
I see the problem now, the panner node doesn’t increment offset every tick based on current speed.
I checked the code, and the panner just calculates offset = time * speed

Arg2 = Compiler->PeriodicHint(Compiler->Mul(TimeArg, SpeedYArg));

This is still problematic for me, however I’ll just find another way around this.
So I’m unsure if this is a definite BUG, or just efficient behavior.

Edit 3: UE-45602 [link][3]

Material:
Panner uses parameter value SpeedY


Level Blueprint: Update material instance with scalar parameter SpeedY from timeline


Timeline: Ranges from 0 - 2


Level: Fly into trigger area to see bug


With this setup, while the timeline is updating the SpeedY value, the texture flies all over the place. Refer to the video link at the top for demonstration.

Hello ,

I believe this is working as intended. The reason you are getting the flickering is because when you update the value of the panner, it resets but it also is moving because you are setting a value. This constant updating causes the flickering you are seeing, and why it the flickering stops when the timeline is finished.

Cheers!

Hey ,

I could understand if it was resetting every time, that would cause the flickering. To test, I slowed down the timeline to 5 seconds. and found, that this was not the cause. I made an updated video and linked it above. It appears that it has to do also with current game time.

Hello again ,

I have submitted a bug report for this issue on your behalf, which you can view here:

You can track the report’s status as the issue is reviewed by our development staff. Please be aware that this issue may not be prioritized or fixed soon.

Thanks !
if you check above, I’ve Identified why this behavior happens in the code. I don’t think there’s a way to rewrite this without reducing performance, or precision.
I think the way it is currently implemented is efficient for designers who don’t want the pan speed to change. It would be better if the Panner node perhaps had a Dynamic speed option that used cumulative tick based offset. This might be a tiny bit less precise due to floatingpoint fun, but would be a good solution IMO.

1 Like

Very late to the party but I have come across this issue also. I tried also staying away from using a timeline to see if I could work a way around it but still had the flicker. I used “Set Timer by Function name” and still got the issue when looping.

I had updated my post with the problem.
The Panner node is not meant to have its speed change dynamically.
The way it calculates the UV offset is based on elapsed time and speed.
If the speed is to be dynamic, then you can’t use the Panner node, and must instead calculate the offset in a bp, and set the offset values.

Looking at your bp code: Don’t create a dynamic instance each time the function is called. Create that dynamic instance once, then just store a ref to it for later. Maintain a float for current offset, then OnTick, or in TimeLine increment the offset by speed * deltatime and set the parameter on the material instance ref.

Hello,

I think you mistake on Panner function. It must be used with a constant speed, because the time value used for the function is the global time (not a time increased according to the speed and delta time).

For example : if you start your game since 45s and you change your speed from 0.1 to 0.12, it will involuntarily increase the offset of your TexCoord from (0.12 - 0.1) x 45 (and the scrolling will be faster).

The only way to do what you want is to manually increase a time parameter (and not using Time function).

Panner function explanation

Custom Panner function

Dynamic speed blueprint code

2 Likes

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