Really I read all the articles (position from depth etc.) and tried all the built-in shader uniforms and their inverses and their inverse transposes and read the previous threads and I still can’t get the world-position from view-space position, it should be so freaking simple… pulease, someone HALP… ![]()
I am in post-process and each pixel has a view-space (aka clip-space aka eye-space aka camera-space) position with x,y,z all ranging exactly from -1 to 1. No matter the camera rotation or positioning or field-of-view or draw-distance, in cam-space/view-space, all pixels are in the [-1…1] range for every rendered frame. For z of course everything less 0 is behind the camera so pixels effectively range camPos.z from 0…1.
So this is just bog-standard view-space, no magic, nothing special. I’m passing into the shader the camera’s cameraToWorldMatrix and that really should be enough and handle perspective divide and viewer rotation and what not and everything, shouldn’t it? Because cam-space is -1…1 always, and world-space is -infinity…infinity.
Well doesn’t work for me. What’s the deal and why do I keep hearing about “inverse view-projection” matrices etc. I have valid and double-triple-checked 3D coordinates in one space [-1…1] and the documented cam2world matrix should be enough to translate them into valid 3D coordinates in the desired goal space. Drives me bonkers!.. :mrgreen: