#Baking Lighting: iGPU + 128 GB RAM or dedicated GPU + 16 GB VRAM?
1 messages · Page 1 of 1 (latest)
Yes
Dedicated GPU is practically always the fastest option
Light baking is not really RAM dependent
There's been a few times where I've run out of VRAM and it switches to CPU baking
With what editor version?
2021.3.38f1
Making mods for Blade & Sorcery, so we're stuck with that version for now
I see, was about to say that each major release has improved how the lightmapper can rotate memory
So things are better in Unity 6?
Probably but I recall 2021.3. is supposed to have many of the relevant improvements already
https://docs.unity3d.com/2021.3/Documentation/Manual/GPUProgressiveLightmapper.html
Such as lightmapper tiling
16 GB is a lot to run out, so I'd examine if you are baking too big lightmap atlases, or especially too many complex meshes that may be inconsequential for the result
Or even detrimental
It is really flipping big
Then it is possible that no matter what it may be too big for even memory tiling
But on the other hand the size means it's even more important to exclude unnecessary objects from lightmapping or GI contribution entirely
For example baking a city including trying to bake lightmaps for every billboard of grass or for every item placed on shelves in every house
In my case, a lot of meshes are connected so it has to include the entire mesh in the lightmap
Do you have examples?
Can I see this also in lightmap contributors / receivers debug view?
I assume there will be no mixed/realtime lighting if it'll be for VR?
I have it on a day/night cycle, but the shadows don't change. Only the color
So the sun is Mixed
All the foliage is set as lightmapped, those are the sort of meshes that may be the largest contributor to bake time
I want to keep the trees, but the small ones I can probably disable
That seems relevant
Which shadowmask mode?
Mixed lighting allows you not to bake everything necessarily, but is also more expensive to render on average
These are my current settings, it's been a while since I've baked so idk if they've been baked
I've just been going higher and higher starting at around 10 for the resolution
Just seeing how far I can take it
I have indirect lighting disabled for the sun
"Shadowmask" mode and directional lightmaps increase the memory requirements significantly because they're whole extra sets of lightmaps
But whether that's beneficial or not will vary
Because you do have mixed lighting, that means objects like the bushes do not need to be lightmapped to receive shadows
And which probably could be culled by LOD groups
Distance shadowmasking would allow you to reduce the bake resolution a lot because all direct shadows up to shadow distance could be rendered in realtime
But that's more costly to render
So to answer your original question I don't really know and I'm not sure if anyone else can know without actually testing your setup
I'll probably have to try it myself at some point, but that distance shadowmasking seems interesting
Costly for me rendering it or for players?
For players
Because they're rendering everything with realtime shadows and also blending to shadowmasked shadows over distance
Shadowmasked (non-distance) shadows are cheaper because there's no distance blending and no need for realtime shadow rendering of static objects
But in that case your static shadow appearance is limited by your bake resolution which quickly gives diminishing returns when increased
1024 max size is rather low
Especially if you have almost a whopping 800 lightmaps in the end
I'll probably increase it if the iGPU test goes well
Don't want to have it switch to CPU then have to cancel it
If you know you won't be able to optimize the scene to fit in your VRAM even with tiling, then the beefy GPU will not help at all
But the way I see it it appears you have a lot of options for optimizing
As it stands from a lightmapping perspective the scene is very awkwardly set up
This has pretty much been my testing scene for lighting
Everything else I'll make will be about the same size or larger than this
Is there a reason for the shape of this mesh?
That's how it turned out when ripping it
For lightmapping you want to minimize seams over any surface
I've been going through some of the meshes and manually separating them with that pro mesh tool or whatever
But then I get this
Floor and wall surfaces should be continuous so there are no unnecessary seams
But small detail objects should be separate from architectural surfaces, so they can be excluded from lightmapping / GI contribution, and can use LOD groups individually
When the lightmap UV generator struggles and the max lightmap size is low, you get bleeding at seams and inconsistent lightmap resolutions like there
And then it'll be hard to know like how much lightmap space the individual tufts of grass are actually consuming
Having consistent object sizes or adjusting Size in Lightmap for meshes is important for that
Would I just disable Contribute GI or would I set the Scale in Lightmap to 0?
If you want something to cast shadows and reflect light during baking but not take up lightmap space or trace the light rays, set it to receive GI from probes instead
If you don't want shadows from it either disable GI contribution entirely
But that may again be lost if max lightmap size is low
It doesn't determine how much lightmap resolution will be used, but how much is allowed per lightmap atlas
Larger max sizes might use the space less (or sometimes more) efficiently, but shouldn't change how much lightmap atlas you end up with
It's more meant for memory management of the user's device, as some fare better with large textures in memory and some with smaller I guess, not totally sure
I'll probably have to set the max size to 4k if possible