Page MenuHome

EEVEE principled bsdf shader no longer handles negative specular values gracefully
Closed, ResolvedPublic

Description

System Information
Operating system: Linux-5.4.0-70-generic-x86_64-with-glibc2.31 64 Bits
Graphics card: GeForce GTX 1060 6GB/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 460.39

Blender Version
Broken: version: 2.93.0 Alpha, branch: master, commit date: 2021-03-31 04:29, hash: rBe7f890aa59ad
Worked: 2.92

Short description of error
Specular values less than 0 causes shader in EEVEE viewport to be black.. The same is not observed in cycles. Also tried blender 2.92 and it doesn't have this issue.

Exact steps for others to reproduce the error
Set Specular to a values less than 0 on the Principled shader in EEVEE 2.93
Note: SSR must be off in the Render Properties.


2.93

2.92

One reason this is an issue is due to the RGB Curve node interpolating values below 0 when using the default auto handle, as shown in the original report images below.
see node setup below

If I disconnect the specular the texture looks fine

Blender 2.92 doesn't have the same problem

Related Objects

Event Timeline

Philipp Oeser (lichtwerk) changed the task status from Needs Triage to Needs Information from User.Thu, Apr 1, 11:58 AM

Please always attach a simple example .blend file (including packed textures) that demonstrates this issue.
(this ensures we are all on the same page and just speeds up the process if multiple devs are looking into this)

Here is a simple blend file which shows the issue.


You can open the file in 2.93 and see the issue.
If you open it in 2.92 it looks fine.
In 2.93, if you disconnect the specular input of the principled shader, then the problem disappears (as far as I can see).

I duplicated the texture and made the one that goes to the specular "non-color", that seemed to resolve the problem on 2.93.
This is a behavior difference between 2.92 and 2.93. Is that intended?

Evan Wilson (EAW) changed the task status from Needs Information from User to Needs Triage.Thu, Apr 1, 8:44 PM
Evan Wilson (EAW) changed the task status from Needs Triage to Confirmed.Thu, Apr 1, 9:50 PM

So the issue here is that RGB Curve node causes some of the values of the sRGB texture to go negative.

In 2.92, negative Specular values don't break the Principled BDSF


In 2.93, negative specular values do. Values <0 will make the output black. Values ⪅ -0.9 cause the shader to flicker between white and black using the slider, with white artifacts around the edge at -1.

I will confirm for now. However, I can't say that this is a bug, as I don't believe negative specular values are expected. If not, perhaps they should be clamped to zero?
@Clément Foucault (fclem) recently did work a lot of work in the closure and reflections part of EEVEE's code. Before bisecting it to a specific commit, I will leave it up to him to decide if he considers this a bug.

Evan Wilson (EAW) renamed this task from EEVEE principled bsdf shader specular is not working as expected to EEVEE principled bsdf shader no longer handles negative specular values gracefully.Thu, Apr 1, 10:10 PM
Evan Wilson (EAW) updated the task description. (Show Details)

Could this be related to: https://developer.blender.org/T86578
From @Evan Wilson (EAW) description:
" Values <0 will make the output black. Values ⪅ -0.9 cause the shader to flicker between white and black using the slider, "
Could this result in the fireflies we see during the render?

@Amir Shehata (amir.shehata) I don’t think so. The general area is similar but the issues appear to me to be different. T86578 has artifacts in both 2.92 and 2.93, while this report’s issue doesn’t appear in 2.92.