Open Fronkln opened 5 years ago
SaracenOne already did that https://github.com/SaracenOne/Unity-Source-Tools
That applies to everything on scene though, it's not gonna look pretty, lightmaps are gonna become even brighter
Addittionally, i have written extra code regarding this that will help with spotlights as well
Another thing i have noticed, it "assumes" certain values of lights, not trying to make the best out of the data provided by BSP so it's more flexible
The fact that SaracenOne's applies to the entire map is VERY unoptimized as well, i'm guessing lights would constantly flicker (due to pixel light size and that the lights apply to ENTIRE map)
Let's assume that he raised the pixel light count to 60, at this point the game will start lagging due to calculating so much lights at once, his method can work on pre-loaded maps but it will absolutely KILL optimization if used at real-time
Now let's take a look at my method:
Light's are only applied to a few select layers (and never the entire map!) so unless there is like 30-60 entities wandering around the entire map, light flickers (Unity transitioning pixel light to vertex light) can NEVER be noticeable, my method also doesn't need to raise the pixel light count to disgusting amounts (like 30-60) and can work with 2-6.
Hope that clears it up.
You're quite right about it being woefully unoptimised, but if I recall, I was enabling them with a very specific purpose, which was to simply use them for someone baking out entirely new lightmaps and probes from scratch.
I recently have re-implemented commented out lighting code to recreate lighting entities and have it only apply to objects that are not a part of the map lightmap the results are very nice. Should be worth to have it added to this
Before: After:
Note: the bloom effect comes from Post-Processing Stack v2