I’m trying to map the camera frustum into a 3D texture so i can access the world-space position of each thread in the compute shader.
I thought this should work when looking at the 3D texture as if it is in clip-space, then transforming it to world-space with the inversed projection- and worldTransform-matrices.
It works with the current near an far clip values, however when adjusting these the thing breaks.
Could anyone explain what is going wrong?
Thanks in advance,
frustum_to_3Dtexture.tox (55.1 KB)