Closed lefreud closed 5 months ago
Hi there, reply from Zhengqin:
That's an interesting observation. Instead of checking if z value is smaller than 0, we should see if the cosine angle between the ray of that pixel and normal direction is smaller than 0. Please take a look at the rendering code here: https://github.com/lzqsd/OptixRenderer/blob/3eafda5b4f47c7e44be7fc58cde215a8c1c2bc1a/src/optixRenderer/src/material/normal.cu#L66
negative z value does not necessarily mean the normal direction is not correct.
Perfect, I understand, thank you!
Hi,
I am trying to understand why, after loading images like this:
The normals' z coordinate (in camera view) is sometimes positive, which shouldn't happen. Here's an example, the orange part of the couch has RGB value of around (249, 148, 97). The blue channel of 97 means a z value of -0.239 (negative doesn't make sense).
(mainxml/scene0002_00/imnormal_28.png) Is the calculation for the
z
axis correctly done? I'm wondering if it might be due to a different calaculation at render time (e.g. different z scale or rotated normal map).For context, here's the slide I found explaining the
normals
part of the dataset:Thank you!