Shader - Map UV to SCREEN_UV

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By CharlieGray

Hello everyone,

I’m currently trying to wrap my head around pixel position manipulation in shaders.
My situation is the following (I’m honestly not sure how much of that is relevant but I hope that’s enough information):
I have a Sprite with a Texture that is 500px x 500px (but scaled by 0.2).
This Sprite and with that the shader is not fullscreen.
And for this Sprite I have a shader that takes the UV value and manipulates it in some way. (It is supposed to do a swirl).

Now i have a modified UV Value and would like to read the SCREEN TEXTUTRE at this point,
but texture(SCREEN_TEXTURE, uv) needs the SCREEN UV and not the UV.

Is there any way to transform my UV to SCREEN_UV so i can read the correct pixel?

Alternatively:
Is there a way to get the size of the screen and the size of the shader in pixels?
Then I can calculate this transformation myself.
I tried to get the sizes in pixels with SCREEN PIXEL SIZE and TEXTURE PIXEL SIZE (as well as doing several calculations with that) but i can’t get it to work.

I hope i made myself clear enough and any help or pointers are greatly appreciated.