Cycles: support Mie Scattering with particle size smaller than 5um #130234

Merged
Weizhen Huang merged 3 commits from weizhen/blender:mie-0-5 into main 2024-12-13 15:51:14 +01:00
Member

Previous implemenation of 5 < d < 50 was taken from the main paper,
fitting for smaller sizes are found in the supplemental. They are less
forward-scattering.

Previous implemenation of 5 < d < 50 was taken from the main paper, fitting for smaller sizes are found in the supplemental. They are less forward-scattering.
Weizhen Huang added the
Module
Render & Cycles
label 2024-11-13 18:01:35 +01:00
Weizhen Huang added 1 commit 2024-11-13 18:01:44 +01:00
Previous implemenation of 5 < d < 50 was taken from the main paper,
fitting for smaller sizes are found in the supplemental. They are less
forward-scattering.
Weizhen Huang changed title from Cycles: support Mie Scattering particle size 0 < d < 5 to Cycles: support Mie Scattering with particle size 0 < d < 5um 2024-11-13 18:02:04 +01:00
Weizhen Huang changed title from Cycles: support Mie Scattering with particle size 0 < d < 5um to Cycles: support Mie Scattering with particle size smaller than 5um 2024-11-13 18:02:27 +01:00
Author
Member

Plot for the phase function (in log scale):

mie_scatter_phase.svg

Plot for the fitted parameters:

Note tha \alpha has a different scale than the other parameters.

mie_scatter_parameters.svg
I am quite surprised by the discontinuities, especially at d = 0.1 and 1.5, and how they managed to fit a function so complicated, but the rendering seems fine.

## Plot for the phase function (in log scale): ![mie_scatter_phase.svg](/attachments/5e6b8bbc-5050-4ac1-a65a-bd0bf94d32bb) ## Plot for the fitted parameters: ### Note tha \(\alpha\) has a different scale than the other parameters. ![mie_scatter_parameters.svg](/attachments/cea69d15-5b53-4ff3-8111-e5d54668e527) I am quite surprised by the discontinuities, especially at d = 0.1 and 1.5, and how they managed to fit a function so complicated, but the rendering seems fine.
Weizhen Huang requested review from Sergey Sharybin 2024-11-13 18:13:41 +01:00
Weizhen Huang requested review from Lukas Stockner 2024-11-13 18:13:46 +01:00
Lukas Stockner requested changes 2024-11-13 18:28:28 +01:00
Lukas Stockner left a comment
Member

If I remember correctly, this also needs to be done in the OSL version.
Otherwise LGTM, I skipped these initially but I guess we might as well add them.

If I remember correctly, this also needs to be done in the OSL version. Otherwise LGTM, I skipped these initially but I guess we might as well add them.
Author
Member

@LukasStockner Ah, I keep forgetting we have this OSL thing

@LukasStockner Ah, I keep forgetting we have this OSL thing

It should be possible to use volume_util.h from node_scatter_volume.osl and avoid duplication?

It should be possible to use `volume_util.h` from `node_scatter_volume.osl` and avoid duplication?
Weizhen Huang force-pushed mie-0-5 from e3c6062132 to ad3816a13a 2024-12-10 12:10:31 +01:00 Compare
Weizhen Huang added 2 commits 2024-12-10 12:11:22 +01:00
Weizhen Huang requested review from Lukas Stockner 2024-12-10 12:12:52 +01:00

I remember we've discussed possibility of avoiding duplication by adding another header where we can have shareable code between OSL and SVM (as the current volume_util.h can not be included from OSL) . Were there some complications with that?

I remember we've discussed possibility of avoiding duplication by adding another header where we can have shareable code between OSL and SVM (as the current `volume_util.h` can not be included from OSL) . Were there some complications with that?
Sergey Sharybin approved these changes 2024-12-10 16:40:06 +01:00
Sergey Sharybin left a comment
Owner

Had some quick catch-up IRL with Weizhen.

The pointers and fast_cos are annoying for sharing. So its more practical to move forward with this PR and look into deduplication later.

Had some quick catch-up IRL with Weizhen. The pointers and fast_cos are annoying for sharing. So its more practical to move forward with this PR and look into deduplication later.
Weizhen Huang merged commit c99b7e66b2 into main 2024-12-13 15:51:14 +01:00
Weizhen Huang deleted branch mie-0-5 2024-12-13 15:51:19 +01:00
Member

@weizhen Before you go on holiday.

You said you'd like extra render tests for the new particle sizes after this was commited.

Were there specific particle sizes you wanted tested? Or should I create a test for each section shown in your graph here: #130234 (comment)

@weizhen Before you go on holiday. You said you'd like extra render tests for the new particle sizes after this was commited. Were there specific particle sizes you wanted tested? Or should I create a test for each section shown in your graph here: https://projects.blender.org/blender/blender/pulls/130234#issuecomment-1339084
Author
Member

@Alaska we could do one for each range, d <= 0.1f, d < 1.5f and d < 5.0f, otherwise I don't think the exact value matters.

I picked a few for the drawing because I was wondering how they look like. I could create a repo and push my python script there, if it's of interest.

EDIT: I put the script here https://projects.blender.org/weizhen/plot/src/branch/main/volume_phase_function.py

@Alaska we could do one for each range, `d <= 0.1f`, `d < 1.5f` and `d < 5.0f`, otherwise I don't think the exact value matters. I picked a few for the drawing because I was wondering how they look like. I could create a repo and push my python script there, if it's of interest. EDIT: I put the script here https://projects.blender.org/weizhen/plot/src/branch/main/volume_phase_function.py
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
FBX
Interest
Freestyle
Interest
Geometry Nodes
Interest
glTF
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 & 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
Asset System
Module
Core
Module
Development Management
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline & 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
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#130234
No description provided.