diffrp.plugins.mikktspace#
- diffrp.plugins.mikktspace.compile_plugin()#
- diffrp.plugins.mikktspace.execute(verts: Tensor, normals: Tensor, uv: Tensor)#
Execute the MikkTSpace algorithm to compute tangent vectors and bitangent signs, which form the tangent space. The algorithm is serial algorithm on CPU and not differentiable, but tensors are automatically transferred to and back from CPU.
It takes flat, unrolled vertex positions, normals and uvs.
The plugin is not thread-safe.
- Parameters:
verts (torch.Tensor) – (F * 3, 3) vertex positions of faces unrolled.
normals (torch.Tensor) – (F * 3, 3) vertex normals of faces unrolled.
uv (torch.Tensor) – (F * 3, 2) vertex UV coordinates of faces unrolled.
- Returns:
(F * 3, 4) tangent space. Has the same device and dtype as
verts.- Return type:
torch.Tensor