Shader: Add Roughness to Subsurface Scattering Node #114499

Merged
Brecht Van Lommel merged 10 commits from Alaska/blender:update-sss into main 2024-04-29 10:54:41 +02:00
Member

Add entry roughness to Subsurface Scattering node so that users can
recreate Subsurface Scattering materials from the Principled BSDF.

Add entry roughness to Subsurface Scattering node so that users can recreate Subsurface Scattering materials from the Principled BSDF.
Alaska added the
Module
Render & Cycles
label 2023-11-05 12:21:12 +01:00
Alaska added 1 commit 2023-11-05 12:21:21 +01:00
Add Roughness to Subsurface Scattering Node
Some checks failed
buildbot/vexp-code-patch-coordinator Build done.
82031667ae
Alaska requested review from Brecht Van Lommel 2023-11-05 12:21:29 +01:00
Alaska requested review from Lukas Stockner 2023-11-05 12:21:37 +01:00
Author
Member

What are your thoughts on the name of this input? Should it be called "Roughness", or "Entry Roughness" or something else?

What are your thoughts on the name of this input? Should it be called "Roughness", or "Entry Roughness" or something else?

@blender-bot build

@blender-bot build
Brecht Van Lommel requested changes 2023-11-06 10:10:49 +01:00
Brecht Van Lommel left a comment
Owner

Test failure likely caused by this change.

Test failure likely caused by this change.
Author
Member

Edit: This has been fixed

I took a quick look, the only test that fails is subsurface mix. The issue is very likely caused by the changes in intern/cycles/scene/shader_nodes.cpp.

It seems I'm doing something wrong with the closure and/or mix weight of materials. I just can't figure out what I'm doing wrong. I'll investigate it further, but if you have any insights that might help, feel free to share.

Edit: This has been fixed ~~I took a quick look, the only test that fails is subsurface mix. The issue is very likely caused by the changes in `intern/cycles/scene/shader_nodes.cpp`.~~ ~~It seems I'm doing something wrong with the closure and/or mix weight of materials. I just can't figure out what I'm doing wrong. I'll investigate it further, but if you have any insights that might help, feel free to share.~~
Alaska added 1 commit 2023-11-06 11:32:10 +01:00
Author
Member

Turns out adding a node for the normal input fixes the issue.

Along with that it fixes an issue where the normal input wasn't being read.

Turns out adding a node for the normal input fixes the issue. Along with that it fixes an issue where the normal input wasn't being read.
Alaska added 1 commit 2023-11-07 05:57:10 +01:00
Merge branch 'main'
Some checks failed
buildbot/vexp-code-patch-coordinator Build done.
091443d580
Conflicts:
	source/blender/blenloader/intern/versioning_400.cc
Alaska requested review from Brecht Van Lommel 2023-11-07 06:00:11 +01:00

@blender-bot build

@blender-bot build
Alaska added 1 commit 2023-11-16 05:54:29 +01:00
Conflicts:
	source/blender/blenkernel/BKE_blender_version.h
Lukas Stockner approved these changes 2023-11-18 19:30:28 +01:00
Alaska added 1 commit 2024-01-10 05:38:54 +01:00
Conflicts:
	source/blender/blenkernel/BKE_blender_version.h
Alaska added 1 commit 2024-02-23 12:24:15 +01:00
Lukas Stockner reviewed 2024-03-03 23:48:53 +01:00
Lukas Stockner left a comment
Member

Not sure what the status here is, I think this is ready to merge?

I've looked over it once more and found one detail, otherwise still LGTM.

Not sure what the status here is, I think this is ready to merge? I've looked over it once more and found one detail, otherwise still LGTM.
@ -2911,0 +2925,4 @@
ShaderInput *anisotropy_in = input("Anisotropy");
int normal_offset = compiler.stack_assign_if_linked(input("Normal"));
compiler.add_node(NODE_CLOSURE_BSDF,
Member

While this works, I just noticed there's a cleaner way to handle this.

Currently, BsdfNode::compile always reserves an entry for a Tangent input - however, only three nodes (Glossy, Principled, Hair) actually use it. So, we might as well make it a param5 input, pass input("Tangent") from these nodes, and pass input("Roughness") from here.

This also saves us two NODE_VALUE_F if Scale and IOR are fixed.

While this works, I just noticed there's a cleaner way to handle this. Currently, `BsdfNode::compile` always reserves an entry for a Tangent input - however, only three nodes (Glossy, Principled, Hair) actually use it. So, we might as well make it a `param5` input, pass `input("Tangent")` from these nodes, and pass `input("Roughness")` from here. This also saves us two `NODE_VALUE_F` if Scale and IOR are fixed.
Alaska added 1 commit 2024-03-04 02:53:07 +01:00
Author
Member

I experimented with the proposed idea of turning input("Tangent") into param5. But ran into some quirks so I haven't included any of the code changes here. Either way, it's a good idea, but I think it's best if that's handled as a seperate pull request that either gets merged into main before this one, or after this one.

I'll experiment some more and see if I can create a seperate pull request.
I've created a work in progress pull request here: #119042

I experimented with the proposed idea of turning `input("Tangent")` into `param5`. But ran into some quirks so I haven't included any of the code changes here. Either way, it's a good idea, but I think it's best if that's handled as a seperate pull request that either gets merged into main before this one, or after this one. ~~I'll experiment some more and see if I can create a seperate pull request.~~ I've created a work in progress pull request here: #119042
Alaska added 1 commit 2024-04-27 02:07:18 +02:00
Alaska added 1 commit 2024-04-27 02:09:09 +02:00
Shift EEVEE roughness clamp
All checks were successful
buildbot/vexp-code-patch-lint Build done.
buildbot/vexp-code-patch-linux-x86_64 Build done.
buildbot/vexp-code-patch-darwin-x86_64 Build done.
buildbot/vexp-code-patch-darwin-arm64 Build done.
buildbot/vexp-code-patch-windows-amd64 Build done.
buildbot/vexp-code-patch-coordinator Build done.
28cbc36fb6

@blender-bot build

@blender-bot build
Brecht Van Lommel added 1 commit 2024-04-29 10:37:16 +02:00
Brecht Van Lommel approved these changes 2024-04-29 10:43:05 +02:00
Brecht Van Lommel merged commit f8c0050a25 into main 2024-04-29 10:54:41 +02:00
Brecht Van Lommel deleted branch update-sss 2024-04-29 10:54:44 +02:00
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Code Documentation
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
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
Viewport & EEVEE
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Asset Browser Project
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
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
Module
Viewport & EEVEE
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Severity
High
Severity
Low
Severity
Normal
Severity
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
3 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#114499
No description provided.