Skip to content

Icosphere normals generation seems buggy #175

Description

@lelouedec

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions