Tim Sweeney on shadows and HDR rendering on ATi cards

Well, I was pleasanly surprised that after 5 minutes, I had gotten a reply from Tim on my questions. So I asked basically about shadowing in Unreal Engine 3. I hope you guys find this interesting!

Would dynamic, soft-shadow buffers be possible (from an actual functionality standpoint) to be cast from everything onto everything?

That's possible, but to get good results (and avoid aliasing) you need *extremely* high-resolution shadow maps, such as 2048x2048 or higher. And the performance impact of rendering shadow buffers for all objects in the scene for every light (as opposed to only dynamic lights or dynamic objects) is fairly high. This seems like it will be a viable technique in the future, perhaps when GPU's are 4X-10X faster and state-change overhead is further reduced.


Are the stencil volumes "softened" by use of filtering or fragment program processing?

We have a shader that performs oversampling, and it takes advantage of bilinear filtering to enhance the blurring effect.


What exactly is a "pre-computed shadow mask"?


This is a single-component, 8-bit-deep texture map applied to surfaces in a similar way to a lightmap (though lightmaps store 3-component RGB values). A shadow mask's greyscale values indicate the percentage occlusion from the light to each texel on a surface, independent of the light's attenuation, color, and brightness. The shadow mask stores the shadow part of a lighting computation in a precomputed way, while the per-pixel normal-mapping, specular lighting, and attenuation are done dynamically.


How is High-Dynamic-Range rendering done on R300/R420 class visual processors?


The only special consideration on that hardware is its lack of floating-point blending. To work around that, we swap to a new render target, and perform manual blending in a shader program, using the original render target as a texture. This is slower than real floating-point blending, but only affects total performance by 20% or so

Well, I'd like to thank Tim for answering my email!
 
Neat thing is, we're going to have HDR on R300/R420 cards, and it's going to look the same as nVidia floating point blending HDR, in UE3.

Also this means, less hard-edged stencil shadows as well, along with pre-computed shadows when dynamic shadows aren't needed.

I think Unreal Engine 3 is going to turn out to be a beast :)
 
So the shadow mask only works on static light and static object, and you only need to dynamically compute the specular effect on such interaction?
 
Alstrong said:
a 20% hit is quite huge....

@ Alstrong-Yes, especially since those cards are the slower ones to begin with.

However, I don't really expect that any enthusiasts will be running Radeon 9800 pros for Epic's next game, which is at least a year off.

@ 991060- Yeah, if you have a static light on a static object, you get a shadow mask, and the specular and normal map lighting are done in real-time. Saving much computing power (especially with much complex, static geometry). I think that this is a quite interesting approach, since it allows for dynamic shadows when needed with dynamic lights, and static shadows are pre-computed since they don't need to move, saving much performance.
 
Alstrong said:
a 20% hit is quite huge....

If you consider the performance hit for FP16 Blending/Filtering in Far Cry on the GeForce 6 series, 20% sounds optimistically small under this method.
 
Cool. 8) His answers about shadows are pretty much exactly what I had been thinking a few weeks ago. I had even thought about the shadow mask as a way to model soft shadows. Time for a cookie! ;) Too bad I was too lazy to try and write a demo. . .
 
DaveBaumann said:
Alstrong said:
a 20% hit is quite huge....

If you consider the performance hit for FP16 Blending/Filtering in Far Cry on the GeForce 6 series, 20% sounds optimistically small under this method.
Well, he mentioned a 20% hit in relation to FP blending, so I think he means it's 20% slower than FP blending. Could he determine this by testing both FP blending and the MRT (wrong term?) alternative on a GF6, or is he saying this b/c both the X800 and 6800 are otherwise equal in speed--or is he testing both methods on ATi's R500/R520?

Edit: Clarity. Stylistic, anyway, as odds are I'm missing something that Dave knows WRT interpreting the 20% figure. Bjorn's post may be closer to Dave's thinking, but considering the hit Far Cry takes for FP blending, I'm doubtful (despite my ignorance). Thanks for the correction, Andrew.
 
Pete said:
...than FP blending. Could he determine this by testing both FP blending and the MRT (wrong term?)...

Wrong term. MRT's dont have anything to do with rendering to a floating point render target (for HDR) - it's just a way to output more than 1 value from a shader (and store it).

The alternative to using hardware blending for fp render targets is to "ping-pong" two fp render targets to do the blending in the shader.
 
Let me guess they aren't doing any HDR on transparent surfaces? Espically particles. I'd love to see them ping-pong 10K particles and say there is only 20% preformance loss. So I'm fairly certianly not eveything will be rendered using HDR properly. The 20% TOTAL preformance loss sounds too low but maybe U3 is the crazyly fillrate limited that its only 20% on top cause in a scene with atleast 1 transparent surface your going from a single 32bit framebuffer your going to frame buffers with atleast 64bits so thats a 2-4x depending on overdraw bandwidth jump.
 
XxStratoMasterXx said:
Would dynamic, soft-shadow buffers be possible (from an actual functionality standpoint) to be cast from everything onto everything?

That's possible, but to get good results (and avoid aliasing) you need *extremely* high-resolution shadow maps, such as 2048x2048 or higher. And the performance impact of rendering shadow buffers for all objects in the scene for every light (as opposed to only dynamic lights or dynamic objects) is fairly high. This seems like it will be a viable technique in the future, perhaps when GPU's are 4X-10X faster and state-change overhead is further reduced.

So... hummm, what does Tim think of the engine JC is working on now. Or better yet, of JC's build of D3 where he could toggle between stencils and shadow buffers?

Nice mini-Q&A, XX.
 
DaveBaumann said:
Alstrong said:
a 20% hit is quite huge....

If you consider the performance hit for FP16 Blending/Filtering in Far Cry on the GeForce 6 series, 20% sounds optimistically small under this method.

Someone here mentioned (i think it was Xmas) that the FP blending/filtering done in Far Cry was very unoptimized. So perhaps we shouldn't pay to much attention to the loss of performance in that game.

Though i agree with Pete in that he was probably talking about performance compared to "real" FP blending. Otherwise FP blending must have a performance hit that's <20% which i agree in that it sounds rather optimistic. But combine unoptimized blending in Far Cry and the very probably more shader limited UE3 engine and perhaps you will end up with something like that.
 
Mordenkainen said:
So... hummm, what does Tim think of the engine JC is working on now. Or better yet, of JC's build of D3 where he could toggle between stencils and shadow buffers?
Tim will probably say it's, um, scary.
 
Reverend said:
Mordenkainen said:
So... hummm, what does Tim think of the engine JC is working on now. Or better yet, of JC's build of D3 where he could toggle between stencils and shadow buffers?
Tim will probably say it's, um, scary.

And then blows it away with a flak cannon. ;)
 
Bjorn said:
Someone here mentioned (i think it was Xmas) that the FP blending/filtering done in Far Cry was very unoptimized. So perhaps we shouldn't pay to much attention to the loss of performance in that game.

That and this are all you have to go by at the moment and they are both giving similar indications.
 
Reverend said:
How many bits are we talking about?

Well, in this Maximum PC interview Tim says that all rendering is done in 64bit high-dynamic-range.

I'm guessing this HDR technique is the same as John Carmack's technique he talked about in his .plan in 2003, and what he said would be enabled as a fallback stage in the QCon2004 speech for R300 cards. The one B3Der's told me was a painful and well known workaround.

Reverend said:
Tim will probably say it's, um, scary.

Why do you say that?


Oh and also, didn't a certain forum member say Stencil Volumes are dead and that John Carmack was completely wrong to use them? Well, in UE3, it seems to be the primary algorithm for dynamic shadowing, so I think Stencils still have a ways to go as a mainstream shadowing algorithm.

I wonder if Ultra Shadow will be used in Unreal Engine 3 at all for performance gains?
 
Probably because its unlikely a dev will comment on a competitor devs engine. I mean why ask Tim Sweeney what he thinks of Carmacks engine anyway?
 
Back
Top