Incrementing a value in update causes jittering

+= a value in update jitters in browsers - Chrome/Edge etc - using attached script to animate UVs on an object, see a snippet below but this seems to jitter

    speed?: number = 0.005;
    update(){
        // @ts-ignore //
        this.mainMaterial.normalMap.offset.y += this.speed;
    }

I will dm @marcel :cactus: a private url to see
AnimateUV.ts
jitterbug.gif

Original Post on Discord

by user 103054507105067008

The plane is just a simple unity URP lit material which I animate the UVs of

by user 103054507105067008

you should usually multiply stuff like that using deltaTime

Using this.context.time.deltaTime still has jitters
AnimateUV.ts

by user 103054507105067008

Looks a bit like two scripts try to modify the same value

It is 1 script, I’ll make a simple repro to verify

by user 103054507105067008

There are 2 overlapping water planes for this effect but they are separate objects and scripts

by user 103054507105067008

And separate materials?

Yes, 2 totally separate materials

by user 103054507105067008

Here’s a tiny repro

by user 103054507105067008

I wonder if it is a floating point issue with the UVs of the plane but the UVS are very simple and the texture is tiling, it seems to jitter in rectangular shaped regions

by user 103054507105067008

BugreportWater.zip

by user 103054507105067008

Are you just incrementing all the time? Does the jitter get stronger over time?

Just incrementing all the time in update if you see the example script above, the jittering is very noticeable always

by user 103054507105067008

    update(){
        // @ts-ignore //
        this.mainMaterial.normalMap.offset.y += (this.context.time.deltaTime * this.speed);
    }

this.speed is just a number that doesn’t change

by user 103054507105067008

Does it happen with other maps than the normal map? I’ve seen specifically issues with three.js and animating normal map parameters (e.g. also flickers when animating normal strength)

I will try the main texture albedo slot and feed back, that could be helpful to know

by user 103054507105067008

If it repros let me know :slightly_smiling_face:

Confirmed still happens with albedo map

by user 103054507105067008

So with the normals I noticed this jiggling square, the geometry was a grid so it lined up with the polys despite the UVs being simple

by user 103054507105067008