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

Use custom point light preparation #17

Merged
merged 2 commits into from
Jul 19, 2024
Merged

Use custom point light preparation #17

merged 2 commits into from
Jul 19, 2024

Conversation

jgayfer
Copy link
Owner

@jgayfer jgayfer commented Jul 17, 2024

Summary

While GpuArrayBuffer does a lot of this for us, it also has a quirk where it won't write to the GPU if the array is empty, which messes with our pipeline.

Fixes #16

While GpuArrayBuffer does a lot of this for us, it also has a quirk
where it won't write to the GPU if the array is empty, which messes
with our pipeline.
@jgayfer
Copy link
Owner Author

jgayfer commented Jul 18, 2024

@Sapein I still need to some testing on this, specifically against WebGPU / WebGL2, but wouldn't mind a quick sanity check that this does indeed fix #16 (if you have have the time of course).

EDIT: I'm actually reasonable happy with this. Going to merge + release a patch.

@jgayfer jgayfer merged commit 2ae0336 into main Jul 19, 2024
6 checks passed
@jgayfer jgayfer deleted the fix-ambient branch July 19, 2024 16:37
jgayfer added a commit that referenced this pull request Jul 28, 2024
jgayfer added a commit that referenced this pull request Jul 28, 2024
* Revert "Use custom point light preparation (#17)"

This reverts commit 2ae0336.

* Write "empty" point light to render world

GpuArrayBuffer won't write to the GPU if we have no point lights (an
empty array).

We first tried writing a more custom integration with the GPU, but ended
up running into a very similar problem.

For now lets use GPUArrayBuffer and all it does for us, writing an "empty"
point light to ensure we'll always have a binding.

* Update changelog
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.

Ambient light does not work without point lights
1 participant