News for hackers. Stuff that matters.
Re:John Carmack's Comment on Hardware Ray Tracing by ChuckMcM on Thursday January 24, 2013 @12:49AM (#5107721)
Pretty much agree, the only thing that we might disagree on is the 'billions' number, while I expect good ray tracing to trace billions of rays, if transistors are cheap enough this becomes more interesting. The typical HDMI 1080p display is 2 megapixels (or megatexels) if you have a rendering engine with 2,073,600 cores each of which is looking at a billion ray 'view' based on where it sits in the scene, its easier to set up the scene and light it. That presumes that you can do those cores like DRAM instead of like current processors of course. My point is that cheap transistors keep amazing me and whenever I say "Oh that will never happen" some fool goes and shows me I'm wrong.

I'm trying to imagine how complex a 'core' would be that computed the incident rays on a single pixel. Then figuring out how big that is in a 18nm process technology and then trying to see if I can fit 2M on a reasonable size die. My head exploded sadly.

Re:John Carmack's Comment on Hardware Ray Tracing by yk on Thursday January 24, 2013 @01:00AM (#5107780)
Throwing more ( or finer etched) silicon at an algorithm will not help the algorithm, compared to a superior algorithm. For almost all scenes you get better results with rasterization, the two exceptions I can think of is scenes where the geometry of light rays is not flat, so for example involving lenses or black holes, or where there is a lot more optical complexity than you can reasonably use. ( A forest where each of the leafs is an object, you will never be able to notice that the advantage of this over an forest where the trees in the background are just textures.)
Re:John Carmack's Comment on Hardware Ray Tracing by Tuna-Fish on Thursday January 24, 2013 @01:58AM (#5108079)
> Throwing more ( or finer etched) silicon at an algorithm will not help the algorithm, compared to a superior algorithm

Actually, it will when the complexity classes of the algorithms differ. Which is true in this case -- the time taken to ray trace a scene rises as the log(n) of the size of that scene, while the time taken to rasterize rises linearly with regards to the scene.

There exists a threshold of computing power/scene complexity above which raytracing beats rasterization in speed. However, like Carmack pointed out, the constant factors are massive, so this won't be reached in the near future, if ever.

The reason the constant factors are so huge is that complexity of raytracing rises linearly with the count of pixels to be drawn, while in rasterization a lot of the work can be shared by neighbouring pixels.

Intriguingly, this means that if you can reduce the pixel counts, you can vastly improve the value of raytracing.

Notably, if you can do eye tracking and rendering in less than 15ms, you can reach the same visual quality as a full-screen, high-resolution render by rendering only the areas you are actually looking at in high resolution, and rendering the rest of the scene at a progressively lower resolution farther from the focus point. The cone of high-precision vision is surprisingly small, something like tens of pixels when looking at a screen from a normal viewing distance. If you did this, you should be able to cut the amount of rays you need to send by at least two orders of magnitude, which would bring raytracing to real-time quality on modern hardware.

Re:John Carmack's Comment on Hardware Ray Tracing by James_Duval on Thursday January 24, 2013 @05:16AM (#5108748)
Naive question:

Does your last paragraph have any implications for VR? Could something like the Oculus Rift benefit from raytracing technology? Or have I misunderstood what you are saying?

Re:John Carmack's Comment on Hardware Ray Tracing by yk on Thursday January 24, 2013 @09:49AM (#5109745)
I only skimmed the paper referenced below [1]. But what I understand at the moment is, that you essentially measure the area of the screen where high quality is important (using an eye tracker). And with this you can allocate your resources better. The downside is, that the rendering looks rather strange for anyone who looks on it without proper alignment of the high quality region. So VR goggles seem to be a good candidate for the technology, if they include an eye tracker, because they guarantee a single viewer and provide a frame to attach the eye tracker.

[1] http://research.microsoft.com/apps/pubs/default.aspx?id=1766... thanks mynameismiek

Re:John Carmack's Comment on Hardware Ray Tracing by duaneb on Thursday January 24, 2013 @09:29AM (#5109642)
The idea is that raytracing can degrade gracefully, so there's a sliding scale between rendering time and rendering quality for every pixel. And yes, this means that, theoretically, the computer could naturally degrade pixels that you're not currently looking at.

I suspect this would look highly unnatural in practice, though, as even static scenes would flicker and change, especially with reflections and any surface or technique that uses random sampling methods (which is virtually every algorithm that is both fast and looks good).

Re:John Carmack's Comment on Hardware Ray Tracing by Tuna-Fish on Thursday January 24, 2013 @02:29PM (#5111592)
> I suspect this would look highly unnatural in practice

In pair tests test subjects were unable to see a difference between the foveated image and the normally rendered one. The flicker can be removed by blurring the image to the point where flicker no longer exists. Because your brain is used to a very low sampling rate outside the fovea, it actually helps in hiding the artifacts, because they occur naturally in your vision.

Re:John Carmack's Comment on Hardware Ray Tracing by yk on Thursday January 24, 2013 @02:55AM (#5108264)
Yes, as I pointed out in the last sentence, perhaps I should have put a big-O somewhere into it. Do you have a link on the eye tracking/rendering combo? That technique sounds rather fascinating.
Re:John Carmack's Comment on Hardware Ray Tracing by mynameismiek on Thursday January 24, 2013 @08:21AM (#5109334)
Re:John Carmack's Comment on Hardware Ray Tracing by bcoates on Thursday January 24, 2013 @03:03AM (#5108291)
Is raytracing still linear with pixel count if you're doing something like Metropolis light transport to get global illumination effects?
Re:John Carmack's Comment on Hardware Ray Tracing by ericmj on Thursday January 24, 2013 @04:19AM (#5108548)
Yes. But the "constant factor" will be very large, even larger than for traditional ray tracing, for some global illumination algorithms, even when you chose to only render a small part of the scene. For example photon mapping requires a pre-pass where you trace photons from the light source onto the scene, that means that reducing the pixel count doesn't decrease the time for the pre-pass. http://en.wikipedia.org/wiki/Photon_mapping
Re:John Carmack's Comment on Hardware Ray Tracing by snarfy on Thursday January 24, 2013 @11:14AM (#5110239)
When CPUs have millions of cores and cost next to nothing to produce, the superior algorithm may be the one which scales linearly with parallel hardware. He mentions the problem of the log2 vs linear with rasterization, but that's just moving the log2 problem to hardware. Ray casting may still win out due to it's simplicity of throwing more hardware at it.
Re:John Carmack's Comment on Hardware Ray Tracing by Osmium on Thursday January 24, 2013 @01:05AM (#5107812)
e.g. mirrors?
Re:John Carmack's Comment on Hardware Ray Tracing by yk on Thursday January 24, 2013 @01:21AM (#5107910)
Yes, but it perhaps more instructive to think of a curved mirror. In case of a raster engine, you need to calculate a texture for every triangle of the mirror. ( Which is essentially the same as rendering the scene in the first place.) On the other hand for a ray tracing engine you just need to reflect one ray on the mirror surface for every pixel the mirror occupies in the final rendering. So compared to the same scene with a window instead of the mirror, you just need to calculate one additional reflection instead of running the entire rendering pipeline again.
Re:John Carmack's Comment on Hardware Ray Tracing by willvarfar on Thursday January 24, 2013 @01:31AM (#5107953)
I think John says not just one ray per pixel?
Re:John Carmack's Comment on Hardware Ray Tracing by yk on Thursday January 24, 2013 @02:42AM (#5108229)
Yes, I was essentially using one ray per pixel as shorthand for constant amount of rays per pixel. (As in 'I did not think about that point.') One needs more than one to avoid creating artifacts like aliasing ( see [1] for a very nice example), or depending on how 'naive' or complex the algorithm is for stuff like shadows or caustics. But for nice scenes (which do not create artifacts) with mirrors and lenses, one ray per pixel would work fine.

[1] https://en.wikipedia.org/wiki/Aliasing