haosulab / SAPIEN

SAPIEN Embodied AI Platform
https://sapien.ucsd.edu/
MIT License
347 stars 34 forks source link

cannot render obj+mtl+jpg mesh objects with correct textures #162

Open kasteric opened 1 month ago

kasteric commented 1 month ago

System:

Describe the bug When using sapien.renderer() to render urdf objects from ShapeNet, for some objects, it cannot successfully render the objects with correct textures. To Reproduce Steps to reproduce the behavior (use pastebin for code):

  1. prepare the shapenet_example folder as in google drive link: https://drive.google.com/drive/folders/1XY-qD_dF-z_xlOaqswo-noBz-4TIvrG2?usp=sharing
  2. the render python file is in https://pastebin.com/YKaqV73N, place the render.py and shapenet_example in the same root folder.
  3. run the above render python file by python render.py --urdf-file="shapenet_example/object.urdf" --output-dir="output"

Expected behavior The rendered images should have the mapped texture properties from the texture0.jpg in the shapenet_example/images folder, to really look like a microwave. Screenshots (1) Here is an example of one view of the rendered result by running the code. Generally, it merely looks like a rectangular cuboid with no image textures. 0002 (2)Here is the preview results in Blender displayed in material preview mode: image

Additional context Add any other context about the problem here.

fbxiang commented 1 month ago

By looking at the URDF, my guess would be that the <material> tag in the URDF file is overriding the built-in material. Can you try again after removing this tag? Also if you are loading a non-articulated object into a scene, I would recommend directly loading it with the actor builder.

kasteric commented 1 month ago

Oh i figured out that it was the lighting issue:), by adding ambient light, i can clearly see the textured image in the rendered images lol