Data: 3D RIGGED PEOPLE >> rp_carla_rigged_001_FBX in free-3d-people.
Setup for "rp_carla_rigged_001_yup_a.fbx": Default + Eevee + Transparent + Camera(0,-3,1)
Normal in "Non-Color"(There are still obvious inconsistencies among different UV islands):
Seams from Islands:
Code for visualization:
import cv2
import numpy as np
from vedo import *
path_img="/home/lab9/Pictures/untitled.png"
img_ori = cv2.imread(path_img, -1)
img_ori = cv2.cvtColor(img_ori, cv2.COLOR_BGR2RGB)
img_ori = img_ori[300:400, 810:850, :]
img = img_ori.copy().reshape(-1, 3)
img = img / 255.0
img = img * 2 - 1
if True:
plt = Plotter(axes=2)
B = Box(pos=(0, 0, 0), length=4, width=3, height=4).alpha(0.1)
O = np.zeros_like(img)
L = Lines(O, O+img, c="r")
plt.show(B, L)
Result:
Question: I have a need to render a normal map as a texture.
When choosing a color map("_dif.jpg") as the texture, it looks consistent.
However, choosing the normal map("_norm.jpg") as the texture looks inconsistent, but the results of the visualization are all pointing to the positive direction of the Z axis (it should be considered correct).
What about the inconsistencies between the rendered result(as color) and the visualization result(as normal/vector)?
What transformation can I do to make the normal map look more "consistent"?
Update1: (based on Blunder's comment)
I create a plane in Blender, after sub. 100 and sculpt:
Another two planes:
without rotation:
with rotation:
000 090
270 180
Baked result:
Correction code for the second UV island, rotateX=90
equals:
x_new = -y_old
y_new = x_old
import cv2
import numpy as np
from vedo import *
path_img_N001 = "N.001.png"
path_img_N002 = "N.002.png"
img_N001 = cv2.imread(path_img_N001, -1)
img_N002 = cv2.imread(path_img_N002, -1)
img_N001 = cv2.cvtColor(img_N001, cv2.COLOR_BGR2RGB)
img_N002 = cv2.cvtColor(img_N002, cv2.COLOR_BGR2RGB)
tl = (192, 576)
bl = (447, 576)
tr = (192, 831)
br = (447, 831)
img_N001 = (img_N001 / 255.0) * 2 - 1
img_N002 = (img_N002 / 255.0) * 2 - 1
ou = tl[0]
ov = tl[1]
img_N001 = img_N001[ou : ou + 255, ov : ov + 255].reshape(-1, 3)
img_N002 = img_N002[ou : ou + 255, ov : ov + 255].reshape(-1, 3)
img_N002[:, [0, 1]] = img_N002[:, [1, 0]]
img_N002[:, 0] *= -1 #!
if True:
plt = Plotter(axes=2, shape=(1, 2), sharecam=False)
B = Box(pos=(0, 0, 0), length=4, width=3, height=4).alpha(0.1)
O = np.zeros_like(img_N001)
L1 = Lines(O, O + img_N001, c="r")
L2 = Lines(O, O + img_N002, c="g")
plt.show((B, L1), at=0)
plt.show((B, L2), at=1)
plt.show(interactive=1)
We can see that after rotation correction, the result is consistent.
Maybe we can restore the relative rotation between UV islands by the following observation:
The first plane(without rotation):
The second plane(with rotation, rotX=90):
The second plane(with rotation, rotX=180):
The result obtained after top-right rotation correction (bottom not processed, still inconsistent):
Now the problem is: are there any Off-the-shelf tools to calculate the rotation parameters of UV island?