Cycles: improve equiangular sampling in volume #119438

Merged
Weizhen Huang merged 27 commits from weizhen/blender:equiangular-valid-range into main 2024-03-25 13:02:13 +01:00
Member

By restricting the sample range along the ray to the valid segment.

this patch without light tree this patch with light tree (#119389) main without light tree main with light tree
mine.png mine_tree.png main.png main_tree.png

using equiangular sampling, 128spp.

TODO

Add support for

Mesh Light

  • restrict the ray segment to the side with MIS

Area Light

  • when the spread is zero, find the intersection of the ray and the bounding box/cylinder of the rectangle/ellipse area light beam
  • when the spread is non-zero, find the intersection of the ray and the minimal enclosing cone of the area light beam
    note the result is also unbiased when we just consider the cone from the sampled point in volume segment. Far away from the light source it's less noisy than the current solution, but near the light source it's much noisier. We have to restrict the sample region on the area light to the part that lits the ray then, I haven't tried yet to see if it would be less noisy.

Point Light

  • the complete ray segment should be valid.

Spot Light

  • intersect the ray with the spot light cone
  • support non-zero radius

Light Tree

  • ensure same light for volume and volume segment, see #119389

test file attached.

By restricting the sample range along the ray to the valid segment. |this patch without light tree |this patch with light tree (#119389)| main without light tree |main with light tree| | -------- | -------- |----|--| | ![mine.png](attachments/31e2b044-bae5-438e-afd9-d92df7afe10c) |![mine_tree.png](attachments/ee4ce21f-075f-44b0-a08f-45ac29f5122a) | ![main.png](attachments/a71cad5d-b982-4c11-96bd-3ae63c2cf3c7) |![main_tree.png](attachments/292c8bad-6979-4d1a-9de9-dc29147fb463) *using equiangular sampling, 128spp.* ## TODO Add support for **Mesh Light** - [x] restrict the ray segment to the side with MIS **Area Light** - [x] when the spread is zero, find the intersection of the ray and the bounding box/cylinder of the rectangle/ellipse area light beam - [x] when the spread is non-zero, find the intersection of the ray and the minimal enclosing cone of the area light beam *note the result is also unbiased when we just consider the cone from the sampled point in volume segment. Far away from the light source it's less noisy than the current solution, but near the light source it's much noisier. We have to restrict the sample region on the area light to the part that lits the ray then, I haven't tried yet to see if it would be less noisy.* **Point Light** - [x] the complete ray segment should be valid. **Spot Light** - [x] intersect the ray with the spot light cone - [x] support non-zero radius **Light Tree** - [ ] ensure same light for volume and volume segment, see #119389 test file attached.
Weizhen Huang added the
Module
Render & Cycles
label 2024-03-13 19:41:40 +01:00
Weizhen Huang force-pushed equiangular-valid-range from c5aa8f87dc to c8da710ad3 2024-03-14 16:34:19 +01:00 Compare
Weizhen Huang force-pushed equiangular-valid-range from 510a978935 to e35b4783d6 2024-03-15 18:49:40 +01:00 Compare
Weizhen Huang force-pushed equiangular-valid-range from 7c8b5f4ccd to 828a52a21c 2024-03-16 17:05:58 +01:00 Compare
Weizhen Huang force-pushed equiangular-valid-range from 571d931d9b to afa805cca8 2024-03-18 23:40:28 +01:00 Compare
Weizhen Huang force-pushed equiangular-valid-range from b9a81dd372 to 810d1e5bb1 2024-03-19 22:18:03 +01:00 Compare
Weizhen Huang force-pushed equiangular-valid-range from 33ce093af2 to 10e0cd6674 2024-03-20 18:07:22 +01:00 Compare
Weizhen Huang added 1 commit 2024-03-21 18:33:22 +01:00
buildbot/vexp-code-patch-lint Build done. Details
buildbot/vexp-code-patch-linux-x86_64 Build done. Details
buildbot/vexp-code-patch-windows-amd64 Build done. Details
buildbot/vexp-code-patch-darwin-x86_64 Build done. Details
buildbot/vexp-code-patch-coordinator Build done. Details
f326ebd116
Disable ray segment computation for light tree
Author
Member

@blender-bot build +gpu

@blender-bot build +gpu
Weizhen Huang added 1 commit 2024-03-21 18:42:17 +01:00
buildbot/vexp-code-patch-lint Build done. Details
buildbot/vexp-code-patch-darwin-x86_64 Build done. Details
buildbot/vexp-code-patch-linux-x86_64 Build done. Details
buildbot/vexp-code-patch-windows-amd64 Build done. Details
buildbot/vexp-code-patch-coordinator Build done. Details
0b839dfc8f
Fix compilation error on Windows and Linux
Author
Member

@blender-bot build +gpu

@blender-bot build +gpu
Weizhen Huang added 1 commit 2024-03-21 19:46:29 +01:00
Weizhen Huang changed title from WIP: Cycles: improve equiangular sampling in volume to Cycles: improve equiangular sampling in volume 2024-03-21 19:48:34 +01:00
Weizhen Huang requested review from Brecht Van Lommel 2024-03-21 19:48:53 +01:00
Author
Member

@brecht this patch is ready for review. Currently the ray segment is only computed when light tree is turned off, will compute also for light tree when #119389 is ready.

This patch basically adds a bunch of ray intersection and math utility functions, and depending on the light type it calls different intersection functions.

@brecht this patch is ready for review. Currently the ray segment is only computed when light tree is turned off, will compute also for light tree when #119389 is ready. This patch basically adds a bunch of ray intersection and math utility functions, and depending on the light type it calls different intersection functions.
Brecht Van Lommel approved these changes 2024-03-25 10:54:02 +01:00
Brecht Van Lommel left a comment
Owner

Great work, all makes sense to me.

Great work, all makes sense to me.
Weizhen Huang added 2 commits 2024-03-25 13:00:59 +01:00
Weizhen Huang merged commit 082b68fcb9 into main 2024-03-25 13:02:13 +01:00
Weizhen Huang deleted branch equiangular-valid-range 2024-03-25 13:02:16 +01:00
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
2 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#119438
No description provided.