EEVEE principled bsdf shader no longer handles negative specular values gracefully #87107

Closed
opened 2021-04-01 05:43:52 +02:00 by Amir Shehata · 14 comments

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: e7f890aa59
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.
T87107specular.blend
2.93
2.93_specNegOne.jpg
2.92

2.92_specNegOne.jpg

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
image.png

If I disconnect the specular the texture looks fine
image.png

Blender 2.92 doesn't have the same problem
image.png

**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: `e7f890aa59` 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. [T87107specular.blend](https://archive.blender.org/developer/F9917174/T87107specular.blend) 2.93 ![2.93_specNegOne.jpg](https://archive.blender.org/developer/F9917178/2.93_specNegOne.jpg) 2.92 ![2.92_specNegOne.jpg](https://archive.blender.org/developer/F9917180/2.92_specNegOne.jpg) 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 ![image.png](https://archive.blender.org/developer/F9916537/image.png) If I disconnect the specular the texture looks fine ![image.png](https://archive.blender.org/developer/F9916539/image.png) Blender 2.92 doesn't have the same problem ![image.png](https://archive.blender.org/developer/F9916542/image.png)
Author

Added subscriber: @AmirShehata

Added subscriber: @AmirShehata
Member

Added subscriber: @lichtwerk

Added subscriber: @lichtwerk
Member

Changed status from 'Needs Triage' to: 'Needs User Info'

Changed status from 'Needs Triage' to: 'Needs User Info'
Member

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)

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)
Author

Here is a simple blend file which shows the issue.
specular.blend
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).

Here is a simple blend file which shows the issue. [specular.blend](https://archive.blender.org/developer/F9917043/specular.blend) 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).
Author

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?

image.png

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? ![image.png](https://archive.blender.org/developer/F9917065/image.png)
Member

Changed status from 'Needs User Info' to: 'Needs Triage'

Changed status from 'Needs User Info' to: 'Needs Triage'
Member

Added subscribers: @fclem, @EAW

Added subscribers: @fclem, @EAW
Member

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'
Member

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
2.92_specNegOne.jpg
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.
2.93_specNegOne.jpg

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?
@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.

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 ![2.92_specNegOne.jpg](https://archive.blender.org/developer/F9917151/2.92_specNegOne.jpg) 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. ![2.93_specNegOne.jpg](https://archive.blender.org/developer/F9917154/2.93_specNegOne.jpg) 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? @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 changed title from EEVEE principled bsdf shader specular is not working as expected to EEVEE principled bsdf shader no longer handles negative specular values gracefully 2021-04-01 22:10:53 +02:00
Author

Could this be related to: https://developer.blender.org/T86578
From @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?

Could this be related to: https://developer.blender.org/T86578 From @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?
Member

@AmirShehata I don’t think so. The general area is similar but the issues appear to me to be different. #86578 has artifacts in both 2.92 and 2.93, while this report’s issue doesn’t appear in 2.92.

@AmirShehata I don’t think so. The general area is similar but the issues appear to me to be different. #86578 has artifacts in both 2.92 and 2.93, while this report’s issue doesn’t appear in 2.92.

This issue was referenced by 08ae545de4

This issue was referenced by 08ae545de433272827d6b244020efe677cf3670e

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
Clément Foucault self-assigned this 2021-04-08 17:45:37 +02:00
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
5 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#87107
No description provided.