Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

asiga

macrumors 65816
Original poster
Nov 4, 2012
1,056
1,376
I'm going to learn how raytracing is implemented in Metal, but one of the first things that I wanted to check is if the M3 requires different or special programming techniques for getting the best performance in hardware raytracing. I didn't find anything M3-specific in the Apple Developer site, with the closest hit being this: https://developer.apple.com/videos/play/tech-talks/111375 and it just recommending to use the intersection API instead of the intersection query API.

Have you seen any document/talk/site focusing on optimizing hardware raytracing on the M3, or the usual message is to just do it like before, but taking care of using the intersection API?

Thanks!
 

casperes1996

macrumors 604
Jan 26, 2014
7,593
5,764
Horsens, Denmark
If you use the acceleration structures that e been in metal for several y years it’ll automatically use the ray tracing hardware if available. A friend of mine wrote ray tracing metal code when M1 was all there was and without any changes his code saw huge performance boosts when he got an m3 max earlier this year
 

vokrich

macrumors newbie
Jan 19, 2024
2
0
If you use the acceleration structures that e been in metal for several y years it’ll automatically use the ray tracing hardware if available. A friend of mine wrote ray tracing metal code when M1 was all there was and without any changes his code saw huge performance boosts when he got an m3 max earlier this year
Could you share any specifics? May be specific numbers or code itself? I am interested in evaluating M3 ray tracing performance and looking for any data/code as a starting point.
 

casperes1996

macrumors 604
Jan 26, 2014
7,593
5,764
Horsens, Denmark
Could you share any specifics? May be specific numbers or code itself? I am interested in evaluating M3 ray tracing performance and looking for any data/code as a starting point.
I don't have his code; It was for his master's thesis.
Here's Apple's own sample code for accelerating ray tracing with Metal. It's from 2020, so before any M3s, but should be accelerated on the M3's hardware.


The performance numbers I computed with the friend are so far back in our chatlogs at this point that it's all but impossible for me to find (Messenger's search sucks). He had an M3 Max, I had an M1 Max, and he also had a couple other base M1 and M2s to test with, and all I remember was that the M3 Max was significantly faster in his path tracer
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.