Material rendering bug in 4.8

I made this a new thread since I know now that it is a bug and I want to make sure the right people see this:

Material rendering in 4.81:

48122-ertergdf.gif

Material rendering in 4.61:

48124-ert4545ergdf.gif

The gifs should make it pretty obvious, anyway, with that material setup there should be no reflection nor specularity yet it clearly is there on the box in 4.81. In 4.61 it is rendering correctly.

I don’t know since when this bug exist, I just used 4.61 as any older engine.

Hi Davision -

I am not seeing the results that you are seeing in comparing version 4.8.1 to previous versions of the engine.

Can you confirm that Live Preview and Realtime are on in your version of 4.8 and or that you have compiled or saved the material?

Sorry for better clarity here is 4.8.1:

48383-materialrendering.gif

Thank You

Eric Ketchum

The important part is that the luminance of the faces change when changing the view which also happens in your gif. I know now that it is some sort of reflection fresnel which is now how the shader works.

Luckily someone over at polycount got me a fix for this:
"Shader folder: DeferredLightingCommon.usf line 103

//float3 Diffuse = Diffuse_Lambert( GBuffer.DiffuseColor );
float3 Diffuse = Diffuse_Burley( GBuffer.DiffuseColor, LobeRoughness[1], NoV, NoL, VoH );

uncomment 103 and comment out 104. "

So at some point you at Epic changed the shading from Lambert to Burley and Burley does that fresnel reflection even when you have it set in the material to have no reflection. I don’t know why that is intended but luckily I can opt out with that change in the shader file.

Here is the whole thread on polycount, I was not the only one confused by it: http://www.polycount.com/forum/showthread.php?t=154488

I’m having the same issue in 4.8.

Here’s a screenshot :

The material is fully rough and the specular has been setted to 0. The only “light” on the scene is a fully white post processing cube map. So you should be seeing a completely flat color, and that’s obviously not the case.

My game uses a 2D-like aesthetic, so the issue is really obvious.

Hey Guys -

Okay I understand what you are talking about now. I am marking Davision’s comment as the answer, as if someone needs or wants to use Lambert model.

This shader model was changed in 4.8 and you can read about the discussion here on the forums, Engine Features Preview 1/22/2015 - Announcements - Epic Developer Community Forums under New Diffuse Shader Model

Also if you have not I recommend reading the paper by Burley, which can be found here:

SIGGRAPH 2012 Course: Practical Physically Based Shading in Film and Game Production

where it is discussed why that model of Diffuse lighting is more accurate and performant.

Thank You

Eric Ketchum

I was still having the issue after applying the fix and turns out it was because of CubeMaps.

If you’re using either Ambient CubeMaps or Skylights you probably want to change the line 106 in PostProcessAmbient.usf to use Lambert too.

Edit: Nope, actually the important change is in the line 477. Change the 1 to a 0 and that should make the trick.

I tried to make that change but then it always crashes.

Is it this:

	float3 Diffuse = Diffuse_Burley( GBuffer.DiffuseColor, Roughness, NoV, NoL, VoH );

to this:

	float3 Diffuse = Diffuse_Lambert( GBuffer.DiffuseColor, Roughness, NoV, NoL, VoH );

?

No, Diffuse_Lambert just takes one float3 parameter, that’s why it crashes. It should be :

float3 Diffuse = Diffuse_Lambert( GBuffer.DiffuseColor );

Also, don’t forget to change the line 477 to :

#if 0