Split apply_pbr_lighting into many many small functions #17541
Labels
A-Rendering
Drawing game state to the screen
C-Feature
A new feature, making something new possible
D-Straightforward
Simple bug fixes and API improvements, docs, test and examples
S-Needs-Design
This issue requires design work to think about how it would best be accomplished
What problem does this solve or what need does it fill?
Please split apply_pbr_lighting into many many small functions. You can keep the function name the same and what it does the same. But please make it perform a bunch of small functions which can be called individually for when we are making Extension Material Shaders.
This is because I want to change the way shadows work (cel shading) but it seems VERY VERY horribly hard to do with the way that apply_pbr_lighting is so monolithic right now.
What solution would you like?
for example I want each input of this line to have its own small function
And i want to be able to effectively easily modify that specific line of code in my extension material shader . Right now, I have to completely re-write (re-implement) the entirety of apply_pbr_lighting just to change the way direct light affects my output color because this is too monolithic.
What alternative(s) have you considered?
Offer a few preset different apply_pbr_lighting functions that work differently? Make some of them have different input props or a bit flag to be able to change the way inner parts of it work?
But overall i think the best soln here is to just take chunks of the innards of apply_pbr_lighting and put them into small functions which apply_pbr_lighting calls. That way, I can implement those small functions into my shader exactly how i wish and only have to rewrite perhaps a small part of apply_pbr_lighting to change the way my color reacts to point and dynamic lights. !
Additional context
The text was updated successfully, but these errors were encountered: