什么是 3D 更快?Perlin 或 Simplex 噪声? [英] What's faster for 3D? Perlin or Simplex noise?

查看:32
本文介绍了什么是 3D 更快?Perlin 或 Simplex 噪声?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好的,网上有很多关于 Perlin 和 Simplex 噪声的比较.但是我真的找不到一个在三个维度之间有一个简单的处理时间比较的,这是我最感兴趣的.我已经阅读了那个流行的 PDF(甚至理解其中的大部分内容 - 是的!)但我无法回答这个简单的问题:哪个对 3D 来说更快,假设最佳实施?

Okay, there are a lot of comparisons between Perlin and Simplex noise to be found on the web. But I really couldn't find one where there was a simple processing time comparison between both for three dimensions, which is what I am mostly interested in. I've read that popular PDF (and even understood most of it - yay!) but I cannot answer the simple question: Which one is faster for 3D, assuming an optimal implementation?

这个 stackoverflow 问题答案表明 Simplex 是一个非常明显的赢家我的情况.当然,还有其他资源声称恰恰相反.

This stackoverflow question answer suggests that Simplex is a pretty clear winner for my case. Of course, there are other resources claiming the exact opposite.

但是,一般的说法似乎是 Perlin 噪声的复杂度为 O(2^N),而 Simplex 的复杂度为 O(N^2).对于 3D,Perlin 为 8,Simplex 为 9.但是,在某些站点上,我发现 Simplex 实际上是 O(N) 的说法.那么这里是什么,这对于 3D 速度的真正意义是什么?

However, the general statement seems to be that Perlin noise has a complexity of O(2^N), while Simplex has O(N^2). Which for 3D would mean 8 for Perlin and 9 for Simplex. But, on some site I found the statement that Simplex is actually O(N). So what is true here, and what does that really mean for speed in 3D?

我在这里不知所措,我真的主要对 3D 应用程序(用于随机地形生成,包括洞穴)的使用感兴趣,并且我无法找到一个很好的答案来回答如果我想要它应该使用哪个应用程序尽可能快.

I am at a loss here, I'm really mainly interested in 3D application (for random terrain generation including caves) usage, and I cannot find a good answer to the question which one I should use if I want it to be as fast as possible.

所以也许有人可以在这里帮助我:)

So maybe someone can help me here :)

推荐答案

1) http://www.fundza.com/c4serious/noise/perlin/perlin.html
2) http://www.6by9.net/b/2012/02/03/simplex-noise-for-c-and-python

在我的笔记本电脑"中使用这两种实现的 8M 噪声样本的执行时间:(g++ -O6)

Execution times in "my laptop" for 8M samples of noise using these two implementation: (g++ -O6)

1) 1.389 秒,即每秒 570 万次操作2) 0.607s 即每秒 13.2M 操作

1) 1.389s i.e. 5.7M ops per second 2) 0.607s i.e. 13.2M ops per second

可是……

真正要进行优化时,应该研究

When really, really going for the optimizations, one should study

  • 更高级别的优化(每个阶段真正做了什么:是否有替代方案?)
  • 分支机构
  • 记忆模式
  • 依赖项
  • LUT 大小
  • 所需的单个算术运算、它们的延迟和吞吐量
  • 使用 SIMD 的可利用并行性
  • 活动变量的数量

这篇关于什么是 3D 更快?Perlin 或 Simplex 噪声?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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