Fix wrong conversion between power and radiance of emitters #108505
Labels
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
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#108505
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
There are factors for converting power in watts to radiance in watts per steradian per square meter (
eval_fac
in Cycles). However, some scalings are incorrect. Adjusting the scaling preserves the energy of the light source and improves compatibility with other renderers.Area Light
Assuming Lambertian emitter, the outgoing radiance integrated over the hemisphere and the projected area gives the total emitted power (radiant flux)
Therefore,
eval_fac
should beM_1_PI_F * invarea
instead of0.25f * invarea
.The factor
normalize_spread
inlight.cpp
ensures that the area light emits the same amount of power regardless of the spread angle.Point Light
The physical meaning of a point light with radius is unclear. In Blender it appears to be something similar to sphere light although not exactly due to the visible solid angle. If treated as a sphere light, the total emitted power is given by
with
R
being the radius of the point light. In Cycles,spot.inv_area = 1.0f / (M_PI_F * radius * radius)
(seelight.cpp
). Therefore,eval_fac = 0.25f * M_1_PI_F * invarea
, as currently in the implementation.HOWEVER, if we follow the current sampling procedure exactly, a point light with radius looks like a disk light from every direction. In this case, we can compute the radiant flux through a sphere of radius
D
around the point light center (Gauss's Law). The irradiance at arbitrary point on the sphere isusing the Jacobians
\mathrm{d}\omega=\frac{\cos\theta_o}{d^2}\mathrm{d}A
and\mathrm{d}A=r\mathrm{d}r\mathrm{d}\phi
, andd=\sqrt{r^2+D^2}
is the distance between a point on the light source and the point on the sphere. Substituting\cos\theta_i=\cos\theta_o=\frac{D}{d}
in the above equation, we obtainTherefore, the total emitted radiant flux is
The result depends on the receiver distance and is therefore not physically correct. The additional factor
\frac{D^2}{D^2+R^2}
plotted against\frac{D}{R}
isTherefore, it approximates a sphere light when approaching infinity.
The plan is to change point light to (double-sided) sphere light (#108506). In EEVEE a sphere light can be treated as a disk light that spans the same solid angle from the shading point.
Spot Light
Spot lights use the same sampling procedure as point lights, but emit light only in a cone: the function
spot_light_attenuation()
inspot.h
acts as masking function (ifblend
is ignored), so the power specified in the UI corresponds to TWICE the power emitted by a spot light with\mathrm{half\_spread} = \frac{\pi}{2}
. This behaviour is different than with area lights, where a normalization factor is used so that the intensity changes when adjusting the spread angle. According to Frostbite:We could follow their approach to multiply the current
eval_fac
by 4, so that the power corresponds to the amount emitted by a spot light with\mathrm{half\_spread} = \frac{\pi}{3}
, or just keep it as is so it gives the same intensity as a point light, or add an option for normalization.Sun Light
For sun light, user specify an "intensity", which is the irradiance received by a surface perpendicular to the sun direction, the unit being Watt per square meter. Using the irradiance formula derived for point lights and treating the sun light as a disk light 1 unit away, we have
where
\alpha
is half the angular diameter. Currently\mathrm{eval\_fac} = \frac{1}{\pi\tan^2\alpha\cos^3\phi}
; using\cos\phi = \frac{1}{\sqrt{r^2+1}}
, the irradiance is computed asPlotting the additional factor against the angular diameter:
for small angular diameter the value is close to 1, so the scaling for sun light seems fine.
I think this can be closed now.
The factors are corrected in various commits listed above. To summarize:
Area Light
Using a factor of
1/(\pi A)
, as computed above.Sphere Light
Using a factor of
1/(4\pi^2r^2)
, as computed above.Point Light
Sphere light with
r=0
, using a factor of1/(4\pi)
, corresponds to the solid angle of a sphere.Spot Light
Using the same factor as sphere light.
Sun Light
Disk sampling has been changed to solid angle sampling. Denoting the half angular diameter as
\alpha
, the irradiance received by a differential surface penpendicular to the sun direction isTherefore, the factor to convert from irradiance to radiance is
1/(\pi\sin^2\alpha)
.