程序行星、高度图和纹理

发布于 2024-09-30 04:56:49 字数 608 浏览 1 评论 0原文

我目前正在研究 OpenGL 程序行星生成器。我希望将它用于太空角色扮演游戏,这样玩家就不会深入到行星表面,所以我忽略了任何与 ROAM 相关的内容。目前,我正在绘制一个带有 VBO 的立方体并映射到一个球体上,如下所示此处。

我熟悉大多数分形高度图生成技术,并且已经实现了我自己的中点位移版本(我知道在这种情况下没那么有用)。

我的问题是,按程序生成高度图的最佳方法是什么。我看过 libnoise 它允许我制作可平铺的高度图/纹理,但据我所知可以看到我需要生成一个像这样的网络:

this

使平铺明显。

有人可以建议我最好的路线吗?

任何意见将不胜感激。

谢谢,

亨利。

I am currently working on an OpenGL procedural planet generator. I hope to use it for a space RPG, that will not allow players to go down to the surface of a planet so I have ignored anything ROAM related. At the momement I am drawing a cube with VBOs and mapping onto a sphere as shown here.

I am familiar with most fractal heightmap generating techniques and have already implemented my own version of midpoint displacement(not that useful in this case I know).

My question is, what is the best way to procedurally generate the heightmap. I have looked at libnoise which allows me to make tilable heightmaps/textures, but as far as I can see I would need to generate a net like:

this

Leaving the tiling obvious.

Could anyone advise me on the best route to take?

Any input would be much appreciated.

Thanks,

Henry.

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

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

发布评论

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

评论(2

狼亦尘 2024-10-07 04:56:49

看来您了解生成平坦、无缝表面然后尝试将其映射到球体上的问题。

改用 3D 噪声函数怎么样? 3D 噪声函数采用 3 个坐标而不是 2 个坐标作为输入,因此想象一个充满生成数字的 3D 数组(而不是 2D 数组)。因此,一旦有了 3D 噪声函数,您就可以生成 2D 纹理,但不是对每个像素使用 2D 坐标,而是使用该像素在球体上的位置的 3D 坐标。 (我希望这个复杂的句子有意义!)

看看这个关于柏林噪音的页面的中间部分:https://web.archive.org/web/20120829114554/http://local.wasp.uwa.edu.au/~pbourke /texture_colour/perlin/

我认为它准确地描述了您对球体的需求。

It looks like you understand the problem with generating a flat, seamless surface and then trying to map it onto a sphere.

How about using a 3D noise function instead? A 3D noise function takes 3 coordinates instead of 2 as its input, so imagine a 3D array full of generated numbers (instead of a 2D array). Thus, once you have a 3D noise function, you can generate a 2D texture, but instead of using 2D coordinates for each pixel, use the 3D coordinates of where that pixel would be on the sphere. (I hope that convoluted sentence made sense!)

Take a look at halfway-down this page about Perlin noise: https://web.archive.org/web/20120829114554/http://local.wasp.uwa.edu.au/~pbourke/texture_colour/perlin/

I think it describes exactly what you want with regards to spheres.

无风消散 2024-10-07 04:56:49

您可能还想查看 2004 年发表的这篇文章,了解如何将球体“拆分”为可管理的部分。

http://www.gamedev.net/reference/articles/article2074.asp

You may also want to check out this article from 2004 on how to 'split' up a sphere into manageable parts.

http://www.gamedev.net/reference/articles/article2074.asp

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