simple support for local lights on mtoon #1934
Open
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.



closes #1131
this adds support for basic additive local lights on mtoon. like UniVRM and Lyuma, this doesn't affect the lighting direction used for MToon shading, because we don't have access to the necessary information in the deferred pass.
this ended up being quite a bit simpler than I originally thought once I realized I could store which surfaces were MToon in the deferred buffer using existing mechanisms and use that to skip directional lighting and only apply local lights. I've also added a framebuffer debugging option to luci to visualize just MToon surfaces
Test plan
You can run this script to create a bunch of MToon spheres and confirm that they are now affected by light entities. Note again that this lighting is additive, so a full bright MToon surface (1, 1, 1) will still appear white when lit - although if you have bloom enabled the surface will still glow with the light color since bloom uses the unclamped color.
Funding
This project is funded through NGI0 Entrust, a fund established by NLnet with financial support from the European Commission's Next Generation Internet program. Learn more at the NLnet project page.