News for hackers. Stuff that matters.
Re:John Carmack's Comment on Hardware Ray Tracing by chii on Wednesday January 23, 2013 @11:40PM (#5107381)
Having no real knowledge of ray tracing (or rendering for that matter), can someone tell me why we can't be moving towards a massive cluster of gpu (in the order of 10,000) ray tracing a scene in parellel? I imagine each ray trace call is quite independent of any other. SOooner or later, cpu (and gpu) will have many cores available for such form of rendering. Is it because of the chicken/egg problem?
Re:John Carmack's Comment on Hardware Ray Tracing by InclinedPlane on Thursday January 24, 2013 @01:17AM (#5107892)
This is indeed ray tracing's huge advantage, of being highly amenable to parallelization. However, the same thing is more or less equivalently true for other rendering methods, such as rasterization. Modern GPUs have thousands of rendering sub-unit "cores". And with CUDA you can use those cores for almost anything, including ray tracing. But for a given scene and a given amount of finite computing power you're almost always going to be able to get superior results using a rasterization technique than ray tracing.
Re:John Carmack's Comment on Hardware Ray Tracing by yk on Thursday January 24, 2013 @01:34AM (#5107973)
I think that rasterization is easier to parallelize than ray tracing, since raster engines essentially multiply each vertex with the same matrix, while for ray tracing you have to traverse an octtree for each step in each ray. ( Both are of course easy to parallelize, I just think that in general you will run into memory bandwidth problems faster with ray tracing algos.)
Re:John Carmack's Comment on Hardware Ray Tracing by ericmj on Thursday January 24, 2013 @04:27AM (#5108582)
Yes, memory bandwidth is one of the biggest slow downs of ray tracing. Rasterization access memory very linearly which makes it very easy to cache and easy to optimize in hardware on the GPUs. But ray tracing access memory very randomly, two rays originating from pixels next to each other easily diverges and so hits objects far from each other in the scene. This means that ray tracing will spend most of its time waiting for memory.
Re:John Carmack's Comment on Hardware Ray Tracing by gsg on Thursday January 24, 2013 @01:16AM (#5107884)
Ray tracing enjoys a ridiculous amount of inherent parallelism. That's not much of an advantage though, since rasterisers also enjoy a ridiculous amount of inherent parallelism.

Large scale "render farms" that exploit both already exist and are in commercial use in the VFX industry.

Re:John Carmack's Comment on Hardware Ray Tracing by danwills on Thursday January 24, 2013 @05:24AM (#5108773)
I work in the VFX industry, and I agree. We often need to make a choice between a rasterisation-like method - which in VFX usually means micropolygon rendering like Pixar's REYES algorithm - or a raytracing-based method, like SideFX Mantra's Phsically-Based-Rendering. It is also possible to hybridize the two, which usually means casting rays in order to shade micropolygons. Both approaches have their own advantages.

There are some tools that allow you to render a frame quickly by using many hosts to parallelise the task. This is usually only practical when the data that generates the frame is relatively small, in other words not gigabytes of fluid simulation voxels. It's also not realtime, by any stretch!

A renderfarm is usually not technologically any different to local rendering on a workstation. We generally don't parallelize across hosts within a single frame, but at least you can render lots of frames simultaneously!

Another thing that doesn't seem to have been mentioned on this post is that raytracing can be accelerated massively (where applicable) by using instancing. A single object can be used many times in a scene, only differing in its transformation. This allows the geometry to be stored in ram once and re-used, incoming rays that are incident on an instance's bounding box can simply be transformed into the local space of the instance. Of course this is of no help in an extremely complex scene full of unique objects, but in practice you can make great savings (and create very complex scenes that are cheap to raytrace) this way.

Re:John Carmack's Comment on Hardware Ray Tracing by duaneb on Thursday January 24, 2013 @09:33AM (#5109665)
> Another thing that doesn't seem to have been mentioned on this post is that raytracing can be accelerated massively (where applicable) by using instancing. A single object can be used many times in a scene, only differing in its transformation. This allows the geometry to be stored in ram once and re-used, incoming rays that are incident on an instance's bounding box can simply be transformed into the local space of the instance. Of course this is of no help in an extremely complex scene full of unique objects, but in practice you can make great savings (and create very complex scenes that are cheap to raytrace) this way.

You're also forgetting about the flip-side. A classic benefit of scanline renderers was that a scene could be split into multiple parts, which (via a z-buffer) could then be combined without any further rendering. A raytracer, on the other hand, has to have access to the whole scene (if you consider reflections, which make culling objects essentially impossible) to calculate any given pixel sample.

I don't know whether this is still an issue, but for a while it was a barrier to raytracing scenes on a Pixar level.

Re:John Carmack's Comment on Hardware Ray Tracing by Tloewald on Thursday January 24, 2013 @06:58AM (#5109075)
Minor note: as far as I am aware (i do not write 3d engines for a living but have written games and small 3d libraries for my own use) instancing works fine with both (all?) rendering approaches in just the same way.
Re:John Carmack's Comment on Hardware Ray Tracing by MrScruff on Thursday January 24, 2013 @09:25AM (#5109621)
The benefits of instancing are felt more keenly in ray tracing because of the need to keep geometry in memory. If you're just dealing with direct lighting it's very easy to load and discard geometry as required as you rasterize the frame. One you start casting secondary rays you end up having to keep more of the scene in memory in order to shade a particular surface, since the lighting contribution from other geo can't be localised.
Re:John Carmack's Comment on Hardware Ray Tracing by zxcdw on Thursday January 24, 2013 @12:20AM (#5107576)
AMD's vision of "heterogenous computing"(I think they came up with a new name for this?) would essentually be the "true" fusion of a CPU and a GPU in a sense that the chip consists of general purpose execution units(current CPU cores) and of special purpose parallel processing units (curent GPU SIMD/VLIW units) which operate concurrently in such sense that both sequential and parallel code can be executed efficiently on per-thread basis and as threads processed concurrently.

Something like this would really help with things like raytracing. But then again, as Carmack mentions, the huge disadvantage are the acceleration structures which need to be discarded and rebuilt per frame for dynamic objects. It's like saying that raytracing is by it's nature inferior(or at least very wasteful) from performance point of view. It's like a problem to which you simply don't say "Just throw more hardware at it!".

Re:John Carmack's Comment on Hardware Ray Tracing by cmccabe on Thursday January 24, 2013 @12:53AM (#5107743)
Rasterization also requires "acceleration structures," kept in memory. I could be wrong here, but I think the point John was trying to make was that there was again a constant factor handicapping ray-tracing. But constant factors are, well, constant, and in 2050 we may well have ray-tracing done in hardware delivering scenes that are indistinguishable from reality.

I wrote a ray tracer once, but it was primitive. So I'm not completely talking out of my butt, just mostly.

Re:John Carmack's Comment on Hardware Ray Tracing by dualogy on Thursday January 24, 2013 @01:52AM (#5108050)
> Rasterization also requires "acceleration structures," kept in memory

Yeah but surely not for the geometry itself. In rasterization, we may use simple low-overhead acc. structures to efficiently traverse a relevant sub-set of the whole (but coarsely described) scene for some fancy culling, collision detection (OK that's not really rendering) ... but geometry (vertices, polygons, vertex attributes) does not need to be traversed like that and thus does not have to be stored as individual triangles in an octree or bounding-volume hierarchy or what not. Quite a difference in overheads here. In GPU terms, with rasterization you have geometry neatly stored in vertex buffers and an awesome Z-aware traversal method with vertex shaders. In a simplistic current-gen fragment-shader-based raytracer, each pixel traces a ray traversing through your acceleration structure which may be stored in a volume texture (ouch, so many texel fetches...) since vertex buffers are not sensibly accessible in a frag shader.

> scenes that are indistinguishable from reality

This would also require a high dynamic range output device. Looking directly into perfectly raytraced sunlight still won't glare and blind me like the real world does, but indeed, by 2050...

Re:John Carmack's Comment on Hardware Ray Tracing by yk on Thursday January 24, 2013 @10:02AM (#5109838)
> This would also require a high dynamic range output device. Looking directly into perfectly raytraced sunlight still won't glare and blind me like the real world does, but indeed, by 2050...

You could try to look directly into a beamer instead of onto the screen, if glare is all you want. ( And by 2050 I would suspect that the scene is directly copied into the frontal lobe, bypassing the visual cortex.)

Re:John Carmack's Comment on Hardware Ray Tracing by gsg on Thursday January 24, 2013 @01:48AM (#5108028)
Rasterisation doesn't require any real acceleration structures. There are various caches, but nothing comparable to a kd-tree or BVH.
Re:John Carmack's Comment on Hardware Ray Tracing by malkia on Thursday January 24, 2013 @12:22AM (#5107582)
You would need all nodes to hold almost all geometry, even when you achieve this, you would have to cut the screen into 10,000 pieces of pixels, and then trace each one individually. Some of these small ares would finish much faster than the others, and it would be hard to move them to do another job (or expensive).

But that's from my simple understanding, possibly there would be other problems too...

Re:John Carmack's Comment on Hardware Ray Tracing by wmil on Thursday January 24, 2013 @12:42AM (#5107688)
Current rasterization methods also parallelize well. The problem is that ray tracing is just less efficient for most scenes.
Re:John Carmack's Comment on Hardware Ray Tracing by teamonkey on Wednesday January 23, 2013 @11:47PM (#5107419)
I think that's what he's implying when he says

   I am 90% sure that the eventual path to integration of ray tracing hardware into consumer devices will be as minor tweaks to the existing GPU microarchitectures.