What is the pixel direction in a post process material?


In a post process material, what would be the simplest way to construct the ray cast from the camera position and hitting the near plane at the current pixel coordinates? (in view space or in world space)

If I am correct, creating it requires knowing the horizontal and vertical FoV as well as the horizontal and vertical center offsets (for stereo rendering; anything else I missed?). Those might be exposed already but I haven’t found them, and I’d prefer to double check before implementing something that was already there.

I believe that Normalize(WorldPosition - CameraPositionWS) in the material should give you what you need.

If not, give me a shout and I will look more closely.

Oh I didn’t realize both were available in post-process materials. Great!
For some reason I had to invert UVLayoutToWorldSpacePosition, but other than that it worked. Thank you.