PiMaker / ltcgi

Optimized plug-and-play realtime area lighting using the linearly transformed cosine algorithm for Unity/VRChat.
https://ltcgi.dev
Other
442 stars 25 forks source link

Fix Shader warnings with out parameters instead of early returns #22

Closed ScruffyRules closed 1 year ago

ScruffyRules commented 1 year ago

Title is not exactly correct since there still is early returns, it's just that they don't return any data.

I did a visual difference check and it seems there is 0 change.

I also diff checked the compiled code and found that it has reduced instruction/math count and a branch or two! Unsure if performance has changed by those branch removals.

PiMaker commented 1 year ago

Thanks for the PR and the review, lgtm too! I'll merge this and maybe add a followup to change how LTCGI_sample works overall, but I'll make sure to not reintroduce any warnings. Much appreciated!