How to create a normalized Z-Depth pass

   202   0   0
User Avatar
Member
42 posts
Joined: Feb. 2016
Offline
Hello, I am new to Solaris and Karma, I've been trying to find out how to create a normalized depth pass.

I saw one old post [www.sidefx.com] where the following is said:
"If you'd like you can attempt your own encoding in a shader to mimic the output of another renderer, such as 1/z or e^z or use the perspective transformation:"
export float @depth = 0.0;
float z = -Pz;
float w = -z;
float near = 0.1 // near plane
float far = 1000.0 // far plane
z *= -far/(far-near);
z += -far*near/(far-near);
z /= w;
@depth = z;

As a beginner, I was hoping someone could explain to me how to create such a shader (in what context?) and how to apply it in a way as that it would yield an AOV.
Edited by NNNenov - May 11, 2024 16:07:44
  • Quick Links