I'm working in UE4 and I would like to have my material without any reflection, so I set metallic and specular to 0 and roughness to 1. But I still get visible reflection going on:
Now I'm seriously wondering if it is not possible to make lit materials in UE4 without any reflection? I also tried using only a directional light but it stayed reflective.
For my game I want everything to be static including any reflection, specular etc since I want it to look like you are in a painting. But I also see it problematic for other styles.
Here is the problem in a better context:
with that reflective effect going on it is impossible to merge the grass alphas with the terrain grass texture.
Replies
You might be seeing the constant Fresnel reflection, if UE4 represents that on rough/nonmetal surfaces. It's difficult to tell what it looks like from the top Gif.
Correct in 4.61:
Broken in 4.81:
Don't know what is going on and how something this essential can slip through. Well, I hope it gets fixes soon.
"New: Switched diffuse shading model from Lambert to energy conserving Burley."
If that is true I'm screwed and I have hard time to understand how that should be more realistic and why they make such a big change in rendering when the engine is out of a beta a long time ago. That would mean every material has that fresnel and I assume I have no chance to change that because that is how the engine then renders it.
For my game the change is much more worse because I only want to have diffuse lit materials and there is the merge problem with grass. I also calculate lighting in my shader by dividing scene color with diffuse color. (There is no other way in UE4 to get the lighting)
As the result that fresnel effect is even worse with my post processing shader:
Unlit shader means it will have no lighting. What you mean with emmissive funtion?
Disconnect your metallic input and only use specular with a value of 0. Having metallic connected overrides specular input. There's an If-statement for that when the shader is compiling.
The proper way of doing this though is having a programmer removing all fancy PBR calculations in code. It's a waste of performance to have PBR shaders running and not using it's features.
You can try opening ...\UE4\x.x\Engine\Shaders\BRDF.usf
search for #define PHYSICAL_SPEC_F
it is by default set to 1 (Schlick). change it to 0 (None) to disable fresnel.
You can also try changing PHYSICAL_SPEC_D from 2 (GGX) to 0 (Blinn) which might make the shading a little bit more conventional.
That is likely very tricky since it not just fresnel and instead some special fresnel based on lighting with reflection somehow. But if all fails I give that a try.
That didn't help it. From how I understand PBR it is not just in the shader but also in the lighting and UE4 is build around PBR. So if I would get rid of PBR in the shaders the lighting would look strange.
I tried that now but unfortunately that didn't change it. I then went to replace the whole BRDF file with the old one of 4.6 but no change either. The materials/shaders were all compiling again when I opened my project but for some reason there is no change. I even tried to just replace all shader files with the ones of 4.6 but that just crashed the engine.
While comparing the 4.6 file with the 4.8 one I found out that this is the only #define changed: To: Sort of cell-shaded, basically using ramps. Mapping lighting to a ramp texture that includes all Hues in V in the post processing material/shader (additionally color luminance gets blended in by 2 additional ramps textures).
The thing is Unreal engine shader making is basically just making materials in a node based editor which then get compiled as shaders. That is then somehow based on the BRDF. Even if I could just replace the BRDF with something else I doubt I still could make use of the material editor.
As I see it UE4 is very much constrained in that regard and build around just realistic rendering and shaders.
Doesn't look like it.
//float3 Diffuse = Diffuse_Lambert( GBuffer.DiffuseColor );
float3 Diffuse = Diffuse_Burley( GBuffer.DiffuseColor, LobeRoughness[1], NoV, NoL, VoH );
uncomment 103 and comment out 104. Then in the console "recompilescripts changed"
Im not sure if this will work as I don't have the ue4 source downloaded.
But as far as I can tell that will change the diffuse lighting model of the standard shader back to lambert.
This is not true at all, it just requires some shader work if you don't want to have physically imitated Fresnel, specular, reflections etc
This is half true - "materials" and "shaders" are different things. Materials contain custom elements that are then compiled with the rest of the shader that contains the lighting calculations. Things like how point lights and spotlights interact with the surface, how the image based lighting works, how the shadows happen etc. That contains the lighting model.
Imagine you are editing the diffuse of a material. Lets say diffuse is "D" In the shader - in code - the Unreal engineers have already done the complicated work of what happens when light hits the surface. Lets call those calculations "L". So that complicated math we are going to call "DdotL"
In the material editor lets say I want to multiply a texture map by a color (red) and plug that into the diffuse element of the shader. Thats going to be "2DTexture * (1, 0, 0)"
So at the end of the day all you are doing is
( 2DTexture * (1, 0, 0) ) = D
and the compiler then takes that D and does the Lighting Calculations to it and you end up with..
DdotL
So all of that DdotL information happens in the shader, if you change an element of the shader in code, as long as you wrote it correctly and it compiles you can still edit the inputs of the shader in the material editor
Recompileing wasn't needed, well the engine automatically recompiled all shaders on loading the project.
It is tempting to change more of the shader source but for me it appears rather complex with so many files and code.
As for mateials being different things, it can also vary a lot what materials are. With the default shader materials in Unity you can basically only change the textures and some parameters that the shader allows and there is then no shader compiling required I guess. In UE3 you can do a whole lot with the material editor including changing how lighting works. In UE4 you can not do that not anymore which I'm not sure why.
Well, I guess materials always just allow you to change how the shaders work and not add to it. Shaders could allow materials to change close to everything or keep it very simple. I think the thing with UE is that it compiles the materials intelligently so the shader code required is low while a whole lot is possible in the material editor.