pytorch3d icon indicating copy to clipboard operation
pytorch3d copied to clipboard

How to solve shadows that appear in rendering

Open Frq-F opened this issue 2 years ago • 3 comments

When I used Pytorch3D to render the tooth model, shadows appeared, making some teeth unable to be clearly displayed. Where should I modify and remove shadows? I tried three types of light sources to render, but I found that none of them could solve this problem. As shown in the figure below, the teeth in the upper left corner are shaded, and the shape of the teeth is not clearly rendered.

U_final

Frq-F avatar Nov 13 '23 02:11 Frq-F

I can't see the image. Mesh Rendering in PyTorch3D doesn't model shadows, the effect must be from elsewhere, e.g. lighting or texture.

bottler avatar Nov 14 '23 15:11 bottler

Thank you for your suggestion. After adjusting the position of the point light source, the shadows no longer appear.

code: verts_rgb = torch.ones_like(verts) textures=TexturesVertex(verts_features=verts_rgb) lights = PointLights(device=device,location=((1, 0, 0),))

I tried to calculate the normal of the model again and assign it to the texture. I have found that no matter what angle, the rendered image using normal information will not show shadows. Why is this?

Frq-F avatar Nov 17 '23 02:11 Frq-F

What is meant by "calculate the normal again"? The normals depend only on the verts and faces of the mesh - they are not related to the texture, the light or the camera. So they won't change. And what do you mean by "assign it to the texture"?

Note that these color changes are just the specular and diffuse components of lighting on the material, they aren't shadows e.g. of part of the mesh on other parts.

bottler avatar Nov 17 '23 10:11 bottler