Cycles/EEVEE: change point light to double-sided sphere light #108506
No reviewers
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
5 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#108506
Loading…
Reference in New Issue
No description provided.
Delete Branch "weizhen/blender:point_light_to_sphere_light"
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?
for energy preservation and better compatibility with other renderes. Ref: #108505
Point light now behaves the same as a spherical mesh light with the same overall energy (scaling from emission strength to power is (4\pi^2R^2)).
Cycles
Comparison
The behavior stays the same when
radius = 0
.No obvious performance change observed.
Sampling
When shading point lies outside the sphere, sample the spanned solid angle uniformly.
When shading point lies inside the sphere, sample spherical direction uniformly when inside volume or the surface is transmissive, otherwise sample cosine-weighted upper hemisphere.
Light Tree
When shading point lies outside the sphere, treat as a disk light spanning the same solid angle.
When shading point lies inside the sphere, it behaves like a background light, with estimated outgoing radiance
with
f_a
being the BSDF andE
measure.energy
inlight_tree.cpp
.The importance calculation for
LIGHT_POINT
isConsider
min_importance = 0
because maximal incidence angle is\pi
, we could substituted^2
with\frac{r^2}{2}
so the averaged outgoing radiance isf_a \frac{E}{r^2}
.This only holds for non-transmissive surface, but should be fine to use in volume.
EEVEE
When shading point lies outside the sphere, the sphere light is equivalent to a disk light spanning the same solid angle. The sine of the new half-angle is the tangent of the previous half-angle.
When shading point lies inside the sphere, integrating over the cosine-weighted hemisphere gives 1.0.
Comparison with Cycles
The plane is diffuse, the blue sphere has specular component.
TODO
0153e574cd
toabcacaa58e
00b3bd8f23
to19bf32dcc6
WIP: Cycles: change point light to sphere lightto Cycles/EEVEE: change point light to sphere lightCycles/EEVEE: change point light to sphere lightto Cycles/EEVEE: change point light to double-sided sphere light@ -23,2 +18,2 @@
if (radius > 0.0f) {
ls->P += disk_light_sample(lightN, rand) * radius;
float3 lightN = P - klight->co;
const float d_sqr = len_squared(lightN);
The Blender convention is to use
_sq
suffix.@blender-bot package
Package build started. Download here when ready.
I wish I could point out a mistake because this way it seems like I didn't really review it, but I couldn't spot one. Benchmark scenes look ok too.
@ -159,2 +176,2 @@
points[0] = Px * -ld._area_size_x + Py * -ld._area_size_y;
points[1] = Px * ld._area_size_x + Py * -ld._area_size_y;
if (ld.type == LIGHT_POINT) {
/* Sphere light spans a larger angle than a disk light with the same radius (sin -> tan). */
This
sin -> tan
is a bit cryptic. It could help if it was a full sentence.