-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Merged by Bors] - Spotlights #4715
Closed
Closed
Changes from 1 commit
Commits
Show all changes
53 commits
Select commit
Hold shift + click to select a range
63b91a8
spotlights
robtfm fc0a685
update demos
robtfm d85cfa2
spotlight cluster culling
robtfm 19aa631
vary angle in example
robtfm 61120b5
optimise
robtfm f300809
format
robtfm c2db39b
use const Vec2 in lights cluster and bounding box when possible (#4602)
mockersf 2756a8c
spotlight cluster culling
robtfm 585d101
optimise
robtfm c0c5437
format
robtfm 0cb0544
format
robtfm cadcad0
remove debug output
robtfm 55fb290
fix rebase
robtfm 91ec7ff
add front_cull test
robtfm 47fe2ea
shadow maps
robtfm 8464d7b
fix frustum for culling light entities
robtfm 87ffc6f
fix spot map offset
robtfm 6c39cd1
format
robtfm 5f97f1e
reduce pointlight struct size
robtfm 2d8a8ed
ci
robtfm 6f8c9f9
ci?
robtfm 3de7c9a
clean up maths
robtfm f562869
fmt
robtfm 9357a5e
Merge branch 'main' into spotlight
robtfm 5f66f57
remove near/far
robtfm 695bdc5
compress light direction
robtfm 00d3cc2
filament
robtfm eccfa1b
apply suggestions from code review
robtfm fb28014
add SpotlightBundle
robtfm d9b20f4
use xz for direction, revert sign() change
robtfm e241daa
format
robtfm 109077e
lift condition
robtfm d3ccb12
fix webgl mipmap sample
robtfm 5968759
remove println
robtfm b0f651f
Squashed commit of the following:
robtfm e8e6f1b
reapply to main
robtfm b1a82d3
Merge branch 'main' into spotlight
robtfm 970a3cc
Merge branch 'main' into spotlight
robtfm 8fd40b2
fmt
robtfm 612813a
fix point light sort order comment
robtfm d8c362c
add comment on spotlight intensity divisor
robtfm 42cb994
Merge branch 'main' into spotlight
robtfm 68b8ebb
Update Cargo.toml
robtfm 6c8ec1c
build-example-pages
robtfm 723bfeb
spotlight / Spotlight -> spot_light / SpotLight
robtfm a3809f7
bevy_gltf: Support loading spotlights
superdump ea909d0
spotlight / Spotlight -> spot_light / SpotLight
robtfm 974fd52
remove unused SPOT_LIGHT flag
robtfm 32a72f2
separate using-facing SpotLight struct
robtfm 8a81014
Merge branch 'main' into spotlight
robtfm 1617119
doc comment
robtfm 45f68ad
ci
robtfm ab4d91c
ci ci
robtfm File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
add comment on spotlight intensity divisor
- Loading branch information
commit d8c362ce71ce9237c7b45fba1cc4db5bcd543dc5
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think filament suggests a different intensity unit for spotlights to enable specifying a consistent brightness even if you change the radius. The above constant factor was for point lights.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, they use I = Phi / pi for spotlights, as opposed to I = Phi / (4*pi) for point lights (assuming we don't want intensity to vary with
radiusedit:angle, which i don't think we do).i'm happy to change that, but i don't see why they make spotlights 4x brighter than the equivalent intensity point lights by default. i also am pretty sure that
This new formulation can also be considered physically based if the spot's reflector is replaced with a matte, diffuse mask that absorbs light perfectly
is flat-out wrong if the factor is not the same as for point lights..?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, phi / pi is what we should use for spotlights, if it does indeed make the apparent intensity of the light be consistent across inner/outer radius changes.
I think the 4x brighter is them saying that a spotlight will cover roughly 1/4 a sphere worth of solid angle and that all the luminous power is directed in the cone of the spotlight so it is indeed brighter for the same luminous power. And yes, in that case I agree with you that it would rather mean that the spotlight's reflector is perfect such that all energy is reflected out in the direction of the spotlight's cone. If it were matte and perfectly absorbent, then I agree it should have the same factor, intuitively. I haven't done the maths though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as discussed, kept as 4pi for PoLS when toggling, added comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, we think it is more user-friendly if the mapping from luminous power (rate of energy radiation from the light source) to luminous intensity (rate of energy radiation per unit angle) is the same for point and spot lights as then you can change the type and the brightness will be the same. The counter argument could be if people have calibrated spot light power values or something and this doesn't behave properly. I'm fine to try this and then iterate if it turns out people don't like it.