Reset Chromatic Aberration after resize?

I’ve noticed while trying to host a project on itch.io that if you start a scene small and then scale it up, the chromatic aberration effects distortion gets super heavy.


You can see here when its small that there is barley any displacement on the aberration. Which is the same as if you start it scaled up.

Everything is very subtle.

Then if you scale it up.

It blows everything out.

Ive tried forcing the re computation of the effect, tried resizing it, tried disabling and then next frame enabling… Not sure what the fix for it would be.

Was messing around with a PG I found from a different post:

And I have it staying consistent between resizes now, but I cant get it to be the same size when you first load the page at different sizes.

Forcefully recreating it seems to work, but that seems like a silly solution…

1 Like

here’s a version that’s resistant to resolution change : )

1 Like

I feel like maybe this should be the default shader code for the effect?

1 Like

not really, the current code let’s you define it in px which I think is more intuitive.

you can also keep it constant like this,

just use the aberrationAmount variable instead of the designated attribute. the shader change from earlier and this are equivalent : )

2 Likes

I really like where your mind is at, thank you good input.

1 Like