Principled v2 combined changes for 4.0 #112848

Closed
Brecht Van Lommel wants to merge 16 commits from brecht:principled into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.

Combination of various open pull requests, to test and evaluate the whole. This is what I plan to commit tomorrow.

See commit list for details.

Combination of various open pull requests, to test and evaluate the whole. This is what I plan to commit tomorrow. See commit list for details.
Brecht Van Lommel added 1 commit 2023-09-25 14:11:17 +02:00
Author
Owner

CC @Alaska @LukasStockner @weizhen

The one further change I'm considering is some socket names:

  • Transmission -> Transmission Weight
  • Subsurface -> Subsurface Weight
  • Coat -> Coat Weight
  • Sheen -> Sheen Weight

Though personally the current duplicated panel/socket names don't bother me, and I don't much like "Weight" as a socket name.

The Cycles tests are ok and barely affected, but I'm still investigating some suspicious Eevee test failures.

CC @Alaska @LukasStockner @weizhen The one further change I'm considering is some socket names: * Transmission -> Transmission Weight * Subsurface -> Subsurface Weight * Coat -> Coat Weight * Sheen -> Sheen Weight Though personally the current duplicated panel/socket names don't bother me, and I don't much like "Weight" as a socket name. The Cycles tests are ok and barely affected, but I'm still investigating some suspicious Eevee test failures.
Brecht Van Lommel force-pushed principled from a8dad33ce3 to 36a58b3c3d 2023-09-25 14:36:01 +02:00 Compare
Brecht Van Lommel force-pushed principled from 36a58b3c3d to c2f526e3a6 2023-09-25 14:53:43 +02:00 Compare
Brecht Van Lommel added 1 commit 2023-09-25 16:03:34 +02:00
Author
Owner

After discussion decided to rename these sockets to weight anyway.

After discussion decided to rename these sockets to weight anyway.
Weizhen Huang reviewed 2023-09-25 16:11:21 +02:00
Weizhen Huang left a comment
Member

The EEVEE tests weren’t updated before the patch, they have some problems on Mac and look very foggy.

The EEVEE tests weren’t updated before the patch, they have some problems on Mac and look very foggy.
@ -692,6 +692,13 @@ static void version_principled_bsdf_emission(bNodeTree *ntree)
}
}
/* Rename Principled BSDF emission to emission color. */
Member

… and specular to specular ior level

… and specular to specular ior level
brecht marked this conversation as resolved
@ -337,0 +341,4 @@
}
/* Simplified form of F_eta(eta, 1.0). */
float F0_from_ior(float eta)
Member

See my comment #112552 (comment)

See my comment https://projects.blender.org/blender/blender/pulls/112552#issuecomment-1025440
brecht marked this conversation as resolved
@ -112,0 +111,4 @@
.subtype(PROP_FACTOR)
.description(
"Adjustment to the IOR to increase or decrease specular intensity "
"(0.5 means no adjustment, 0 removes all reflections, 1 doubles them)");
Member

Should clarify that 1 doubles the reflectivity at normal incidence, as suggested in the pull request

Should clarify that 1 doubles the reflectivity at normal incidence, as suggested in the pull request
brecht marked this conversation as resolved
@ -118,0 +116,4 @@
spec.add_input<decl::Color>("Specular Tint")
.default_value({1.0f, 1.0f, 1.0f, 1.0f})
.description(
"Tint of the specular reflection at normal incidence. Affects dielectric materials");
Member

Should be something like “Tint of dielectric reflection at normal incidence or metallic reflection at near-grazing incidence”.

Should be something like “Tint of dielectric reflection at normal incidence or metallic reflection at near-grazing incidence”.
brecht marked this conversation as resolved
Brecht Van Lommel added 2 commits 2023-09-25 16:33:17 +02:00
Author
Owner

Thanks for the review, it should be addressed now.

Thanks for the review, it should be addressed now.
Lukas Stockner reviewed 2023-09-25 16:38:36 +02:00
Lukas Stockner left a comment
Member

Mostly LGTM, just a few notes on clamping.

Mostly LGTM, just a few notes on clamping.
@ -105,3 +105,1 @@
float specular_tint = stack_load_float(stack, specular_tint_offset);
float anisotropic = stack_load_float(stack, anisotropic_offset);
float sheen = stack_load_float(stack, sheen_offset);
float subsurface_weight = param2;
Member

Should be clamped to 0..1

Should be clamped to 0..1
brecht marked this conversation as resolved
@ -108,0 +106,4 @@
float specular_ior_level = fmaxf(stack_load_float(stack, specular_ior_level_offset), 0.0f);
float roughness = saturatef(stack_load_float(stack, roughness_offset));
Spectrum specular_tint = rgb_to_spectrum(
saturate(stack_load_float3(stack, specular_tint_offset)));
Member

Same as in EEVEE, I don't think we want to hard-clamp >1.0 anymore.

Same as in EEVEE, I don't think we want to hard-clamp >1.0 anymore.
brecht marked this conversation as resolved
@ -55,9 +61,21 @@ void node_bsdf_principled(vec4 base_color,
{
Member

This should also be clamped between 0.0 and 1.0, a mix factor >1 makes no sense.

This should also be clamped between 0.0 and 1.0, a mix factor >1 makes no sense.
Member

Sorry, the line number got messed up here. I meant subsurface_weight.

Sorry, the line number got messed up here. I meant `subsurface_weight`.
brecht marked this conversation as resolved
@ -55,9 +61,21 @@ void node_bsdf_principled(vec4 base_color,
{
/* Match cycles. */
metallic = clamp(metallic, 0.0, 1.0);
Member

I think this is still left over from before the "Tint is now a color" change? I don't think we want a hard limit on 1.0 now.

I think this is still left over from before the "Tint is now a color" change? I don't think we want a hard limit on 1.0 now.
Member

Sorry, the line number got messed up here. I meant the specular_tint.

Sorry, the line number got messed up here. I meant the `specular_tint`.
Member

The F0 is clamped instead, following glTF (706ba4aa38)
Not sure about the metallic tint.

The F0 is clamped instead, following glTF (706ba4aa38) Not sure about the metallic tint.
brecht marked this conversation as resolved
Brecht Van Lommel added 1 commit 2023-09-25 16:41:20 +02:00
Member

Should be EEVEE in the commit messages (a59ec4c936)

Should be EEVEE in the commit messages (a59ec4c936)
Author
Owner

Should be EEVEE in the commit messages (a59ec4c936)

Thanks, will do when I push the changes.

> Should be EEVEE in the commit messages (a59ec4c936) Thanks, will do when I push the changes.
Brecht Van Lommel added 1 commit 2023-09-25 16:57:09 +02:00
Author
Owner

@blender-bot package

@blender-bot package
Member

Package build started. Download here when ready.

Package build started. [Download here](https://builder.blender.org/download/patch/PR112848) when ready.
Author
Owner

Merged now.

Merged now.
Author
Owner

@JulienDuroure hopefully all Principled BSDF changes have been merged now. Sorry for this happening so late.

I updated the add-ons in blender/blender-addons@66be038, but I expect you will overwrite them with your own changes. Still it might be useful for reference.

More information about the changes is here:
https://wiki.blender.org/wiki/Reference/Release_Notes/4.0/Rendering#Principled_BSDF
https://wiki.blender.org/wiki/Reference/Release_Notes/4.0/Python_API#Shader_Nodes

@JulienDuroure hopefully all Principled BSDF changes have been merged now. Sorry for this happening so late. I updated the add-ons in blender/blender-addons@66be038, but I expect you will overwrite them with your own changes. Still it might be useful for reference. More information about the changes is here: https://wiki.blender.org/wiki/Reference/Release_Notes/4.0/Rendering#Principled_BSDF https://wiki.blender.org/wiki/Reference/Release_Notes/4.0/Python_API#Shader_Nodes
Member

@brecht Thanks!
I will have a look, and then update the glTF I/O to be more aligned with the specification. Hopefully all these changes make it easier.
Thanks again!

@brecht Thanks! I will have a look, and then update the glTF I/O to be more aligned with the specification. Hopefully all these changes make it easier. Thanks again!
Some checks failed
buildbot/vexp-code-patch-coordinator Build done.

Pull request closed

Sign in to join this conversation.
No reviewers
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#112848
No description provided.