Principled BSDF: Change minimum IOR to 1.0 #111158

Merged
Brecht Van Lommel merged 1 commits from Alaska/blender:change-min-ior into main 2023-08-16 10:18:05 +02:00
Member

Set a soft limit of 1.0 for the minimum IOR on the Principled BSDF.

Set a soft limit of 1.0 for the minimum IOR on the Principled BSDF.
Alaska added 1 commit 2023-08-16 04:11:31 +02:00
9f2425ffdc Principled BSDF: Change min IOR to 1.0
Set a soft limit of 1.0 for the minimum IOR on the principled BSDF.
Alaska added the
Module
Render & Cycles
label 2023-08-16 04:12:06 +02:00
Alaska requested review from Brecht Van Lommel 2023-08-16 04:12:16 +02:00
Alaska requested review from Weizhen Huang 2023-08-16 04:12:26 +02:00
Alaska requested review from Lukas Stockner 2023-08-16 04:12:32 +02:00
Author
Member

After recent changse, the IOR now partially controls the specularity of opaque surfaces in Cycles. And to make it easier for people to play around with this effect, I changed the soft limit for min IOR to 1.0 (since most materials are in the 1.0+ range). This is so if you drag the IOR slider down, it will stop at 1.0.

You can still set the IOR below 1.0 by manually typing the value in, and I personally think this fits better with the workflow for when IORs below 1.0 are typically used. IORs below 1.0 are used for nested dielectrics, and to get the right result you need to do some math to figure out the correct IOR value for the two interacting materials.

After recent changse, the IOR now partially controls the specularity of opaque surfaces in Cycles. And to make it easier for people to play around with this effect, I changed the soft limit for min IOR to 1.0 (since most materials are in the 1.0+ range). This is so if you drag the IOR slider down, it will stop at 1.0. You can still set the IOR below 1.0 by manually typing the value in, and I personally think this fits better with the workflow for when IORs below 1.0 are typically used. IORs below 1.0 are used for nested dielectrics, and to get the right result you need to do some math to figure out the correct IOR value for the two interacting materials.
Alaska requested review from Sergey Sharybin 2023-08-16 04:18:50 +02:00
Alaska changed title from Principled BSDF: Change min IOR to 1.0 to Principled BSDF: Change minimum IOR to 1.0 2023-08-16 04:19:17 +02:00
Brecht Van Lommel approved these changes 2023-08-16 10:14:54 +02:00
Brecht Van Lommel merged commit 007b7d0353 into main 2023-08-16 10:18:05 +02:00
Brecht Van Lommel deleted branch change-min-ior 2023-08-16 10:18:06 +02:00
First-time contributor

IORs below 1.0 are used for nested dielectrics, and to get the right result you need to do some math to figure out the correct IOR value for the two interacting materials.

Can you share a simple demo blend file of this use case?

For example, water inside a glass cup, till now, I just let the water mesh slightly intersect with the glass mesh, and assign the glass with 1.5 ior, the water with 1.33 ior.

What should we do after this PR?

> IORs below 1.0 are used for nested dielectrics, and to get the right result you need to do some math to figure out the correct IOR value for the two interacting materials. Can you share a simple demo blend file of this use case? For example, water inside a glass cup, till now, I just let the water mesh slightly intersect with the glass mesh, and assign the glass with 1.5 ior, the water with 1.33 ior. What should we do after this PR?
Author
Member

@baoyu for as long as I've been using Blender (roughly 6 years), to render a nested dielectric accurately you typically needed to set one of the IORs to below 1.0. This pull request doesn't change that.

But just for reference, I've attached a .blend file to show you how you might accurately create a glass cup with water in it. (Note: When working with nested dielectric, you have to be careful to make sure your normals are facing the right direction, and the IOR values are correct).

Make sure you look at the different materials, where they're assigned, how the geometry is laid out, and the geometry normals in the file I've attached.

Note: Nested Dielectrics (presumably automatically, or semi-automatically figuring out what IOR values to use when materials intersect) has been listed as one of the "further goals" of #99447. So this feature may come to Cycles in the near future.

@baoyu for as long as I've been using Blender (roughly 6 years), to render a nested dielectric accurately you typically needed to set one of the IORs to below 1.0. This pull request doesn't change that. But just for reference, I've attached a .blend file to show you how you might accurately create a glass cup with water in it. (Note: When working with nested dielectric, you have to be careful to make sure your normals are facing the right direction, and the IOR values are correct). Make sure you look at the different materials, where they're assigned, how the geometry is laid out, and the geometry normals in the file I've attached. Note: Nested Dielectrics (presumably automatically, or semi-automatically figuring out what IOR values to use when materials intersect) has been listed as one of the "further goals" of #99447. So this feature may come to Cycles in the near future.
First-time contributor

Thank you @Alaska for the demo!
I did a comparison between your method and mine.
image
The difference is there, while I do see your method is a bit tidous to model and shade.
I learned my method said above several years ago from arnold render's manual(in which I now find your method talked also).

Aside from that in arnold one can and should set the priority of the material. However when I get to use blender cycles, the 'overlapping' trick seems work quite well without the feature of having nested dielectrics priority.

I don't know why I don't have right to upload files here. This is the blend file of side by side comparison.

Thank you @Alaska for the demo! I did a comparison between your method and mine. ![image](/attachments/6e4e87e9-31cb-4ff6-a053-bdb176afcf27) The difference is there, while I do see your method is a bit tidous to model and shade. I learned my method said above several years ago from [arnold render's manual(in which I now find your method talked also)](https://help.autodesk.com/view/ARNOL/ENU/?guid=arnold_user_guide_ac_transmission_ac_nested_dielectrics_html). Aside from that in arnold one can and should set the priority of the material. However when I get to use blender cycles, the 'overlapping' trick seems work quite well without the feature of having nested dielectrics priority. I don't know why I don't have right to upload files here. [This is the blend file of side by side comparison.](https://drive.google.com/file/d/1tKZbDi82pBwzoIAZTZsOC-fj0_i_jxFN/view?usp=sharing)
2.0 MiB
Author
Member

@baoyu manually dividing up the scene into different parts and setting the correct IOR for each medium change is annoying and it is difficult to get right in some scenes. But it is more physically correct than overlapping the two meshes.

However due to the annoyingness of setting it up, and the difficulty of explaining it to people, most people will just use the method you use (overlapping water and cup), and if it looks alright to you and the many other people that use that technique, then it's fine. Most people are using Cycles to make art, not to make perfect physical simulations.

Anyway, that probably ends our discussion. If you want physical accuracy, use the annoying method I showed. If you want ease of use, use the method you use. And in the future, hopefully proper nested dielectric support is added to Cycles and you can get the ease of use of your method with the physical accuracy of my method.


Also, it seems I got some of my IOR notes and math backwards in the original file I sent you. I have updated the original file with the fixed notes and IOR values.

This just proves it's kind of annoying to setup because if you rarely do it, then you can forget the correct order to do the division.

@baoyu manually dividing up the scene into different parts and setting the correct IOR for each medium change is annoying and it is difficult to get right in some scenes. But it is more physically correct than overlapping the two meshes. However due to the annoyingness of setting it up, and the difficulty of explaining it to people, most people will just use the method you use (overlapping water and cup), and if it looks alright to you and the many other people that use that technique, then it's fine. Most people are using Cycles to make art, not to make perfect physical simulations. Anyway, that probably ends our discussion. If you want physical accuracy, use the annoying method I showed. If you want ease of use, use the method you use. And in the future, hopefully proper nested dielectric support is added to Cycles and you can get the ease of use of your method with the physical accuracy of my method. --- Also, it seems I got some of my IOR notes and math backwards in the original file I sent you. I have updated the original file with the fixed notes and IOR values. This just proves it's kind of annoying to setup because if you rarely do it, then you can forget the correct order to do the division.
Author
Member

@LukasStockner I've re-read over various notes in #99447.

It seems you want to support a specific case for IOR = 0 with the specular layer. This pull request/commit interferes with the ability for users to "naturally" set the IOR to 0. So feel free to revert the change if you want.

@LukasStockner I've re-read over various notes in #99447. It seems you want to support a specific case for IOR = 0 with the specular layer. This pull request/commit interferes with the ability for users to "naturally" set the IOR to 0. So feel free to revert the change if you want.
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
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#111158
No description provided.