UI elements blocking mouse input on 3d objects in the world

I added a pixelated effect to my horror game using a Raw Image with a low resolution render texture that gets output from the camera, something i saw online.

The thing is because the Raw Image is a UI element it is blocking any mouse input on 3d objects. Because of that i cant use OnMouseOver, OnMouseDown or similar methods to interact with objects in my game, and those work completely fine without the Raw Image.

I have tried a bunch of things that worked for other people like disabling Raycast Target or adding a Canvas Group and disabling Blocks Raycasts and Interactable but for some reason it wont work with me.

You can set PickingMode of a VisualElement to Ignore to allow mouse clicks to pass through the element.

That does not work with hovering a cursor over the element though. I actually made a custom MouseHandler class to solve this (and other issues). There I track the mouse position each frame and check what GameObjects are under the cursor by raycasting. I set the raycast to ignore the UI layer.
I check every game object hit by the raycast if it’s MonoBehaviour script has a custom OnMouseOver method and call it if so. (For this check I implemented a custom IMouseHandled interface incl the OnMouseOver method.)

If you want a sample code just say so but that could take one or even two days.