I hope you can help me. I’m working on an occlusion mask. I have a masked material and want to cut out a sphere around the player, fairly simple. I write the player location in a MaterialParameterCollection and I use that in my material.
The issue: The mask is offset, when I view it at an angle. If the player is in the center of the screen it’s fine, but the further the player is at the edge of the screen the more the cut out is offset to the player position.
I still don’t know what exactly caused the issue, but I found a solution. I guess the issue has to do with FOV warping the image (specially at the edges), thus leading to the wrong position of the sphere, but I’m not sure.
The solution was instead of using a transform (world to view space), I use a substraction and normalize that to get the correct location. (Set the Radius = 400 and Hardness = 100!)