Shader: Add specular tint to Glass BSDF #114354
No reviewers
Labels
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
4 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#114354
Loading…
Reference in New Issue
No description provided.
Delete Branch "Alaska/blender:update-glass-bsdf"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Add specular tint to Glass BSDF so it matches the transmissive
component of the Principled BSDF.
Specular tint behaves differently from before.
The F90 reflection is no longer tinted.
Shader: Add specular tint to Glass BSDFto WIP: Shader: Add specular tint to Glass BSDFWIP: Shader: Add specular tint to Glass BSDFto Shader: Add specular tint to Glass BSDFA few notes about this:
sqrt(base_color)
to match EEVEE while the Glass BSDF did not. How would you like this handled?sqrt()
on the Cycles Glass BSDF as well?sqr()
on the EEVEE Glass BSDF? Leave it as is? Something else?Here's some comparisons:
Main vs Pull request comparison:
In the example above, versioning ensures that when older files are opened in Blender, the "Specular tint" is set to the "Color" of the Glass BSDF to try and ensure consistency between versions. Even with the versioning you will notice notice that the reflections are different between main and this pull request. Specifically F90 is tinted in main, but not in this pull request. So there is a rendering difference that comes from this change.
Cycles Principled BSDF vs Glass BSDF - Purple Glass, Orange Tint:
As you can see from the example above, the Glass BSDF needs to use
sqrt(color)
to match the Principled BSDF when using Cycles.EEVEE Principled BSDF vs Glass BSDF - Purple Glass, Orange Tint:
As you can see from the example above, the Glass BSDF doesn't need
sqrt(color)
to match the Principled BSDF in EEVEE.132e5ad26d
tob063073879
@blender-bot build
The build bot failed. Specifically with one render test involving glass. T45609
Prior to the change, the entire reflection would be tinted by the "Color" input. After the change, and after applying the versioning code, only the F0 of the reflection will be tinted by the old Color input, while F90 is white.
In the case where "Color" was (1.0, 1.0, 1.0), the reflection will appear the same as older versions of Blender. If the Color is not that, then the reflection will be different as you deviate from the F0 reflection.
In the T45609 test, the color is (0.8, 0.8, 0.8) and is expected to have differences.
If the test library included more tests with non (1.0, 1.0, 1.0) glass, then more tests would fail. Maybe extra tests should be added?
Hm, this is a tricky one.
On the one hand, while the existing Glass node isn't really physically-based anyways (transmission tint should be volumetric absorption), this seems like an improvement in realism to me.
On the other hand, the Glass BSDF (like Glossy) is also sort of intended as a building block for more complex shader designs, and for that the simpler behavior (where the entire BSDF reacts linearly to the Color input) might be preferred. For users who want a material that behaves intuitively and realistically out of the box, we have Principled.
This also affects things like whether we should apply
sqrt()
- from a "intuitive use" perspective it makes sense, but from a "building block" perspective it is nicer without it.On the code level, this seems fine to me. Copying the animation data is tricky, there only are helpers for moving it, but tbh i think it would be fine to just not bother here.
But on the functionality level, I'd leave this up to @brecht.
@LukasStockner One of the reasons for creating this pull request (and others like the conductor BSDF, and adding the roughness input to the Subsurface Scattering Node) is to allow users to recreate the Principled BSDF from smaller nodes without having to use OSL. This allows users to experiment with replacing, removing, adding, or re-ordering layers in the Principled BSDF (Obvious a layering option is still required).
So I would personally like to see the specular tint added to a smaller node, even if that's in the form of a separate "Generalized Schlick" node, or option on the Glass BSDF, or something similar.
The
sqrt
issue isn't exclusive to this pull request. The glass already has this issue in main resulting in Cycles and EEVEE rendering differently. So that's still something to consider even if we decide not to implement the specular tint changes in the Glass BSDF.It is difficult to judge with different background pattern. The issue is that EEVEE doesn't do 2 refraction events or just does an approximation. For now, consider the color applied as two refraction event (so current behavior) and later we will make it work depending on the refraction event count.
Checkout
From your project repository, check out a new branch and test the changes.