Skip to content
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

Add light occlusion #20

Merged
merged 30 commits into from
Aug 6, 2024
Merged

Add light occlusion #20

merged 30 commits into from
Aug 6, 2024

Conversation

jgayfer
Copy link
Owner

@jgayfer jgayfer commented Aug 2, 2024

Summary

Sets us up with some basic light occlusion with hard shadows.

The bulk of this work was under a collaboration with @malbernaz, lifting some of the SDF work from bevy_lit into bevy_light_2d.

Closes #2

Screencast.from.2024-08-02.15-14-33.mp4

malbernaz and others added 24 commits July 29, 2024 23:04
Dynamic arrays aren't supported in WebGL2, so we have to fall back to
a fixed size array in a uniform binding.

Co-Authored-By: Miguel Albernaz <albernazmiguel@gmail.com>
Co-Authored-By: Miguel Albernaz <albernazmiguel@gmail.com>
PBR is for 3D stuff. It's nice to not need it.

We'll want to clean up our view conversion definitions in the future.

Co-Authored-By: Miguel Albernaz <albernazmiguel@gmail.com>
The resulting texture isn't used yet, but it's being written to.

Co-Authored-By: Miguel Albernaz <albernazmiguel@gmail.com>
Now we're using our light map, blended with our main texture.

Co-Authored-By: Miguel Albernaz <albernazmiguel@gmail.com>
Co-Authored-By: Miguel Albernaz <albernazmiguel@gmail.com>
Co-Authored-By: Miguel Albernaz <albernazmiguel@gmail.com>
Not strictly necessary, but I do like having an explicit render graph,
especially if it's something someone else ever wanted to tweak.

Co-Authored-By: Miguel Albernaz <albernazmiguel@gmail.com>
This will allow us to sanely expand our API as we introduce more
occluder shapes.

Co-Authored-By: Miguel Albernaz <albernazmiguel@gmail.com>
A refactor, again getting us to a world of a proper render graph.

Co-Authored-By: Miguel Albernaz <albernazmiguel@gmail.com>
Co-Authored-By: Miguel Albernaz <albernazmiguel@gmail.com>
Nice to split this one up, rather than all the textures living on one
component.

Co-Authored-By: Miguel Albernaz <albernazmiguel@gmail.com>
Now we can completely isolate our light map and sdf textures.

Co-Authored-By: Miguel Albernaz <albernazmiguel@gmail.com>
This shader isn't specific to any one pipeline, so let's pull it up.

Co-Authored-By: Miguel Albernaz <albernazmiguel@gmail.com>
Co-Authored-By: Miguel Albernaz <albernazmiguel@gmail.com>
No blur yet. Will add this back later.

Co-Authored-By: Miguel Albernaz <albernazmiguel@gmail.com>
Co-Authored-By: Miguel Albernaz <albernazmiguel@gmail.com>
Co-Authored-By: Miguel Albernaz <albernazmiguel@gmail.com>
Co-Authored-By: Miguel Albernaz <albernazmiguel@gmail.com>
Co-Authored-By: Miguel Albernaz <albernazmiguel@gmail.com>
These were wrong!
@jgayfer jgayfer requested a review from malbernaz August 2, 2024 22:16
jgayfer added 5 commits August 4, 2024 14:15
Missed this when porting things over.
This will allow us to encode more information into an occluder, such as
information on how shadows should be cast.
@jgayfer jgayfer changed the title Add basic light occlusion Add light occlusion Aug 5, 2024
@jgayfer jgayfer merged commit 30db46a into main Aug 6, 2024
6 checks passed
@jgayfer jgayfer deleted the feature/light-occluders branch August 6, 2024 03:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Light occlusion
2 participants