oneVR / VRWorldToolkit

Unity Editor extension for making VRChat worlds
MIT License
414 stars 19 forks source link

Misleading Tip - Lightmapper #1

Closed owlboy closed 3 years ago

owlboy commented 3 years ago
image

I find Progressive CPU Lightmapper to be quite a bit slower than Enlighten and as such, I still use Enlighten. While I agree Progressive can have better quality, it is not necessarily faster.

Additionally, if you are using Realtime GI updates, those don't seem to completely work with Progressive under Unity 2018. In particular, light probes are not updated. If you know otherwise, lemme know. I have not figured out how to make them work.

And finally, the reason I compare Enlighten to the Progressive CPU Lightmapper in particular is that the GPU Preview is not on macOS in Unity 2018. And if your scene is too complicated, it will fall back to CPU anyway.

orels1 commented 3 years ago

It is interesting that you get faster results with Enlighten, because enlighten's lighting algorithm is much more complex than progressive, which does basic pathtracing.

GPU progressive is not good in 2018 so that shouldn't be recommended anyways, so you're correct to compare to CPU. But I've never seen progressive being slower than enlighten on comparable settings, at least on my current and previous macbook as well as on the PC 🤔

For realtime GI - you're correct, using progressive doesnt seem to call enlighten code for lightprobes, while still calling it for realtime lightmaps (for reasons only known to Unity), so yeah, you have to use enlighten in that case. I would suspect that if you're not using realtime GI - progressive should be always faster, otherwise - you might be losing some of the work because you already run enlighten for realtime and then you also run a full pass of progressive hence why it can be slower in some cases.

I feel like this is a pretty niche thing, so I would maybe propose a small correction in the vein of "unless you're using Realtime GI" maybe with a comment "unless your system runs Enlighten faster". Because most people will probably be better off with progressive and skipping the whole realtime step completely

owlboy commented 3 years ago

I don't find the difference in a speed slower with all projects, but with The Pug project, my experimenting showed it was.

When you say "comparable settings" @orels1 What are they? Maybe I am being unreasonable with my settings in Progressive. In particular, the samples.

For sample counts, what is comparable to Enlighten? I am not sure how to calculate that. When I have experimented in the past I found when the bake times seemed to be comparable or faster I had "fireflies" or other artifacts. This could be due to other lighting issues (poor choices in light brightness, emissive objects acting odd, etc). But it seemed like it was a "too few samples" issue.

I'd really like to switch to Progressive. I do a lot of custom UV map work to make Elightnen happy. I've gotten rather good at it. But Progressive is much more forgiving, especially with the "Stitch Seams" option turned on.

oneVR commented 3 years ago

Yeah, this message is partly there to nudge people towards Progressive since Enlighten will be completely removed once we get to Unity 2020, so they have some warning time before it's completely gone. Even though it's gonna take a while before we get to that point. But I can try rewriting the message soon to be a bit more informative on the matter.

I also have a separate message warning people about GPU Progressive in cases where it's likely to fall back to CPU, usually when baking 4k lightmaps because of how much VRAM it needs, which also checks the current VRAM amount and doesn't show the message if the GPU has more than 12 gigs of VRAM since that's the amount Unity themselves mentioned for 4k bakes in 2018.

oneVR commented 3 years ago

Decided to remove the message completely for now since current Unity versions Progressive can give really varying results compared to Enlighten. https://github.com/oneVR/VRWorldToolkit/commit/1acbaa9a850852455a41aa544bb496f6833af586