找到使用了Cubemap的模型,再Output里會顯示該模型使用的所有貼圖 ,選中Cubemap導出
選擇導出格式為HDR
?
?導出的Cubemap是豎著的,需要再PS里逆時針旋轉90度
還有,導出的的Cubemap方向是錯的,需要把3,4 跟1,2 對換,6旋轉180度
UE?文檔里的方向參考
最后使用 DDS導出工具 ,導出成Cubemap貼圖
?
也可以使用Python來做方向調整 (暫時還沒寫HDR的格式)
from PIL import Image# 打開圖片文件
img = Image.open(r"D:\a.png")
outImg = r"D:\c.jpg"# 順時針旋轉90度
img = img.rotate(90, expand=True)# 獲取圖片寬度和高度
width, height = img.size# 計算每份的寬度
piece_width = width // 6# 拆分圖片并交換位置
pieces = []
pieces.append(img.crop((2 * piece_width, 0, 3 * piece_width, height))) # 3
pieces.append(img.crop((3 * piece_width, 0, 4 * piece_width, height))) # 4
pieces.append(img.crop((0, 0, piece_width, height))) # 1
pieces.append(img.crop((piece_width, 0, 2 * piece_width, height))) # 2
pieces.append(img.crop((4 * piece_width, 0, 5 * piece_width, height))) # 5
pieces.append(img.crop((5 * piece_width, 0, 6 * piece_width, height))) # 6# 將拆分后的第6份旋轉180度
pieces[-1] = pieces[-1].rotate(180)# 拼接圖片
new_img = Image.new("RGB", (width, height))
x_offset = 0
for piece in pieces:new_img.paste(piece, (x_offset, 0))x_offset += piece_width# 保存拼接后的圖片
new_img.save("new_image.jpg")# 保存拼接后的圖片
new_img.save(outImg)
?