当前位置:网站首页>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算法来实现顺序的输入与输出。
第三阶段之泡沫的生成及海面渲染:


边栏推荐
- Huawei cloud Gao Hongxia: CBC microservice code Reconstruction & independent release practice
- gicv3 spi register
- [embedded C foundation] Part 7: detailed introduction to C language process control
- Intrinsic value and time value of options
- GameStop熊市杀入NFT交易,老牌游戏零售商借Web3焕发第二春
- Automatic light sensing arm lamp touch chip-dlt8sa15b-jericho
- 9、 Kubernetes configuration and storage
- Flexpro software: measurement data analysis in production, research and development
- [FPGA]: Joint Simulation of FPGA and MATLAB
- 【嵌入式C基础】第1篇:基本数据类型
猜你喜欢

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

UV germicidal lamp chip dlt8p65sa Jericho
![[embedded C foundation] Part 4: use of operators](/img/01/b3b6c093095dd6a076ae43521a1917.png)
[embedded C foundation] Part 4: use of operators

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

Installation and reinstallation of win11 system graphic version tutorial

《TiDB 6.x in Action》发布,凝聚社区集体智慧的 6.x 实践汇总!

Rust 从入门到精通01-简介

butterfly spreads

CTO of youhaoda, MVP of Huawei cloud, and Zhang Shanyou: build cloud native applications based on kubernetes and dapr

Remove the plug-in of category in WordPress link
随机推荐
[FPGA]: ise and Modelsim joint simulation
Le transaction
Original juice multifunctional Juicer touch chip-dlt8t02s-jericho
How many times can the WordPress user name be changed? Attach the method of changing user name
[embedded C foundation] Part 7: detailed introduction to C language process control
Low code: reduce technical capability requirements and improve software development efficiency
Array, string de duplication
[embedded C foundation] Part 4: use of operators
[Bi design teaching] STM32 and FreeRTOS realize low power consumption
Black cat takes you to learn EMMC Protocol Part 24: detailed explanation of EMMC bus test program (cmd19 & cmd14)
Machine learning Basics - decision tree-12
Change password, confirm password verification antd
How to open the power saving mode of win11 system computer
Brother bird talks about cloud native security best practices
Black cat takes you to learn EMMC Protocol Part 26: hardware reset operation of EMMC (h/w reset)
Interview must ask, focus! Tell me about the Android application startup process and its source code?
Machine learning Basics - integrated learning-13
[FPGA] FIR filter - half band filter
[graduation design] heart rate detection system based on single chip microcomputer - STM32 embedded Internet of things
【嵌入式C基础】第6篇:超详细的常用的输入输出函数讲解