是否可以在没有 CUDA/OpenCL 等的情况下使用 GPU 进行光线跟踪?

发布于 2024-10-20 10:57:26 字数 113 浏览 5 评论 0原文

我正在使用 Windows Phone 7,它不支持 CUDA 或 OpenCL 等功能。我是 GPU 方面的新手,GPU 上有什么东西可以用来帮助加速光线追踪吗?像三角形相交测试吗?或者从纹理中选择正确的颜色?

I'm working on Windows Phone 7 which does not support features like CUDA or OpenCL. I'm new to the GPU side of things, Is there anything on the GPU that I can use to help speed up raytracing? Like triangle intersection tests? Or selecting the correct colour from a texture?

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

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

发布评论

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

评论(2

山色无中 2024-10-27 10:57:26

CUDA 等实际上只是用于编程着色器的高级语言,因此任何支持可编程着色器的平台都允许您具有在 GPU 上运行通用计算的能力。

不幸的是,它看起来像 Windows Phone 7 不支持自定义可编程着色器,因此光线追踪器的 GPU 加速目前还不太可能。即使是这样,有效地使用 GPU 进行光线追踪也非常困难,因为有几个非常反 GPU 的特性:

  1. 内存一致性差(每条光线可以轻松地与完全不同的几何体交互)
  2. 高分支因子(着色器在一致的代码下工作效果最好)遵循单一路径)
  3. 大型工作集(必须随时在内存中访问大量几何体才能计算单个光线的结果)

如果您的目标是编写光线跟踪器,那么可能会更容易完全在CPU上,然后才考虑更深奥的优化。

CUDA and the like are really just higher level languages for programming shaders, so any platform that supports programmable shaders allows you some capability to run general purpose calculations on the gpu.

Unfortunately, it looks like Windows Phone 7 does not support custom programmable shaders, so GPU acceleration for a ray tracer is not really possible at this time. Even if it was, it is very difficult to effecticely use a GPU for raytracing because of several very anti-GPU characteristics:

  1. Poor memory coherency (each ray can easily interact with completely different geometry)
  2. High branching factor (shaders work best with code that consistently follows a single path)
  3. Large working set (A lot of geometry has to be accesable in memory at any one time to compute the outcome of even a single ray)

If your goal is to write a raytracer, it would probably be far easier to do completely on the CPU, and only then consider optimizations that are more esoteric.

眼中杀气 2024-10-27 10:57:26

即使在现代普通台式电脑上,光线追踪仍然有点慢。您可以通过仅拍摄主光线来加快速度,但光栅化方法实际上会更好更快。

您确定要在计算能力比 PC 还要差的手机上进行光线追踪吗?他们不是为了做那种工作而设计的。

Raytracing is still a bit slow, even on modern average desktop PC. You can speed it up by shooting just primary rays, but then rasterisation methods will be actually better and faster.

Are you certain, you want to do ray-tracing on a phone, which has even less compute power than PC? They are not designed to do that kind of work.

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