如何创建分形立方体?

发布于 2024-07-27 12:20:23 字数 333 浏览 2 评论 0原文

我想在 OpenGL 中渲染体积云。 我发现了一篇有趣的论文,描述了渲染体积云的简单技术。 (http://www.inframez.com/events_volclouds_slide18.htm) 但是我不知道如何创建他们的“分形立方体”(或柏林噪声立方体)。

我的问题是:如何创建立方体的 6 个可平铺的分形纹理?

编辑:我的目标是制作一个体积云对象,而不是云天空盒。

I would like to render volumetric clouds in OpenGL.
I found an interesting paper that describes a simple technique to render volumetric clouds.
(http://www.inframez.com/events_volclouds_slide18.htm)
However I don't know how to create their "fractal cube" (or perlin-noise cube).

My question is: how to create the 6 tileable fractal textures of a cube?

Edit: my aim is to make a volumetric cloud object, not a cloud skybox.

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

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

发布评论

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

评论(4

装迷糊 2024-08-03 12:20:23

此处对 Perlin 噪声进行了很好的介绍,由 Ken Perlin 本人撰写。 他详细讨论了生成一维或二维噪声函数,然后对其进行概括以展示它如何在 3D 中工作,以生成您想要的固体噪声立方体。

A nice introduction to Perlin noise, written by Ken Perlin himself, is here. He talks about generating a one or two dimensional noise function in some detail, and then generalises it to show how it would work in 3D, to generate a solid cube of noise like you want.

当梦初醒 2024-08-03 12:20:23

使用 2D 广告牌云纹理时,您可以创建一个 alpha 混合的 2D 纹理,其中透明度看起来像云。 他们要求你做的几乎是同样的事情,只是纹理无缝地包裹着立方体(就像天空盒)。 perlin-noise 过滤器 看起来像是一种使某些东西看起来像云的算法-喜欢。

我的捷径是使用 Photoshop 的云滤镜来创建纹理。 遵循本教程的基本概念进行 Alpha 混合,但不要做圆形渐变。 将其切成无缝的天空盒状网格(即,它有 6 个边并围绕立方体正确折叠)。

When using a 2D billboarded cloud texture, you create an alpha-blended 2D texture where the transparency looks cloud-like. What they're asking you to do is almost the same thing, only the texture wraps around a cube seamlessly (like a skybox). The perlin-noise filter looks like an algorithm to make something look cloud-like.

My shortcut approach to this would be to use Photoshop's cloud filter to create your texture. Follow the basic concept of this tutorial for the alpha blending, but don't do the circular gradient. Cut it into a seamless skybox-like grid (i.e. so it has 6 sides and folds properly around a cube).

虚拟世界 2024-08-03 12:20:23

I think the 'fractal cube' texture they refer to is an FBM (Fractal Brownian Motion) fractal generated from a number of octaves of Perlin noise. This Game Programming Gems Chapter discusses how they are formed. The basic idea is to combine multiple 'octaves' of Perlin noise, with each octave having around twice the frequency of the previous octave. You can make this seamlessly tiling by modifying the noise function. Photoshop's cloud filter is basically FBM noise and is seamlessly tiling so you can just use that if you have access to Photoshop.

以可爱出名 2024-08-03 12:20:23

如果您真的对漂亮的云渲染感兴趣,那么 Mark Harris 的算法虽然复杂,但相当不错: http:// www.markmark.net/clouds/

If you're really interested in nice cloud rendering, then Mark Harris's algorithm is quite good albeit complicated: http://www.markmark.net/clouds/

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