You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This adds features from #152 that I am adding here to make the PRs more modular
Mostly this is some house keeping in the lighting, that makes it easier for other modules to use the light code
Reduce repeated code in light.inc.wgsl
Done with a kind of iter funtion over any light objects calculate_nth_light_ray
You can see the improvment in pbr.inc.wgsl where what used to be four for loops one for each type of
light is now reduced to a single loop
Seperate lighting and pbr code into light.inc.wgsl and pbr.inc.wgsl
Remove redundant normal vector in light.inc.wgsl
I would also like to discuss moving Lights (and their light.inc.wgsl) into core and leaving only pbr.inc.wgsl indotrix_pbr but feel that should be another PR
We seem to be using something like jinja templating.
Have we considered about using the tera crate for formally providing a templating engine. We could fill it will all our own includes and provide the Tera struct for users to extend too. If we pass code through Tera when we load a shader it will error early if there are any missing {{ binding }} that would otherwise error at the Naga level with a perhaps harder to interpret message. We could also provide perhaps some common useful functions and use jinja templates and code to help write our shaders.
Yeah, exactly, I was thinking about using a template engine. At the time of PBR implementation I decided to use DUMB solution. Thank for the reference, I will check the tera crate.
I am using tera in #152 already so maybe look at how it works there would help too.
This file contains hidden or 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.
This adds features from #152 that I am adding here to make the PRs more modular
Mostly this is some house keeping in the lighting, that makes it easier for other modules to use the light code
light.inc.wgslcalculate_nth_light_raypbr.inc.wgslwhere what used to be four for loops one for each type oflight is now reduced to a single loop
light.inc.wgslandpbr.inc.wgsllight.inc.wgslI would also like to discuss moving Lights (and their
light.inc.wgsl) into core and leaving onlypbr.inc.wgslindotrix_pbrbut feel that should be another PR