BachiLi / redner

Differentiable rendering without approximation.
https://people.csail.mit.edu/tzumao/diffrt/
MIT License
1.39k stars 139 forks source link

UV mapping looks to be wrong #135

Closed dawnKalo closed 4 years ago

dawnKalo commented 4 years ago

Hi,

I have obj file. I've tried to render it with both Redner and Blender. The object has vertices, texture coordinate (uvs), polygons indices, polygons texture indices (uv_indices I gave it the following parameters (which corresponded to obj data) material = pyredner.Material(diffuse_reflectance = texture) obj = pyredner.Object(vertices=vertices, indices=indices, uvs=uvs, uv_indices=uv_indices, normals=normals, material=material)

dawnKalo commented 4 years ago

The problem was that the UV was upside down but it's not consistent with Blender which I shouldn't flip it. Thanks Anyway.

BachiLi commented 4 years ago

FYI there is a flag "flip_tex_coords" in the obj loader which flips the uv for you.