Godot: Roughness Texture breaks Specular

Created on 14 Nov 2019  路  13Comments  路  Source: godotengine/godot

Godot version:
3.2 Beta
OS/device including version:
Windows 64 bit
Issue description:
EDIT
Apparently, anything other then a value of 1 on roughness makes it impossible to turn specular off. No texture is needed. below you can see a Eevee and Godot comparison, both use the same hdri, its at a different angle though.

Godot:
Head_Roughness

Blender 2.8:
Head_Roughness_Blender

Adding a roughness texture makes it impossible to turn off specular. Not sure if this is a bug or intended but when using blender's eevee turning off specular, even if a rougness map is added disables specular. Also this happens with panorama sky or procedural sky, so I assume it affects all sky modes.

BrokenRoughness

Steps to reproduce:
Create a object, add a material and give it a roughness texture. try turning off specular in metallic and in the parameters setting specular to disabled. Notice there is still specular.

Minimal reproduction project:
I added an hdr as it makes it easier to see

RoughnessIssue.zip

bug rendering

Most helpful comment

@NHodgesVFX as clayjohn mentions, the specular value is somewhat misleading, as it is the specular reflectivity along the facing (not grazing) normal direction. The default 0.5 gives you 4% reflectivity and the 0-1 range goes from 0-8% reflection only along the facing direction.

Honestly I don't really ever touch this, as the whole idea of PBR is that it cheats to give a good average of 4% (0.5 specular) that works with almost all dieletric(non-metallic) materials. You could lower it a bit for skin or water and ice, but mostly you don't want to touch it!

Some useful links:
https://docs.blender.org/manual/en/latest/render/shader_nodes/shader/principled.html
https://docs.unrealengine.com/en-US/Engine/Rendering/Materials/PhysicallyBased/index.html
also the substance website and google filament docs have great theory to read.

All 13 comments

To add more information it appears that there are two different types of specular reflection that dont really influence each other. There is the specular reflection which is affected by the specular slider, specular mode, and gets blured by roughness. Overall the specular reflection works fine.
The issue appears to be from an "Enviroment reflection" that is only influenced by roughness. From the looks of it the "enviroment reflection" duplicates the specular reflection. If it does just duplicate the specular reflection it should probaly be removed. Although, this is really hard to tell and im not sure if it actually duplicates it. Either way the "Enviorment Reflection" should be influenced by the specular mode and slider(in the metallic section).

I think this may be the same underlying issue as https://github.com/godotengine/godot/issues/21680 in that case specular is also way too strong on rough non-metals.

Edit: actually im fairly certain this is an environment map issue. There are specular highlights from lights and from the environment map. Setting "specular_disabled" only disables the specular lobe from the lights. What you are seeing is a specular highlight that is way too strong coming from the environment map.

I labelled this an enhancement as I was thinking that turning off IBL specular would be a new feature. But come to think of it, IBL specular shouldn't be treated any different thank regular specular. When you turn off ambient light IBL diffuse irradiance turns off, so when you turn off specular, IBL specular should turn off too.

I think the reason this hasnt been added is that IBL specular is the environment reflections. So if you turn of specular you will lose reflections.

I originally misunderstood this issue as being about specular reflections being too strong.

For the record, the specular slider is not "how much specular" but rather how large the specular blob is.

I think this should be added because if you turn specular to 0, I think most people would think that means no reflection of any kind. This is also the behavior in blender as well. Turning specular off disables all reflections. Although in blender setting specular to 0 does not affect diffuse light. So if we could get the above 2 behaviors that would be awesome. Thanks once again for looking into this :)

@NHodgesVFX The specular setting isnt "how much specular" though. Since Godot uses a PBR renderer. specular affects the specular blob calculation.

Right now I am making a PR that turns off IBL specular when SPECULAR_DISABLED is true. We should have a deeper discussion over whether the specular slider should also affect reflections.

Maybe looking into other engines would be a good starting point, specifically, unity and ue4. I'll see if I can do that tomorrow

@NHodgesVFX as clayjohn mentions, the specular value is somewhat misleading, as it is the specular reflectivity along the facing (not grazing) normal direction. The default 0.5 gives you 4% reflectivity and the 0-1 range goes from 0-8% reflection only along the facing direction.

Honestly I don't really ever touch this, as the whole idea of PBR is that it cheats to give a good average of 4% (0.5 specular) that works with almost all dieletric(non-metallic) materials. You could lower it a bit for skin or water and ice, but mostly you don't want to touch it!

Some useful links:
https://docs.blender.org/manual/en/latest/render/shader_nodes/shader/principled.html
https://docs.unrealengine.com/en-US/Engine/Rendering/Materials/PhysicallyBased/index.html
also the substance website and google filament docs have great theory to read.

ok, so I have a question. In Blender using evvee with the principled shader changing specular to 0 also affects reflections. However, in marmoset changing specular does not affect reflections, similar to godot. If you change the Fresnel slider in marmoset it affects reflections. So it appears I was trying to customize the Fresnel.

So my question does blender's principled material couple the specular with the Fresnel, effectively changing specular to 0 also changes Fresnel to 0?

This was auto-closed by #33668 but based on the above discussion, I guess it should stay open?

@akien-mga yes it should stay open for now, depending on the resulting discussion above i might close this issue and open a new one. Thanks :)

@NHodgesVFX Can you reproduce this in 3.2.2beta2 or the master branch?

@NHodgesVFX Can you reproduce this in 3.2.2beta2 or the master branch?

I think now that im looking at this again, this is more of a feature request. I guess the whole point of this issue was to make note there is no way to disable environment reflections on a per material basis. I might be forgetting something though. Thanks for reminding me about about this PR. Im going to close it as it should probably be rewritten to narrow the issue down more.

@NHodgesVFX reopening. Reduz and I already discussed how to make this work. It is on my TODO list and I prefer to keep the issue open until I implement it.

Was this page helpful?
0 / 5 - 0 ratings