简体   繁体   English

Unity纹理投影与UV贴图

[英]Unity Texture Projection vs UV Mapping

I want to ask something about texturing in Unity. 我想问一些有关Unity中纹理的问题。

I am new to Unity and I need your help. 我是Unity新手,需要您的帮助。 I have an idea to make a custom viewer for my 3D reconstructed mesh. 我有一个想法,可以为3D重建的网格创建自定义查看器。 So, for people that is not familiar with it, it is basically a method that convert 2D photo sequence to 3D mesh using a method called structure from motion. 因此,对于不熟悉它的人来说,它基本上是一种使用称为运动结构的方法将2D照片序列转换为3D网格的方法。 So, the output of the SfM is mesh and number of cameras. 因此,SfM的输出是网格和摄像机数量。 The idea is that I load the mesh and cameras (as projector) to Unity. 我的想法是将网格物体和摄像机(作为投影仪)加载到Unity。 Next, I want that if I click a button related to a certain camera, then the image that seen by that camera is projected to the mesh. 接下来,我希望如果我单击与某个摄影机相关的按钮,然后将该摄影机看到的图像投影到网格。

example of reconstructed 3D model 重建3D模型的示例

example image that seen by the camera: 相机看到的示例图像:

example image that seen by the camera 相机看到的示例图像

So, the thing that I want to ask is, which method is better to put the image as texture to the mesh? 因此,我想问的是,哪种方法最好将图像作为纹理放置到网格中? Should I make UV map for each image and later switch it on and off or can I just use projector to project the image to the mesh from each projector? 我应该为每个图像制作UV贴图,然后再打开和关闭它,还是可以仅使用投影仪将图像从每个投影仪投射到网格上? But I think, if I use projector, the texture resolution must be square. 但是我认为,如果使用投影仪,则纹理分辨率必须为正方形。 Since my images is not square, so it is impossible, isn't it? 由于我的图像不是方形的,所以不可能,不是吗? Or does any of you have different idea or suggestion about how to do it? 还是您对如何做到有不同的想法或建议?

Thank you very much. 非常感谢你。

In your reconstructed model your mesh is a tessellation of the cameras tracking points cloud and not a single mesh. 在重建的模型中,网格是摄像机跟踪点云的细分,而不是单个网格。

You need the exact info of each point and this is what you get with the UVmap. 您需要每个点的确切信息,这就是通过UVmap获得的信息。

Proyection image not use this info, you can got good results but need to move, scale, rotate to a good position. 投影图像不使用此信息,可以获得很好的效果,但是需要移动,缩放和旋转到一个合适的位置。 But ever you got deformation in the images to adjust to the model shape in native proyections (spherical, box, cilindrical, etc) ,you never got exact shape with proyection, only an aproximation. 但是,无论您在图像中产生变形以适应自然投影(球形,矩形,圆柱状等)中的模型形状,都不会获得带有投影的精确形状,只是近似而已。 On proyection you need to readjust texture setting if you move your model in the 3d space. 在复制时,如果在3d空间中移动模型,则需要重新调整纹理设置。

With the uvmap you have the "skin" of your model. 使用uvmap,您可以拥有模型的“外观”。 If you make a nice Unfold you get the shape of your model with a very low deformation, near to the exact shape. 如果您进行漂亮的“展开”,则模型的形状变形很小,接近于精确形状。 You can move the model in the 3d space withouth modify any setting on the texture. 您可以在3d空间中移动模型,而无需修改纹理上的任何设置。

And another advantage is that you directly got your UVmap and their color info from the photo secuence. 另一个好处是,您可以直接从照片安全中获取UVmap及其颜色信息。 Not need another extra step, making proyection textures to not get better results. 不需要另外的步骤,使复制纹理不会获得更好的结果。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM