Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Icosphere normals generation seems buggy #175

Open
lelouedec opened this issue Jan 12, 2022 · 0 comments
Open

Icosphere normals generation seems buggy #175

lelouedec opened this issue Jan 12, 2022 · 0 comments

Comments

@lelouedec
Copy link

lelouedec commented Jan 12, 2022

Hi,
I am trying to use redner for differential rendering from some parametric model I am building for fruits.
I need to use the mesh normals to displace the surface. So I have tried using
vertex_normals = pyredner.compute_vertex_normal(vertices,triangle_list)
But I end up with the following normals (set as colors for the mesh,displayed with trimesh):
image
Here is a comparison with the same mesh (modeled then saved) in blender with the normal as color for the shader:
image

On the left an icosphere from blender (same base as my mesh) and on the right an UV sphere.
Any idea what could be the problem ? I am just doing the following :

  modifier = shape_basis @ shape_coeffs
    vertices = shape_mean.clone() + modifier.view(-1, 3)
    R = pyredner.gen_rotate_matrix(pose)
    vertices = torch.matmul(vertices,R)
    vertex_normals = pyredner.compute_vertex_normal(vertices,triangle_list)

vertices and triangles faces are the same in the redner generated normals and in the blender one.
EDIT:
However if I display the mesh with open3d with the same vertices, triangles and colors as normals I get the correct values :
image

Cheers
Justin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant