WPF 3D对象的UV贴图纹理显示接缝 [英] WPF 3D object's UV mapped textures showing seams

查看:428
本文介绍了WPF 3D对象的UV贴图纹理显示接缝的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在研究一个Blend WPF项目,该项目涉及3D对象的显示和简单轨迹球类型操作,以旋转和缩放有问题的对象。其中一些对象使用非连续图像的UV贴图纹理(像地图一样的图集)。

I’m working on a Blend WPF project involving the display and simple trackball type manipulation of 3D objects to rotate and zoom the object in question. Some of these objects have UV mapped textures using images that are not contiguous (atlas like mapping).

当我们缩小并且对象以小比例渲染时出现问题,我们开始在纹理映射中看到接缝,我们看到位图图像的部分边缘是映射到对象的其他区域(属于非连续面)。

The problem arises when we zoom out and the object is rendered at a small scale, we begin to see seams in the texture mapping, we are seeing the edge of sections of the bitmap image that are mapped to other regions of the object (belong to non contiguous faces).




 

现在我可以通过启用Direct x 9驱动程序并简单地放大或缩小来在3Dsmax视口中重现同样的问题/效果物体。放大并且UV映射显示都很好,缩小并开始出现接缝。如果我禁用驱动程序的Mipmap查找功能,则问题得以解决。完美的UV映射,因此看起来问题在于DirectX位图性能优化,当对象按比例缩小时使用原始位图的重新缩放版本。结果是一个不准确的位图到顶点映射,因为它的工作原理是减少原始位图的详细版本。

Now I am able to reproduce this same problem/effect in 3Dsmax viewport by enabling Direct x 9 drivers and simply zooming in or out on the object. Zoomed in and all appears fine with the UV mapping, zoomed out and the seams start to appear. If I disable the Mipmap Lookup feature of the driver then the problem is resolved. Perfect UV mapping, so it would appear that the problem resides with DirectX bitmap performance optimization, using a rescaled version of the original bitmap when the object is scaled down. The result in an inaccurate bitmap to vertices mapping as its working from reduce detailed version of original bitmap.

我希望能够做同样的事情在我的WPF项目中;我已经尝试禁用我的图形卡驱动程序的Mipmap功能,但没有用,并且在Blend中看不到任何可以让我控制Direct X将如何渲染3D纹理贴图。

I want to be able to do the same thing in my WPF project; I have tried disabling the Mipmap feature of my graphic card driver but to no avail and don’t see anything in Blend that would allow me to control how Direct X will render 3D texture maps.

我使用Nvidia 8800 GT在四核上运行Vista 64

I’m running Vista 64 on quad core with Nvidia 8800 GT

是否有人在WPF中禁用Mipmap,或者我需要做什么通过Direct X 3D API在代码级别的东西?或者它可能是我需要做的其他事情?

Is there someway to disable the use of Mipmap in WPF, or do I need to do something at the code level via the Direct X  3D API? Or might it be something else that I need to do?

谢谢

推荐答案

这不是一个错误,就像mip映射的工作方式一样。图像画笔使用mip贴图,但我相信从中间渲染目标读取的画笔不会 - 这意味着画笔和可视画笔。因此,如果你把你的地图集纹理放在其中一个,我相信你不会得到mip贴图。如果你想使用ImageBrush,你不能直接禁用它上面的mip贴图,但你可以通过将每个atlas贴图的边纹理像素延伸几个像素来填充atlas贴图的边缘来解决这个问题。这样,较低的mip贴图级别不会相互渗透。这也意味着您的地图集纹理中的平铺密度会略微降低。

David
This isn't a bug so much as the way mip mapping works.  Image brushes use mip mapping, but I believe brushes reading from intermediate render targets do not -- this means drawing brushes and visual brushes.  So if you put your atlas texture in one of those, I believe you won't get mip mapping.  If you do want to use an ImageBrush, you can't directly disable mip mapping on it, but you can work around this by padding the edges of your atlas tiles by extending the edge texels of each atlas tile by a few pixels.  This way, lower mip map levels won't bleed between each other.  This will also mean that you have slightly slower tile density in your atlas texture.

David


这篇关于WPF 3D对象的UV贴图纹理显示接缝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆