#Baking Lighting: iGPU + 128 GB RAM or dedicated GPU + 16 GB VRAM?

1 messages · Page 1 of 1 (latest)

rigid oracle
#

I've been baking lighting with my dedicated GPU, but I pretty much have to leave my computer for the next few hours after I start baking since I do everything with that GPU. Should I use my integrated GPU with access to more RAM or is it still better to use the dedicated GPU?

faint swan
#

Dedicated GPU is practically always the fastest option

#

Light baking is not really RAM dependent

rigid oracle
#

There's been a few times where I've run out of VRAM and it switches to CPU baking

faint swan
#

With what editor version?

rigid oracle
#

2021.3.38f1

#

Making mods for Blade & Sorcery, so we're stuck with that version for now

faint swan
#

I see, was about to say that each major release has improved how the lightmapper can rotate memory

rigid oracle
#

So things are better in Unity 6?

faint swan
#

Probably but I recall 2021.3. is supposed to have many of the relevant improvements already

#

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

rigid oracle
#

It is really flipping big

faint swan
# rigid oracle 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

rigid oracle
#

In my case, a lot of meshes are connected so it has to include the entire mesh in the lightmap

faint swan
#

Do you have examples?

rigid oracle
#

I might as well bring it up

#

This is one mesh

faint swan
# rigid oracle

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?

rigid oracle
#

I have it on a day/night cycle, but the shadows don't change. Only the color

#

So the sun is Mixed

faint swan
# rigid oracle

All the foliage is set as lightmapped, those are the sort of meshes that may be the largest contributor to bake time

rigid oracle
#

I want to keep the trees, but the small ones I can probably disable

faint swan
# rigid oracle So the sun is Mixed

That seems relevant
Which shadowmask mode?
Mixed lighting allows you not to bake everything necessarily, but is also more expensive to render on average

rigid oracle
#

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

faint swan
#

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

rigid oracle
#

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?

faint swan
#

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

rigid oracle
#

Speaking of the resolution

#

Good ol' max atlas sizes

faint swan
#

1024 max size is rather low

#

Especially if you have almost a whopping 800 lightmaps in the end

rigid oracle
#

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

faint swan
#

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

rigid oracle
#

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

faint swan
rigid oracle
#

That's how it turned out when ripping it

faint swan
#

For lightmapping you want to minimize seams over any surface

rigid oracle
#

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

faint swan
#

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

rigid oracle
#

Would I just disable Contribute GI or would I set the Scale in Lightmap to 0?

faint swan
#

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

faint swan
# faint swan Having consistent object sizes or adjusting Size in Lightmap for meshes is impor...

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

rigid oracle
#

I'll probably have to set the max size to 4k if possible