Monday, November 5, 2007

Hybrid algorithms

Some movies are made with a "hybrid" algorithm where rasterization is used for the visibility pass and ray tracing is used for some or all of the shading. This raises two questions:
  1. Why is this done rather than using just one algorithm?
  2. Would this technique be good for games?
First question 1: the reason it makes sense to use both is that rasterization is fantastic at dealing with procedural images. It is the basic Reyes look that is still going strong after almost 25 years: for each patch, dice in micropolygons while applying displacements. If you do a billion micropolygons, no problem as they are never stored. The frame buffer is where the action is. Now suppose you want to do ambient occlusion; the best way to do that is ray tracing. But ray tracing on procedural geometry is slow. Using Pharr et al's caching technique is probably the best known method. But an alternative is just not to apply the displacements and use less geometry as PDI did for the Shrek 2 movie (see their siggraph paper for details). That idea goes back to at least Cohen's 85 paper where detailed geometry is illuminated by a coarse model.

Now question 2: would this be good for games. Nobody knows. I will give two arguments, one for, and one against. The reason this will happen is again procedural geometry. But there will not be so much that it wont fit in core. Still doing it with rasterization will help locality and something like a DX10 geometry shader can be used, and efficient use of caches is where the action is and will continue to be. Now an argument against: Whitted-style ray tracing has good locality and thus such complexity is not needed. Once games use ray tracing they may as well use it for visibility for software simplicity. My bet is on the latter, but I sure wouldn't give odds. If graphics teaches us anything, it is that predicting the future is difficult!

12 comments:

Ryan said...

Another argument for a hybrid approach in the context of film rendering is the how cheap motion blur and depth of field are. With a REYES renderer you just transform your samples into image space and then interpolate the values along the motion vector, similar for depth of field. This is of course incorrect as you assume the shading is constant over the frame time delta, but this generally isn't a problem. Texture locality is another big win. Film assets tend to have multiple gigs of texture data. It's not uncommon for a hero character to have an upwards of 40 gigs worth of textures. This may be excessive for what is actually required to maintain an acceptable fidelity in the final frame, but it's cheaper to pay an artist to just paint everything and then let the renderer decide what is required than to train an artist to work within the bounds of the rendering algorithm being employed.

I think there are a lot of positive arguments for hybrid rendering in games. For one, it's easier to sell ray tracing to the game development community. As far as they are concerned, everything is pretty much the same except a large set of effects just got easier to implement or became more correct. Once the game development community begins to understand ray tracing, perhaps they can slowly be weened off of rasterization implementations, at least where it makes sense. Texture locality is important in this domain too, perhaps even more so. Being able to render with texture data out of core is very appealing due to both the large environments in games and the cost of on card memory. It's easy to throw more memory at the problem in off-line rendering, but games require a lot of complicated LOD techniques, many of which are dependent on texture locality.

- Ryan

Thomas said...

ryan geiss?

personally i think it'll be a while before we see bona fide ray tracing in games, even selectively. the first step is finding efficient gpu traversal algorithms which don't need a stack (or the development of gpus with stacks). it's certainly true that game developers aren't shy to use ray tracing in restricted situations (e.g. parallax mapping, which is really just isosurface intersection via ray marching).

Robin said...

If you remember news from Intel, the design of GPUs is about to change radically (especially given the games industry names Intel have been aggressively hiring recently). Why have a programmable pipeline when you can just program your own pipeline? Realtime raytracing is about to get a new lease of life.

henri.fousse said...

What's the exact reference of the Siggraph paper you're referring to ? Thanks

Peter Shirley said...

Hi-- the reference is:
http://portal.acm.org/citation.cfm?id=1015748

henri said...

thanks

David L said...

Measured in terms of performance per Watt (and almost no other measure matters for high-end realtime graphics), hardware-assisted rasterization with multisampling is an incredibly efficient way to cast antialiased primary rays. A modern GPU can probably render roughly 1 million-polygon scenes at 2560x1600 with multisampling at well over 100 Hz. Game developers are reluctant to give up any performance at all, so if you rely on the purity or cleanliness of ray tracing algorithms to win them over, it will be a long time and a slow transition to casting all primary rays "for simplicity". I think this will only happen when the rendering performance is "good enough".

New visual effects are a better motivation for ray tracing, but the problem is most ray tracing "looks" can be and are rendered convincingly using techniques with rasterization. E.g. games use precomputed light maps today for global illumination, it looks great. To improve on this with ray tracing, you need to posit lots of highly dynamic objects, and then you've got to build the acceleration structure for those objects really darn fast, and it's a linear-time problem likely to be bandwidth-bound. So you'd like to be on a platform with a throughput-oriented high-bandwidth memory subsystem...like the GPU. And if you're on a GPU why not rasterize those primary rays while you're at it...

I think there are other "hybrid" approaches that make sense. For example use a traditional shadow map (created with Z-only rasterization, insanely fast on todays GPUs) that catches most shadows, then cast rays in the ambiguous pixels where. Because you have the RT "fallback" you can be much more casual about sizing your shadow map, using clever tricks like cascaded shadow maps, etc., than today's developers have to be.

sexy said...

情趣用品,情趣用品,情趣用品,情趣用品,情趣用品,情趣用品,情趣用品,情趣用品,情趣,情趣,情趣,情趣,情趣,情趣,情趣,情趣,A片,視訊聊天室,聊天室,視訊,視訊聊天室,080苗栗人聊天室,上班族聊天室,成人聊天室,中部人聊天室,一夜情聊天室,情色聊天室,視訊交友網a片,a片


免費A片,AV女優,美女視訊,情色交友,免費AV,色情網站,辣妹視訊,美女交友,色情影片,成人影片,成人網站,A片,H漫,18成人,成人圖片,成人漫畫,情色網,日本A片,免費A片下載,性愛

A片,色情,成人,做愛,情色文學,A片下載,色情遊戲,色情影片,色情聊天室,情色電影,免費視訊,免費視訊聊天,免費視訊聊天室,一葉情貼圖片區,情色,情色視訊,免費成人影片,視訊交友,視訊聊天,視訊聊天室,言情小說,愛情小說,AIO,AV片,A漫,avdvd,聊天室,自拍,情色論壇,視訊美女,AV成人網,色情A片,SEX,成人論壇

情趣用品,A片,免費A片,AV女優,美女視訊,情色交友,色情網站,免費AV,辣妹視訊,美女交友,色情影片,成人網站,H漫,18成人,成人圖片,成人漫畫,成人影片,情色網


情趣用品,A片,免費A片,日本A片,A片下載,線上A片,成人電影,嘟嘟成人網,成人,成人貼圖,成人交友,成人圖片,18成人,成人小說,成人圖片區,微風成人區,成人文章,成人影城,情色,情色貼圖,色情聊天室,情色視訊,情色文學,色情小說,情色小說,臺灣情色網,色情,情色電影,色情遊戲,嘟嘟情人色網,麗的色遊戲,情色論壇,色情網站,一葉情貼圖片區,做愛,性愛,美女視訊,辣妹視訊,視訊聊天室,視訊交友網,免費視訊聊天,美女交友,做愛影片

av,情趣用品,a片,成人電影,微風成人,嘟嘟成人網,成人,成人貼圖,成人交友,成人圖片,18成人,成人小說,成人圖片區,成人文章,成人影城,愛情公寓,情色,情色貼圖,色情聊天室,情色視訊,情色文學,色情小說,情色小說,色情,寄情築園小遊戲,情色電影,aio,av女優,AV,免費A片,日本a片,美女視訊,辣妹視訊,聊天室,美女交友,成人光碟

情趣用品.A片,情色,情色貼圖,色情聊天室,情色視訊,情色文學,色情小說,情色小說,色情,寄情築園小遊戲,情色電影,色情遊戲,色情網站,聊天室,ut聊天室,豆豆聊天室,美女視訊,辣妹視訊,視訊聊天室,視訊交友網,免費視訊聊天,免費A片,日本a片,a片下載,線上a片,av女優,av,成人電影,成人,成人貼圖,成人交友,成人圖片,18成人,成人小說,成人圖片區,成人文章,成人影城,成人網站,自拍,尋夢園聊天室

Joshua said...

I'm still think ray tracing won't hit full stride until rasterization hits it's limits. If you compare computer games five years ago like Battefield 1942 to Crysis, it's a major jump in visual quality. I think we can expect a lot from GPUs in the next few years. It wouldn't be a major change in architecture, for example, if new GPUs started supporting 64x supersampling like we see in movies today. That alone would produce some very competitive images. Also with subdivision surfaces now becoming mainstream on the GPU as fully deformable meshes, the idea that ray tracing can't build equally fast acceleration structures for these animating meshes makes ray tracing less appealing. If I understand correctly, deforming meshes can be instanced much easier with a GPU since you only need one copy in memory and can reposition it on the fly for every pose, while ray tracing needs a copy in memory for each unique instance. I guess this becomes less important as memory gets cheaper and cheaper, but those acceleration structures still have to be built.

I see this as part of the negative aspects of a hybrid renderer. Using a ray tracer, you need an acceleration structure no matter what. You can't rasterize the animated geometry without spending the time rebuilding the acceleration structures for everything that might be ray traced. I see real-time skinning as one of the biggest hurdles in ray tracing. The Unreal engine demoed a crowd of a thousand creatures running through the road, each having a unique pose of animation and while taking up a small footprint in memory. I would find that difficult to efficiently implement in a ray tracer.

eda said...

情趣,G點,性感丁字褲,情趣,角色扮演服,吊帶襪,丁字褲,情趣用品,無線跳蛋,男女,

按摩棒,電動按摩棒,飛機杯,視訊,自慰套,自慰套,情趣用品,情趣內衣,

情趣按摩棒,自慰套,角色扮演,按摩棒,跳蛋,情趣跳蛋,
.,
潤滑液,SM,內衣,性感內衣,自慰器,充氣娃娃,AV,

smallawei said...

情人節|情趣商品,情色文學,嘟嘟,情色網,情趣商店,

G點,按摩棒,轉珠按摩棒,變頻跳蛋,跳蛋,無線跳蛋,

飛機杯,男用強精長軟質套,男用強精短軟質套,充氣娃娃,男性性感內褲,性感內褲,
自慰套,自慰套,情趣娃娃,自慰器,電動自慰器,充氣娃娃,
角色扮演,角色扮演服,

性感睡衣,情趣睡衣,性感內衣褲,性感內衣,內衣,性感內褲,C字褲,內褲,
性感貓裝,性感睡衣,貓裝,吊帶襪,情趣內褲,丁字褲,SM道具,SM,

震動環,潤滑液,情趣禮物,情趣玩具,威而柔,精油,逼真按摩棒,數位按摩棒,

情趣,情趣用品,巴黎,

Entertainment said...

home city trung kính

http://homecitytrungkinh.com.vn/

home city

http://homecitytrungkinh.com.vn/tong-quan-du-an-home-city/

chung cư trung kính

http://homecitytrungkinh.com.vn/mat-bang-can-ho-chung-cu-trung-kinh/

trung kính complex

http://homecitytrungkinh.com.vn/tien-ich-trung-kinh-complex/

5S Online - mùa 3 - Tập 66: Tình cậu duyên anh - Phần 1

5S Online - mùa 3 - Tập 65: Con nuôi sếp tổng - Phần 2

5S Online - mùa 3 - Tập 64: Con nuôi sếp tổng - Phần 1

5S Online - mùa 3 - Tập 63: Cắt đuôi sao cho xuôi - Phần 3

5S Online - mùa 3 - Tập 62: Cắt đuôi sao cho xuôi - Phần 2

5S Online - mùa 3 - Tập 61: Cắt đuôi sao cho xuôi - Phần 1

5S Online - Tập 54: Làm giàu quá khó cần có vận may - Phần 3

5S Online - Tập 53: Làm giàu quá khó cần có vận may - Phần 2

5S Online - Tập 52: Làm giàu quá khó cần có vận may - Phần 1

chung cư t&t riverside

chung cư 440 vĩnh hưng

chung cư t&t riverside 440 vĩnh hưng

bat dong san

bat dong san cho thue

bat dong san ban