Skip to main content
Answer partly found
Source Link

I found how to get distances from depth texture, so basically I can answer this question, but there is still unexplained bias in measurements.

I found how to get distances from depth texture, so basically I can answer this question, but there is still unexplained bias in measurements.

added 127 characters in body
Source Link

I Blit then these values from renderTexture to texture2D and use function GetPixel(i,j). Knowing, that a cube is at 1.5 units distance from camera I can't get this value from depth texture. Thank you for your help. Now I suspect that I have got distance values, but they are biased by 0.5 for some reason... Can anyone explain this as well?

I Blit then these values from renderTexture to texture2D and use function GetPixel(i,j). Knowing, that a cube is at 1.5 units distance from camera I can't get this value from depth texture. Thank you for your help.

I Blit then these values from renderTexture to texture2D and use function GetPixel(i,j). Knowing, that a cube is at 1.5 units distance from camera I can't get this value from depth texture. Thank you for your help. Now I suspect that I have got distance values, but they are biased by 0.5 for some reason... Can anyone explain this as well?

added 1 character in body
Source Link

I am new in Unity and now only studying for my work project. I need help with comutingcomputing real distances from depth values. Can't figure it out. My shader is:

I am new in Unity and now only studying for my work project. I need help with comuting real distances from depth values. Can't figure it out. My shader is:

I am new in Unity and now only studying for my work project. I need help with computing real distances from depth values. Can't figure it out. My shader is:

Source Link
Loading