当前位置:网站首页>FFT海浪模拟
FFT海浪模拟
2022-07-28 12:08:00 【Freak587】
本文公式的推导、FFT原理实现以及知乎上某图片的引用均来自此【学习笔记】Unity 基于GPU FFT海洋的实现-理论篇 - 知乎 (zhihu.com)
根据上面的学习笔记可知,FFT的实现经过三个阶段,分别是:
生成频谱--->IDFT(逆离散傅里叶变换),得到偏移图--->法线、泡沫纹理,渲染
主要流程如下:可见,首要的事情是生成高度频谱。
第一阶段之生成频谱:
生成高度频谱的公式如下:

可见,要想得到高度频谱,我们不仅需要高斯随机数,还需要phillips频谱(方向波谱),其中公式中的k箭头是波长向量,k是波长向量的模。最后,我们就可以根据高度频谱生成对应的x\z位移频谱。
两个高斯随机数是互相独立服从均值为0,标准差为1的随机数。
下图是高斯随机数与phillips频谱生成高度频谱的流程。

如下是根据高度频谱实现FFT海浪模拟的全部过程。
第二阶段之使用IDFT:
利用IDFT由频谱图生成偏移图的过程。其中dx\dz\dy就是偏移图,displacement是偏移图合成的偏移纹理。

FFT的推导




根据推导可知,我们需要蝶形运算,并且采样点(或者说波数)是2的整数次幂。同时需要注意的是,蝶形运算会顺序输入、倒序输出,倒序输入、顺序输出。所以要采用Stockham算法来实现顺序的输入与输出。
第三阶段之泡沫的生成及海面渲染:


边栏推荐
- Black cat takes you to learn EMMC Protocol Part 24: detailed explanation of EMMC bus test program (cmd19 & cmd14)
- Risk analysis of option trading
- 9、 Kubernetes configuration and storage
- Remove the plug-in of category in WordPress link
- Why neural networks are ineffective?
- 【嵌入式C基础】第5篇:原码/反码/补码
- 【嵌入式C基础】第7篇:C语言流程控制详讲
- SSM框架网上书城全套
- butterfly spreads
- 黑猫带你学eMMC协议第24篇:eMMC的总线测试程序详解(CMD19 & CMD14)
猜你喜欢
![[embedded C foundation] Part 1: basic data types](/img/45/b0bc9e90b0582f0f2624ce27b5a76c.png)
[embedded C foundation] Part 1: basic data types
![[basic teaching of Bi design] detailed explanation of OLED screen use - single chip microcomputer Internet of things](/img/76/820d4e357206f936b33da92a5e2b5b.png)
[basic teaching of Bi design] detailed explanation of OLED screen use - single chip microcomputer Internet of things
![[embedded C foundation] Part 4: use of operators](/img/01/b3b6c093095dd6a076ae43521a1917.png)
[embedded C foundation] Part 4: use of operators
![[matlab] IIR filter](/img/60/8e666bff3d458cdd9367ca45112b92.png)
[matlab] IIR filter

FutureWarning: Indexing with multiple keys (implicitly converted to a tuple of keys) will be depreca

Chapter 6 提升

How does kotlin help you avoid memory leaks?

Chinese translation of pointnet:deep learning on point sets for 3D classification and segmentation

01 introduction to pyechars features, version and installation

SQL most commonly used basic operation syntax
随机推荐
Summary: golang's ide:vscode usage
Phpstudy steps to quickly build a website (teach you to build it by hand)
UV germicidal lamp chip dlt8p65sa Jericho
[graduation design] oscilloscope design and Implementation Based on STM32 - single chip microcomputer Internet of things
[FPGA] FIR filter - half band filter
Flexpro software: measurement data analysis in production, research and development
What if win11 cannot recognize Ethernet
.net for subtraction, intersection and union of complex type sets
【嵌入式C基础】第9篇:C语言指针的基本用法
The form select in antd is received before it is selected
如何在 TiDB Cloud 上使用 Databricks 进行数据分析 | TiDB Cloud 使用指南
[embedded C foundation] Part 4: use of operators
Rust 从入门到精通01-简介
Low code: reduce technical capability requirements and improve software development efficiency
我抄底了被清算的NFT,却被OpenSea上了锁
Interview must ask, focus! Tell me about the Android application startup process and its source code?
Smart touch screen LCD bathroom mirror light touch chip-dlt8t02s-jericho
9、 Kubernetes configuration and storage
[embedded C foundation] Part 1: basic data types
【嵌入式C基础】第4篇:运算符的使用