daniilidis-group / neural_renderer

A PyTorch port of the Neural 3D Mesh Renderer
Other
1.12k stars 248 forks source link

What does zp in the rasterize_cuda_kernel.cu stands for? #98

Closed ZhengWenSEC2023 closed 3 years ago

ZhengWenSEC2023 commented 3 years ago

Hi,

Thank you for the nice work. I'm learning the package and wants to extract some features and add to another work, I notice that in the z-buffering algorithm, the zp is used to compare with the z_buffer, as shown in the following:

        if (zp <= near || far <= zp) {     // why?
            continue;
        }

        /* check z-buffer */
        if (zp < depth_min) {
            depth_min = zp;
            face_index_min = fn;
            for (int k = 0; k < 3; k++) {
                weight_min[k] = w[k];
            }
            if (return_depth) {
                for (int k = 0; k < 9; k++) {
                    face_inv_min[k] = face_inv[k];
                }
            }
        }

So I'm wondering what does zp stand for? the inverse depth from the expression? If so, I think the zp < depth_min means that the depth of z is actually deeper than depth_min? I'm kind of confuse. Any help would be appriciated! Thank you!