海洋模拟样本 [英] ocean simulation sample

查看:70
本文介绍了海洋模拟样本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我不确定是否应该在此处或在Directx论坛中发布此消息,但是当我询问有关C ++ AMP海洋模拟示例时,我想我应该将其发布在这里.

Hello I wasn't sure if this should be posted here or in a directx forum, but as I am asking about the C++ AMP ocean simulation sample I thought I would post it here.

因此,海洋样本示例将计算傅立叶空间中水波的演变,然后执行快速傅立叶变换以计算任意点和时间的水位.我希望使用此示例执行类似的计算 但是它不是水浪,而是在不同背景下的波浪.我相信我知道如何修改示例代码以在C ++ AMP中执行该计算.

So the ocean sample example calculates the evolution of the water waves in Fourier space, then performs a Fast-Fourier-Transform to calculate the height of the water at any point and time. I was hoping to use this sample to perform a similar calculation but instead of water waves, it is waves in a different context. I believe I know how to modify the sample code to perform that calculation in C++ AMP.

但是我对DirectX一无所知,所以我想知道是否有一种简单的方法可以关闭天窗(将其简化为绿色或类似的东西),关闭所有反射和其他不必要的照明效果,并根据水的颜色进行着色在它的 高度(例如,峰红色和谷蓝色)?我之所以这么问,是因为我可以看到这些东西占用了GPU的相当多的资源,而这些资源最好用于计算波形本身的演化.

However I know nothing about directx so I was wondering if there is a simple way to turn off the skybox (make it a simple green or something), turn off all the reflections and other unnecessary lighting effects and simply colour the water depending on its height (eg. peaks red and troughs blue)? I'm only asking because I can see these things taking up quite a bit of the GPU's resources which would be better spent on calculating the evolution of the waves themselves.

感谢阅读.

推荐答案

您可以尝试直接从您的代码直接进入C ++ AMP FFT库:

You can try just tapping into the C++ AMP FFT library directly from your code:

http://blogs.msdn .com/b/nativeconcurrency/archive/2011/11/15/the-c-amp-fft-library.aspx

请注意,上次尝试使用2D FFT时,输入数据集的限制为4096 x 4096.

Be careful though, the 2D FFT has a 4096 x 4096 limitation on the input data sets the last time I tried it.

-L


这篇关于海洋模拟样本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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