Fix: Cycles: wrong refractive index in path guiding #112157

Merged
Weizhen Huang merged 3 commits from weizhen/blender:fix-path-guiding-eta into main 2023-09-18 16:20:57 +02:00
Member

should be the relative IOR of the outgoing media to the incoming media,
depending on bsdf->ior and whether the interaction is refraction.
Reference paper: Robust Fitting of Parallax-Aware Mixtures for Path Guiding Eq (35)

should be the relative IOR of the outgoing media to the incoming media, depending on `bsdf->ior` and whether the interaction is refraction. Reference paper: [Robust Fitting of Parallax-Aware Mixtures for Path Guiding](https://uni-tuebingen.de/fakultaeten/mathematisch-naturwissenschaftliche-fakultaet/fachbereiche/informatik/lehrstuehle/computergrafik/lehrstuhl/veroeffentlichungen/robust-fitting-of-parallax-aware-mixtures-for-path-guiding/) Eq (35)
Weizhen Huang added 1 commit 2023-09-08 19:25:13 +02:00
Fix: Cycles: wrong refractive index in path guiding
Some checks reported errors
buildbot/vexp-code-patch-coordinator Build done.
41f6a01788
should be the relative IOR of the outgoing media to the incoming media,
depending solely on `bsdf->ior` and whether the interaction is
refraction.
Ref: https://uni-tuebingen.de/fakultaeten/mathematisch-naturwissenschaftliche-fakultaet/fachbereiche/informatik/lehrstuehle/computergrafik/lehrstuhl/veroeffentlichungen/robust-fitting-of-parallax-aware-mixtures-for-path-guiding/
Weizhen Huang added the
Module
Render & Cycles
label 2023-09-08 19:25:25 +02:00
Author
Member

@blender-bot build

@blender-bot build
Weizhen Huang added 2 commits 2023-09-18 14:18:45 +02:00
Use #ifdef instead of #if
Some checks failed
buildbot/vexp-code-patch-coordinator Build done.
4aedd0b095
Author
Member

@blender-bot build

@blender-bot build
Author
Member

Hard to say if there is any difference, but in general path guiding seems to have many fireflies.

Before After Before After
pg_before.png pg_after.png pg_before_.png pg_after_.png

I enabled the verification when WITH_CYCLES_DEBUG is defined. There is another discrepancy though, function bsdf_is_transmission() checks with sd->N, but when sampling we check against sd->Ng.

Hard to say if there is any difference, but in general path guiding seems to have many fireflies. | Before | After | Before | After | -------- | -------- | -------- |---| | ![pg_before.png](/attachments/f3933b68-776d-42da-b2a5-8f131d344482) | ![pg_after.png](/attachments/51f74270-32dc-4d17-a8af-ff3b33fc10f5) | ![pg_before_.png](/attachments/cdad9ad2-437a-4dc9-875a-6d6917fb653b) | ![pg_after_.png](/attachments/8edf7971-816c-4b6d-860a-b68144b13bbf) I enabled the verification when `WITH_CYCLES_DEBUG` is defined. There is another discrepancy though, function `bsdf_is_transmission()` checks with `sd->N`, but when sampling we check against `sd->Ng`.
Author
Member

The failed blendfile_library_overrides test doesn't seem to be related to this patch.

The failed `blendfile_library_overrides` test doesn't seem to be related to this patch.
Weizhen Huang requested review from Brecht Van Lommel 2023-09-18 15:15:33 +02:00
Weizhen Huang requested review from Sebastian Herholz 2023-09-18 15:15:40 +02:00
Brecht Van Lommel approved these changes 2023-09-18 15:48:34 +02:00
Weizhen Huang merged commit e894e6a411 into main 2023-09-18 16:20:57 +02:00
Weizhen Huang deleted branch fix-path-guiding-eta 2023-09-18 16:20:58 +02:00

@weizhen the change look correct.
About the bsdf_is_transmission function, I think the problem is that each closure can have its own shading normal, which makes it it impossible to robustly identify the correct situation if a ray is transmission or not if you do not add an explicit closure to it.

@weizhen the change look correct. About the ` bsdf_is_transmission` function, I think the problem is that each closure can have its own shading normal, which makes it it impossible to robustly identify the correct situation if a ray is transmission or not if you do not add an explicit closure to it.
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#112157
No description provided.