Lights: Option to use old point light falloff #117832

Merged
Brecht Van Lommel merged 14 commits from brecht/blender:point-sphere-light into blender-v4.1-release 2024-02-07 19:07:23 +01:00

Add new "Soft Falloff" option on point and spot light that uses
the old light behavior from Blender versions before 4.0. Blend
files saved with those older versions will use the option.

This option is enabled by default on new lights.

Fix #114241

Add new "Soft Falloff" option on point and spot light that uses the old light behavior from Blender versions before 4.0. Blend files saved with those older versions will use the option. This option is enabled by default on new lights. Fix #114241
Brecht Van Lommel added 2 commits 2024-02-05 11:36:06 +01:00
ae217754de Refactor: Changes to point and sphere light
Rename some functions, add comment, reshuffle code in preparation of
adding an option for old point light behavior.
Brecht Van Lommel requested review from Weizhen Huang 2024-02-05 11:36:31 +01:00
Weizhen Huang added 2 commits 2024-02-06 16:18:59 +01:00
Weizhen Huang added 1 commit 2024-02-06 18:51:47 +01:00
Weizhen Huang added 5 commits 2024-02-07 13:19:58 +01:00
Brecht Van Lommel changed title from WIP: Lights: Option to use old point light falloff to Lights: Option to use old point light falloff 2024-02-07 13:24:37 +01:00
brecht changed target branch from main to blender-v4.1-release 2024-02-07 13:27:06 +01:00
Author
Owner

I can't approve my own PR, but code looks good to me.

Not sure if you are planning anything else, besides fixing the merge conflict.

I can't approve my own PR, but code looks good to me. Not sure if you are planning anything else, besides fixing the merge conflict.
Clément Foucault requested review from Clément Foucault 2024-02-07 13:50:40 +01:00
Clément Foucault requested changes 2024-02-07 14:08:49 +01:00
@ -329,3 +335,3 @@
return ltc_evaluate_disk(N, V, mat3(1.0), points);
}
else if (ld.l_type == POINT) {
else if (ld.l_type == OMNI_SPHERE) {

Missing spot case

Missing spot case
weizhen marked this conversation as resolved
@ -184,3 +184,3 @@
sampler2DArray utility_tx, LightData light, vec3 N, vec3 V, LightVector lv, vec4 ltc_mat)
{
if (light.type == LIGHT_POINT && lv.dist < light._radius) {
if (light.type == LIGHT_OMNI_SPHERE && lv.dist < light._radius) {

You need to account for the spot case here.

You need to account for the spot case here.
weizhen marked this conversation as resolved
Weizhen Huang added 1 commit 2024-02-07 14:26:08 +01:00
buildbot/vexp-code-patch-windows-amd64 Build done. Details
buildbot/vexp-code-patch-coordinator Build done. Details
244be1637b
Address reviews

@blender-bot build

@blender-bot build
Clément Foucault approved these changes 2024-02-07 14:30:28 +01:00
Weizhen Huang added 1 commit 2024-02-07 14:41:00 +01:00
Member

Do we need test files for the sphere light (point light without soft falloff)? With this change the old test files will revert to the previous behavior, and light_texture is the only test file I know that was created in 4.0 which has the sphere light behavior.

Do we need test files for the sphere light (point light without soft falloff)? With this change the old test files will revert to the previous behavior, and light_texture is the only test file I know that was created in 4.0 which has the sphere light behavior.
Author
Owner

Yes, I would update the existing test files with the previous behavior. And then make copiesof a few important ones in the lights folder, to make sure we test the sphere in a volume, with multiple lights, texturing, IES.

Yes, I would update the existing test files with the previous behavior. And then make copiesof a few important ones in the lights folder, to make sure we test the sphere in a volume, with multiple lights, texturing, IES.
Member

You mean we don't modify the existing test files themselves, but make a few duplicate files to test the sphere light?
Also, I guess I can push directly to the release branch, and do the changes in the test files and merge to main later? I usually push to the main branch so not very sure.

You mean we don't modify the existing test files themselves, but make a few duplicate files to test the sphere light? Also, I guess I can push directly to the release branch, and do the changes in the test files and merge to main later? I usually push to the main branch so not very sure.
Author
Owner

You mean we don't modify the existing test files themselves, but make a few duplicate files to test the sphere light?

Yes.

Also, I guess I can push directly to the release branch, and do the changes in the test files and merge to main later? I usually push to the main branch so not very sure.

Ah yeah, maybe it's better if I commit this PR then along with the updated test files, and do the svn merge.

If you think this PR is ready as is, I can do it now. And then after you can commit new test files in main.

We're soon switching to Git LFS so no point getting familiar with svn merges now.

> You mean we don't modify the existing test files themselves, but make a few duplicate files to test the sphere light? Yes. > Also, I guess I can push directly to the release branch, and do the changes in the test files and merge to main later? I usually push to the main branch so not very sure. Ah yeah, maybe it's better if I commit this PR then along with the updated test files, and do the svn merge. If you think this PR is ready as is, I can do it now. And then after you can commit new test files in main. We're soon switching to Git LFS so no point getting familiar with svn merges now.
Weizhen Huang approved these changes 2024-02-07 15:50:02 +01:00
Weizhen Huang left a comment
Member

Looks good. If you are going to commit, mention in the commit message that the new option is enabled by default.
Some test files have changes that are too subtle for our criteria but still quite obvious with bare eyes (bsdf diffuse for example), maybe you want to change those too.

Looks good. If you are going to commit, mention in the commit message that the new option is enabled by default. Some test files have changes that are too subtle for our criteria but still quite obvious with bare eyes (bsdf diffuse for example), maybe you want to change those too.
Author
Owner

Looks good. If you are going to commit, mention in the commit message that the new option is enabled by default.

Done.

Some test files have changes that are too subtle for our criteria but still quite obvious with bare eyes (bsdf diffuse for example), maybe you want to change those too.

Right, if they are near the threshold they can fail on other platforms. I'll temporarily lower the failure threshold when running BLENDER_TEST_UPDATE.

> Looks good. If you are going to commit, mention in the commit message that the new option is enabled by default. Done. > Some test files have changes that are too subtle for our criteria but still quite obvious with bare eyes (bsdf diffuse for example), maybe you want to change those too. Right, if they are near the threshold they can fail on other platforms. I'll temporarily lower the failure threshold when running `BLENDER_TEST_UPDATE`.
Author
Owner

When preparing the EEVEE (not Next) test update, I noticed this bug.

When preparing the EEVEE (not Next) test update, I noticed this bug.
Weizhen Huang added 1 commit 2024-02-07 16:41:40 +01:00
Member

@brecht Can you test with the new change?

@brecht Can you test with the new change?
Author
Owner

Still the same problem unfortunately.

Still the same problem unfortunately.
Clément Foucault added 1 commit 2024-02-07 17:31:34 +01:00

@brecht should be fixed now. I could reproduce by manually forcing skipped projection to be cleared to 0.0 depth. This behavior is driver dependent. But now the bug is fixed.

@brecht should be fixed now. I could reproduce by manually forcing skipped projection to be cleared to `0.0` depth. This behavior is driver dependent. But now the bug is fixed.
Author
Owner

Indeed, that worked.

Indeed, that worked.
Brecht Van Lommel merged commit bd8a44e169 into blender-v4.1-release 2024-02-07 19:07:23 +01:00
Brecht Van Lommel deleted branch point-sphere-light 2024-02-07 19:07:30 +01:00
Contributor

The option is enabled by default on new lights, not disabled? Are you sure you did not get it the other way around? To keep it enabled on existing lights for legacy reasons but disabled it on new lights?

Why would you have physically based renderer which defaults to not physically based lighting? Users should have to go out of their way to break physically based rendering, not to achieve it. This is returning to early 2000's messy dark age of rendering.

Every single time anyone now makes a sphere light, they need to go out of their way to make sure the light is actually emitted from the surface of the sphere.

The option is **enabled** by default on new lights, not **disabled**? Are you sure you did not get it the other way around? To keep it enabled on existing lights for legacy reasons but disabled it on new lights? Why would you have physically based renderer which defaults to not physically based lighting? Users should have to go out of their way to break physically based rendering, not to achieve it. This is returning to early 2000's messy dark age of rendering. Every single time anyone now makes a sphere light, they need to go out of their way to make sure the light is actually emitted from the surface of the sphere.
Member

@Rawalanche In Blender this light type is called point light, not sphere light, and nowhere in the UI does it indicate that this light should behave like a sphere, which is why some people find the behavior in 4.0 confusing. I personally prefer the physically based behavior, but physically "based" is just a model and not necessarily physically "correct". Some artists find the old behavior easier to work with, and with this patch it has nice texture projection.
The concept of a “point light with radius” is rather vague, and we are still exploring ways to make the name in the UI more self-explanatory, either by introducing a new light type called sphere light and give it the sphere light behavior, or rename this to omni light and allow users to choose from different geometries… there are many possibilities, but none of them seem satisfactory, and would be too much a breaking change to the API at this stage for 4.1. We intend to investigate ways to improve it in 4.2.

@Rawalanche In Blender this light type is called point light, not sphere light, and nowhere in the UI does it indicate that this light should behave like a sphere, which is why some people find the behavior in 4.0 confusing. I personally prefer the physically based behavior, but physically "based" is just a model and not necessarily physically "correct". Some artists find the old behavior easier to work with, and with this patch it has nice texture projection. The concept of a “point light with radius” is rather vague, and we are still exploring ways to make the name in the UI more self-explanatory, either by introducing a new light type called sphere light and give it the sphere light behavior, or rename this to omni light and allow users to choose from different geometries… there are many possibilities, but none of them seem satisfactory, and would be too much a breaking change to the API at this stage for 4.1. We intend to investigate ways to improve it in 4.2.

I removed the last comments and insults. A kind reminder about our https://developer.blender.org/docs/handbook/communication/code_of_conduct/

@Rawalanche @Martin-121

I removed the last comments and insults. A kind reminder about our https://developer.blender.org/docs/handbook/communication/code_of_conduct/ @Rawalanche @Martin-121
Member

@Rawalanche @Martin-121 please tone it down a tad. Wont go into the arguments themselves, just a quick reminder of https://developer.blender.org/docs/handbook/communication/code_of_conduct/

Thx in advance!

@Rawalanche @Martin-121 please tone it down a tad. Wont go into the arguments themselves, just a quick reminder of https://developer.blender.org/docs/handbook/communication/code_of_conduct/ Thx in advance!
Sign in to join this conversation.
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
6 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#117832
No description provided.