金属射线追踪 – SceneKit 或 RealityKit
The WWDC21 talk below shows how to "Enhance your app with Metal ray tracing".
How can I add Metal ray tracing to a SceneKit or RealityKit app?
Any basic example or reference code would be hugely appreciated!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我花了一些时间为您和对此主题感兴趣的其他人准备示例应用程序。这些应用程序是纯 Swift with Metal,目前设计为在 iOS 平台上运行。 (我个人推荐一个快速的设备)
在这里你可以找到第一个“简单”的默认Apple RayTracer:
https:// github.com/philvanza/SceneKit-RayTracing
这里同一个应用程序带有一个额外的、更复杂的 RayTracer,支持 BSDF(双向散射分布函数),它允许您光线追踪 i.Ex。透明玻璃:
https://github.com/philvanza/SceneKit-RayTracing-Advanced
基本上您需要以下内容来实现光线追踪:
让 RayTracer 运行的时间越长,结果就越好。
在这里添加太多代码,所以我准备了这个存储库。如果您对 RayTracers 有何看法,请随时给我留言。
玩得开心!
It took me some time to prepare example apps for you and anyone else interested in this topic. The apps are pure Swift with Metal and are currently designed to run on iOS platforms. (I personally recommend a fast device)
Here you can find the first "simple" default Apple RayTracer:
https://github.com/philvanza/SceneKit-RayTracing
And here the same app with an additional, more complex RayTracer that supports BSDF (Bidirectional Scattering Distribution Function) which allows you to RayTrace i.Ex. transparent glass:
https://github.com/philvanza/SceneKit-RayTracing-Advanced
Basically you need the following to achive RayTracing:
The longer you let the RayTracer run, the better the result becomes.
It would take too much code to add here, so I prepared this repositories. Feel free to leave me a comment on whatever you think about the RayTracers.
Have fun!