DX9 vs DX11 (Forward vs Deferred Rendering)

I want to switch my game to DX11 (currently on Dx9). However there are some noticeable differences with the way that it handles light that I’m not happy with.

Here is an example comparing the two renderers:

If you look closely, in particular with specularity, there is a fairly dramatic loss of detail of light reflecting from rock surfaces.

In the DX9 example, you can make out distant paths by the light reflecting from their stony material. In the DX11 example, these details are lost.

Does anyone have any advice on working with DX11 in UDK?

According to the documentation, DX11 uses deferred shading for dynamic lights: UDK | DeferredShadingDX11

I’m wondering if there’s a way to prevent my dominant directional light from using deferred shading.

The problem is indeed with the deferred shading. Here is an example of DX11 with Forward Shading (the default shading method) and with Deferred Shading:

It basically looks broken to me.

Deferred Shading is forcibly used when running in DX11 for all movable lights. Because my game has a day/night cycle, I’m using a DominantDirectionalLightMovable as my main light source, so all materials lit by it use Deferred Shading.

The only way I can see to prevent it being used, based on the documentation (UDK | DeferredShadingDX11), is to set all my materials to have EnableSubsurfaceScattering=True.
image
Materials that use Subsurface Scattering are ignored and the default Forward Shading is used (even if you plug nothing into the Subsurface Scattering inputs in the material).

Here is another example of the difference between Forward and Deferred Shading:


As you can see, the default forward shading looks far more detailed.

Does anyone know how to either fix Deferred Shading (so that it looks as good as Forward Shading), or how to disable it on an individual light (so I don’t have to change all of my materials to use Subsurface Scattering)?

I did tests years ago and the only solution I found was to activate the SSS, as you say. Without using nodes for the SSS in the material.

Here an old post:
https://forums.epicgames.com/udk/udk-development/level-design-and-creation/289332-specularity-loss-using-movable-light#post31655385

Another problem I saw was some white dots in the landscape, I think due to the normal map.

I had some problems with white spots in DX11. I think it was because the DX11 renderer didn’t know exactly what it was supposed to do with an unlit material with emissive 0. My outline shader worked fine most of the time in DX11, but if I placed a room interior in front of a black background, I would see a really thick white outline around the room.


(Imagine a white line going all around the edges of that scene.)

As for switching to forward shading without the SSS hack, I’m pretty sure the only other way to do it is to edit the renderer in C++.

I think this has to be the biggest bug in UDK that I have come across.

Deferred Rendering is the primary rendering technique for dynamic lighting in UDK DX11. You would imagine someone at Epic would have noticed that specular was broken. Especially when they bothered to put together that GDC tech demo in 2011 showing it off.


In fact, if you look at this screenshot of the demo (when materials lit by deferred rendering are colored in green), you can see the specular on the gun barrel looks to be working correctly.

I would benefit a lot from Deferred Shading, as in my game players can place lights wherever they like, so some players go crazy with them and tank the performance. Deferred Shading would alleviate a lot of that performance cost.

I would love to figure out how to fix it…

Update:
You can toggle Deferred Rendering using the console command: TOGGLEDEFERRED

Im also using dx11 (custom Lightning) and in fact as you say is to have the SSS on even if you dont use it.In my case i need the dx11 because im using the sss to make snow and looks more ''fluffy+displacement ‘’ with the sss.
You can use also the SHPRT Lightning Model (docs says its old but i don’t see the difference between that and phong).
Or a third option is to use phong but as a shader setup and plug it in to custom lightning?

(but that late one will probably force you to change the entire main shader a little)

Cool find about the TOGGLEDEFERRED!
It did saved a few frames on my scene when toggling on/off.(not much like 5-8-10fps)
So that’s dx11 but with the dx9 rendered now?

I’m finally trying out DX11 now. I’m running into pure black and pure white spots in the landscape. They disappear when I add an exponential height fog actor. It doesn’t matter how thin the fog is. So long as it’s there, the white spots in the landscape disappear. But if the fog’s opacity is 0, or if I set a start distance to the fog, then everywhere that doesn’t have fog has white spots. Not sure if that helps anyone figure out what’s wrong.

What about the loss of specularity on your materials? Or are you disabling deferred rendering (which would be a great shame given that it’s probably the primary key feature of DX11).

I find that even if I disable deferred rendering on DX11, I get around a 30% drop in performance over DX9. I haven’t dug into what might be causing this drop yet, but it’s enough for me to “defer” switching to DX11 (pun intended :wink:).

And now that I’m finally reading deeper into this, I think I can come away with the following information:

Deferred shading in DX11 is faster.
Specular is broken when using deferred shading.
You can turn off deferred shading on a material by enabling SSS or by using non-Phong lighting.
But by disabling deferred shading on a material, you’re losing the performance that you should have by running DX11.

The deferred shading example that @Coldscooter showed, with the streetlamp, that looks to me like the material has a very high specular power. Have you tried messing with specular power? Is everything clamped the values listed at the bottom of UDK | DeferredShadingDX11 ? I should take a look at the DX11 renderer and see if it’s messing up the specular power somehow.

Edit: haven’t noticed a loss of specularity, but I’m using very, very simple meshes that don’t even have specular maps. I am using deferred rendering, and it is the primary reason why I switched to DX11. I’ll do some experiments to see what I can find out about specular, specular power, and performance versus DX9 with lots of dynamic lights around. I’ll get back to you on that.

I did some tests although I didn’t spend a lot of time on them. White dots on the landscape disappeared if you disabled the normal map on the landscape material. Perhaps it’s necessary to reduce some intensity in them.

curious about the spots in the landscape. I’d also suspect the normalmap as CobaltUDK suggests, as they could very much be NaNs.
if you use no normalmaps do you still get them? and if thats the case, back to using normalmaps are you using NormalMap compression are you channel-packing them?