位移贴图

发布于 2024-10-12 03:35:26 字数 104 浏览 3 评论 0原文

置换贴图到底有什么好处?它们实际上是否加速了更高数量多边形的渲染,或者这只是艺术家和引擎内工具暂时降低多边形数量的一个巧妙技巧?我能看到它唯一真正的用途可能是细节级别的算法,但仅限于更远的距离。

What exactly are the benefits of displacement maps? Do they actually speed up rendering of higher count polys at all, or is it just a nifty trick for artists and in-engine tools to temporarily lower the poly count? The only real thing I could see it used for is maybe level of detail algorithms, but only at much greater distances.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

心欲静而疯不止 2024-10-19 03:35:26

它可以为渲染高多边形模型提供更紧凑的结构。置换贴图每个像素可以包含少至 1 个字节。如果您将其细分为位移贴图,那么您将在 GPU 上节省大量内存带宽。

第二个简单顶点结构的图像。

struct Vert
{
    float x, y, z;
    float nx, ny, nz;
    float u, v;
};

该结构的大小为 32 字节。因此,如果您想象可以将顶点数量四分之一(并且您应该能够做更多的事情)并用 1 字节高度图替换所有其他顶点,那么您所使用的内存量就可以计算出来如下:

100,000 poly object = 3,200,000 bytes using vertex struct alone.
25,000 polys + 100,000 entry height map = 900,000 bytes.

即位移映射为您提供28%内存中的相同数据。赢! :D

如果您存储法线贴图并使用 w/a 组件作为高度,那么您将使用 400000 字节用于纹理,现在您的大小为 1,200,000 字节,仍然是大小的 37.5%。另外,您现在可以删除 12 个字节用于正常存储,实际上可以减少到 900,000 字节的相同数字。

您应该能够获得比这高得多的几何压缩率。因此,总而言之,您可以获得一小部分存储数据的更好看的模型。

作为额外的好处,使用法线贴图/高度贴图系统,您还可以轻松缩放,以便功能较弱的机器只需使用法线数据,您仍然可以获得相当好的结果。

Well it can provide a more compact structure for rendering high poly models. A displacement map can contain as few as 1 byte per pixel. If you tesselate that up for displacement mapping then you are saving a HUGE amount of memory bandwidth on the GPU.

Image for a second a simple vertex struct.

struct Vert
{
    float x, y, z;
    float nx, ny, nz;
    float u, v;
};

That struct is 32 bytes in size. So if you imagine that you can quarter the number of vertices (and you ought to be able to do a HELL of a lot more than that) and replace all other vertices with a 1 byte height map then you the amount of memory used works out as follows:

100,000 poly object = 3,200,000 bytes using vertex struct alone.
25,000 polys + 100,000 entry height map = 900,000 bytes.

ie dispalcement mapping provides you with the same data in 28% of the memory. WIN! :D

If you store a normal map and use the w/a component for height then you use up 400000 bytes for the texture and you are now 1,200,000 bytes in size which is STILL 37.5% of the size. PLUS you can now remove 12 bytes for normal storage and you are really down to the same figure of 900,000 bytes.

You ought to be able to get SIGNIFICANTLY higher geometry compression rates than that. So, in summary, you get a better looking model for a fraction of the storage data.

As an added bonus, using the normal map/height map system you can also easily scale so that less powerful machines simply use the normal data and you still get reasonably good results.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文