Ah, sorry, i got both this clamping and momentum thing wrong a bit. There is more logic then i thought, but i still don't know what's the purpose (maybe it's about getting distance estimates). If you don't know either, remove both of it and just set influence to the blurred result.
How to prepare an influence map to take the influence of obstacles into account
So I outcomment the Momentum and got something like that - kinda no changes.
But I guess Momentum is good to keep the “Memory” so it doesn't low so fast. So I need to figure out a good way.
So Delay is how far it spread and Momentum is for the memory of how fast it slows down.
None
freddynewtondev said:
But I guess Momentum is good to keep the “Memory” so it doesn't low so fast. So I need to figure out a good way. So Delay is how far it spread and Momentum is for the memory of how fast it slows down.
Maybe the purpose of momentum logic should be to increase ‘memory', while still allowing 'fastest' diffusion?
Not sure because form your code it's not clear what happens with maxInf and minInf outside the listed function. Seems like a global max/min over the entire grid. If so, notice it also changes while iterating, so you might want to use the value from the previous frame instead to have it constant within the update.
Another way to achieve presistent memory would be to check if influence is larger or smaller to zero. Even if no color is visible, tiny fractions of numbers should remain even with the decay.