Geometry Nodes: how to smoothen value transitions

Hello there!

is there any way one can smoothen the changing value of a variable parameter in Geometry Nodes?

A practical example:
I’m using the Raycast node to rotate objects on a water surface (generated with the Ocean modifier) and there are sometimes big jumps between two frames, when the edge of a wave passes under the object.

I understand that GN can’t look ahead, which would be needed for a proper smoothing calculation, but is there an elegant way to go around it by somehow comparing the size of a recent step change and limiting the range within a current change of value can happen?

Any tips are very welcome!
M

if you could provide blend file and/or node tree, it would be much easier to help you

I can make a set with just this issue, but the goal would be to make a more general node preset that could be used at various places.

Simple example is when tracking something with GN you are receiving the variable output of the tracking. And this output might have spikes that you need to truncate so that you can use this output as a driver for something else.

I was testing using Scale in Math Node, but since I have no control over how many decimals are being saved, it doesn’t do the job. Or at least not in my test.

you could e.g. use the map range node for this

If the map range alone is not enough you can smooth it out with a vector curve.

Could you elaborate on the use of the vector curve please?

I will test the map range. But there I imagine it needs to limit the range in a predicted way?

Ah, I can see, you might mean the Smooth Step in Map Range? I will look into that some more.

I mean the vector curve. Or perhaps using an rgb curve is easier because it has no negative component to it.
Try plugging one of the curves into your setup before the rotation node you are using to rotate your boat and make the curve smoother. In theory this should prevent the object from rotating too far in extreme cases.

If I have time tonight I might try it out.

Thank you. I have actually not used this node before and it’s a really interesting one, so I will play around with it. This is a really nice hint!