Cycles: Update Velvet BSDF to Sheen BSDF with new Microfiber sheen model #108869

Merged
Lukas Stockner merged 1 commits from LukasStockner/blender:sheen into main 2023-07-24 15:36:45 +02:00
Member

This patch extends the old Velvet BSDF node with a new shading model, and renames it to Sheen BSDF accordingly.

The old model is still available, but new nodes now default to the "Microfiber" model, which is an implementation of https://tizianzeltner.com/projects/Zeltner2022Practical/.

This patch extends the old Velvet BSDF node with a new shading model, and renames it to Sheen BSDF accordingly. The old model is still available, but new nodes now default to the "Microfiber" model, which is an implementation of https://tizianzeltner.com/projects/Zeltner2022Practical/.
Lukas Stockner added the
Module
Render & Cycles
label 2023-06-12 00:27:14 +02:00
Lukas Stockner added this to the Render & Cycles project 2023-06-12 00:27:28 +02:00
Lukas Stockner requested review from Brecht Van Lommel 2023-06-12 00:27:35 +02:00
Lukas Stockner requested review from Weizhen Huang 2023-06-12 00:27:36 +02:00
Author
Member
Scene Principled v1 Sheen Ashikhmin (old Velvet) Microfacet (not used) LTC (new Microfiber)
Cloth, Roughness 0.4 r0.4_v1.png r0.4_as.png r0.4_mf.png r0.4_lt.png
Sphere, Roughness 0.5 r0.5_v1.png r0.5_as.png r0.5_mf.png r0.5_lt.png

In particular, note how the LTC variant avoids the black hole that both Ashikhmin (the existing Velvet BSDF) and the Microfacet model have.

| Scene | Principled v1 Sheen | Ashikhmin (old Velvet) | Microfacet (not used) | **LTC (new Microfiber)** | | - | - | - | - | - | | Cloth, Roughness 0.4 | ![r0.4_v1.png](/attachments/1869a776-c89c-4dec-9f06-338e116f2ca6) | ![r0.4_as.png](/attachments/94bbc33a-60fc-4fcc-980f-58ebe8c81fc8) | ![r0.4_mf.png](/attachments/83a3e716-d58d-47de-9fec-38bd57bcc534) | ![r0.4_lt.png](/attachments/3b55c0d8-a1e7-452e-87e8-b9b4c16de3ac) | | Sphere, Roughness 0.5 | ![r0.5_v1.png](/attachments/b1d3aa15-fcc5-4a57-b4bd-faa3503d6973) | ![r0.5_as.png](/attachments/0ff53ca8-e183-412e-ba50-1eb972760df6) | ![r0.5_mf.png](/attachments/ed7d072e-f000-4dc6-87f3-37a79420e6dd) | ![r0.5_lt.png](/attachments/c53aefb5-f0ce-4375-919b-4be56fa0cf61) | In particular, note how the LTC variant avoids the black hole that both Ashikhmin (the existing Velvet BSDF) and the Microfacet model have.
Lukas Stockner force-pushed sheen from c07893fb5f to c734006428 2023-06-12 01:09:50 +02:00 Compare
First-time contributor

Hi @LukasStockner !

I actually also sat down last week and implemented a Blender/Cycles version of our LTC sheen with the goal of sending it to you as a suggestion for "Principled v2" :)
For what it's worth, this is now also used in production at Disney Animation Studios (starting with Strange Worlds last year) and some pretty positive feedback from the artists was forwarded to me from there.
Let me know if I can help with anything related to it!

Hi @LukasStockner ! I actually also sat down last week and implemented a Blender/Cycles version of our LTC sheen with the goal of sending it to you as a suggestion for "Principled v2" :) For what it's worth, this is now also used in production at Disney Animation Studios (starting with Strange Worlds last year) and some pretty positive feedback from the artists was forwarded to me from there. Let me know if I can help with anything related to it!
First-time contributor

Btw, I just compared your implementation against what I have (which is in turn validated against my reference implementation). They all match!

For completeness, here is my implementation, which is a bit more verbose. (I have next to no experience with the Cycles codebase, so take it with a grain of salt.)

Btw, I just compared your implementation against what I have (which is in turn validated against my reference implementation). They all match! For completeness, here is my implementation, which is a bit more verbose. (I have next to no experience with the Cycles codebase, so take it with a grain of salt.)

The code looks fine, and great to know LTC matches the reference implementation and there is real world usage.

LTC seems like a logical choice to me. The potential downside is compatibility with other renderers. But think it makes sense to be forward looking and hope everyone switches to this eventually as well.

The code looks fine, and great to know LTC matches the reference implementation and there is real world usage. LTC seems like a logical choice to me. The potential downside is compatibility with other renderers. But think it makes sense to be forward looking and hope everyone switches to this eventually as well.
Lukas Stockner force-pushed sheen from c734006428 to 094f9ad111 2023-06-17 03:33:38 +02:00 Compare
Author
Member

Hi @Tizian-Zeltner, thanks for checking this, glad to hear that the implementation looks good!

The patch is updated for OSL now, I'll run a build so people can try it out. But yeah, I'm also leaning towards the LTC sheen.

@blender-bot package

Hi @Tizian-Zeltner, thanks for checking this, glad to hear that the implementation looks good! The patch is updated for OSL now, I'll run a build so people can try it out. But yeah, I'm also leaning towards the LTC sheen. @blender-bot package
Member

Package build started. Download here when ready.

Package build started. [Download here](https://builder.blender.org/download/patch/PR108869) when ready.
Lukas Stockner force-pushed sheen from 094f9ad111 to df669b77ed 2023-07-11 02:14:58 +02:00 Compare
Author
Member

Okay, I've pushed a rework of the PR that replaces the WIP implementations of both models with just an implementation of the LTC-based model, plus the versioning code etc.

For naming the enum option, I went with "Microfiber" for now, since the overall idea behind the model is similar to microfacet models (modeling the far-field aggregate behavior of microscopic randomly distributed elements), except that the base elements are fibers, not facets. The goal was to strike a balance that's not too technical ("LTC" isn't very helpful for artists) while still being somewhat descriptive of what's going on (e.g. just "new model" or "sheen" isn't very useful either).

Okay, I've pushed a rework of the PR that replaces the WIP implementations of both models with just an implementation of the LTC-based model, plus the versioning code etc. For naming the enum option, I went with "Microfiber" for now, since the overall idea behind the model is similar to microfacet models (modeling the far-field aggregate behavior of microscopic randomly distributed elements), except that the base elements are fibers, not facets. The goal was to strike a balance that's not too technical ("LTC" isn't very helpful for artists) while still being somewhat descriptive of what's going on (e.g. just "new model" or "sheen" isn't very useful either).
Lukas Stockner changed title from WIP: Cycles: Add two new Sheen BSDFs to the Velvet node to Cycles: Add two new Sheen BSDFs to the Velvet node 2023-07-11 02:21:20 +02:00
Lukas Stockner changed title from Cycles: Add two new Sheen BSDFs to the Velvet node to Cycles: Update Velvet BSDF to Sheen BSDF with new Microfiber sheen model 2023-07-12 02:16:43 +02:00
Brecht Van Lommel requested changes 2023-07-12 14:36:45 +02:00
@ -356,2 +362,4 @@
break;
case CLOSURE_BSDF_PRINCIPLED_SHEEN_ID:
case CLOSURE_BSDF_SHEEN_ID:
/* TODO(lukas): Should we report the sheen parameter here? */

This is used for path guiding. Checking on what the roughness does, I think it makes sense to return it here, it seems similar enough to microfacet roughness.

This is used for path guiding. Checking on what the roughness does, I think it makes sense to return it here, it seems similar enough to microfacet roughness.
Author
Member

Yes, I was hesitant to set it since this is retro-reflection, not regular reflection, so if the guiding was e.g. using GGX to sample directions it'd give horrible results. I don't think it does, though.

Yes, I was hesitant to set it since this is retro-reflection, not regular reflection, so if the guiding was e.g. using GGX to sample directions it'd give horrible results. I don't think it does, though.
LukasStockner marked this conversation as resolved
@ -442,2 +450,4 @@
break;
case CLOSURE_BSDF_PRINCIPLED_SHEEN_ID:
case CLOSURE_BSDF_SHEEN_ID:
/* TODO(lukas): Glossy? */

I'm not immediately sure what the right choice here, depending on the material either diffuse or glossy could be more useful. I would leave it in diffuse and if anyone complains.

I'm not immediately sure what the right choice here, depending on the material either diffuse or glossy could be more useful. I would leave it in diffuse and if anyone complains.
Author
Member

Sounds good, it's diffuse now (before, it counted as glossy for the component passes but returned LABEL_DIFFUSE, which is not great of course).

Sounds good, it's diffuse now (before, it counted as glossy for the component passes but returned LABEL_DIFFUSE, which is not great of course).
LukasStockner marked this conversation as resolved
@ -247,0 +255,4 @@
bNodeSocket *sigmaInput = nodeFindSocket(node, SOCK_IN, "Sigma");
if (sigmaInput != NULL) {
strcpy(sigmaInput->identifier, "Roughness");
strcpy(sigmaInput->name, "Roughness");

Use safer STRNCPY instead.

Use safer STRNCPY instead.
LukasStockner marked this conversation as resolved
@ -0,0 +2,4 @@
*
* SPDX-License-Identifier: GPL-2.0-or-later */
#include "node_shader_util.hh"

Add this to fix build error when WITH_UNITY_BUILD=OFF.

#include "UI_interface.h"
#include "UI_resources.h"
Add this to fix build error when WITH_UNITY_BUILD=OFF. ``` #include "UI_interface.h" #include "UI_resources.h" ```
LukasStockner marked this conversation as resolved
Lukas Stockner force-pushed sheen from df669b77ed to e739348c67 2023-07-22 01:51:30 +02:00 Compare
Brecht Van Lommel approved these changes 2023-07-24 11:11:05 +02:00
Lukas Stockner force-pushed sheen from e739348c67 to f7f83620df 2023-07-24 15:35:17 +02:00 Compare
Lukas Stockner merged commit b220ec27d7 into main 2023-07-24 15:36:45 +02:00
Lukas Stockner deleted branch sheen 2023-07-24 15:36:46 +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
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
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
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 Assignees
4 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#108869
No description provided.