Fix wrong conversion from power to radiance of area lights #109153

Merged
Weizhen Huang merged 10 commits from weizhen/blender:fix_area_light_scaling into main 2023-07-07 17:03:09 +02:00
Member

The correct conversion factor should be 1 / (pi * area), see #108505

The correct conversion factor should be 1 / (pi * area), see #108505
Weizhen Huang added 2 commits 2023-06-20 11:48:28 +02:00
The scaling should be `M_1_PI / area` instead of `0.25f / area`.
Ref: #108505
Move versioning code from versioning_400 to versioning_cycles
Some checks failed
buildbot/vexp-code-patch-coordinator Build done.
15a4c7bea9
Author
Member

@blender-bot build

@blender-bot build
Weizhen Huang added the
Module
Render & Cycles
Interest
Viewport & EEVEE
labels 2023-06-20 11:59:36 +02:00
Weizhen Huang requested review from Brecht Van Lommel 2023-06-20 12:09:09 +02:00
Weizhen Huang requested review from Clément Foucault 2023-06-20 12:09:17 +02:00
Clément Foucault approved these changes 2023-06-20 14:10:34 +02:00
Weizhen Huang added 2 commits 2023-06-21 15:36:02 +02:00
Weizhen Huang added 1 commit 2023-06-26 11:59:35 +02:00

For these forward compatibility breaking changes, I would prefer to do it for all lights at once. Also preferably all the units should be documented, and the mapping to USD units fixed along with this, also as an extra verification that we got it right. We can add more convenient units as additional options later.

Basically filling in a table like this:

Normalized Unit Unnormalized Unit Conversion to USD
Sphere Light
Spot Light
Rectangular Area Light
Disk Area Light
Distant Light
For these forward compatibility breaking changes, I would prefer to do it for all lights at once. Also preferably all the units should be documented, and the mapping to USD units fixed along with this, also as an extra verification that we got it right. We can add more convenient units as additional options later. Basically filling in a table like this: | | Normalized Unit | Unnormalized Unit | Conversion to USD | |---|---|---|---| | Sphere Light | | | | | | Spot Light | | | | | | Rectangular Area Light | | | | | | Disk Area Light | | | | | | Distant Light | | | | |
Author
Member

I do not quite get the point of the columns "normalized unit" and "unnormalized unit". What we are correcting here is the conversion factor between unit in the UI and the unit in Cycles. For the former, I think it is already documented and visible in the UI, W/m^2 for sun light and W for others. For the later it is always radiance (Wm^{-2}sr^{-1}). Breaking changes in the conversion between these two only concerns area light.
But if you consider this conversion to USD (light->normalize) also as a breaking change, that would concern all the light sources, I can revert the conversion in #109329 and create a separate pull request for that. The conversion in #108996 would be there anyway if we change the sampling method, so I'm not sure.

I do not quite get the point of the columns "normalized unit" and "unnormalized unit". What we are correcting here is the conversion factor between unit in the UI and the unit in Cycles. For the former, I think it is already documented and visible in the UI, \(W/m^2\) for sun light and \(W\) for others. For the later it is always radiance (\(Wm^{-2}sr^{-1}\)). Breaking changes in the conversion between these two only concerns area light. But if you consider this conversion to USD (`light->normalize`) also as a breaking change, that would concern all the light sources, I can revert the conversion in #109329 and create a separate pull request for that. The conversion in #108996 would be there anyway if we change the sampling method, so I'm not sure.
Brecht Van Lommel approved these changes 2023-07-03 13:34:03 +02:00
Brecht Van Lommel left a comment
Owner

I think this change is fine by itself, but let's wait with landing it together with other possibly compatibility breaking changes.

I think this change is fine by itself, but let's wait with landing it together with other possibly compatibility breaking changes.
Brecht Van Lommel added 2 commits 2023-07-05 15:21:56 +02:00
Brecht Van Lommel added 1 commit 2023-07-05 20:49:44 +02:00

@weizhen you can commit this and other light changes now.

If needed, with the forward compatibility we can make further changes while keeping the .blend files load correctly in older Blender versions.

@weizhen you can commit this and other light changes now. If needed, with the forward compatibility we can make further changes while keeping the .blend files load correctly in older Blender versions.
Weizhen Huang added 2 commits 2023-07-07 17:02:29 +02:00
Weizhen Huang merged commit 482211b7e0 into main 2023-07-07 17:03:09 +02:00
Weizhen Huang deleted branch fix_area_light_scaling 2023-07-07 17:03:10 +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
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#109153
No description provided.