#I'm trying to bake this spot light but after baking (2nd screenshot), those shadows don't appear.

1 messages · Page 1 of 1 (latest)

lethal mica
reef parcel
#

Share the setting of your light bake and spotlight

lethal mica
#

These walls and blue box should cast shadow on the ground but they cast only on realtime lights.

#

Actually Terrain is also Static but no shadows on Terrain

reef parcel
#

I don't see any light on the terrain, so that's good then right?

hollow lagoon
#

Terrain's relative lightmap resolution may be too small to capture shadows of the objects

#

Lightmap space is ultimately limited, and the way it normally works is that the lightmap resolution must be shared across the entire terrain

lethal mica
hollow lagoon
#

Lightmap resolution of 80 should be well enough to capture the detail

#

But your max lightmap size of 1024 clamps it particularly for the terrain

lethal mica
#

These are current settings

hollow lagoon
#

Which would probably require a 16k lightmap texture with 80 resolution

#

Just so it can receive the shadows of those couple of meshes

#

Which is terribly inefficient

lethal mica
hollow lagoon
#

It'd affect build size, load times and memory consumption, not rendering performance

lethal mica
#

OK. So what should be ideal approach?

#

Mixed lights?

hollow lagoon
#

If there will not be other baked light sources illuminating the terrain, I'd rather place a plane mesh on the ground to receive baked shadows in the terrain's stead

#

Mixed lighting would give you the best results without need for any workarounds like that, but mixed is more expensive than realtime

lethal mica
lethal mica
hollow lagoon
hollow lagoon
#

But Terrains can't be split like that as they're totally generated by the component
Maybe Neighbour Terrains can have different sizes in lightmap, but not sure, and you can't easily convert an existing Terrain into multiple Neighbours

lethal mica
#

Got it. But I am not sure I should do this approach (separate plane) for what I'm trying to achieve. I wonder how open world games like GTA 5 or even Counter Strike 2 does it for outdoor scenes. We easily see shadows casted by sun on the ground right? And they don't even use ray tracing. I wonder if that's baked or realtime.

Maybe I should bake only indoor lights or the lights that cover very small area (like street lights) and not baked Directional Light?

#

Right now I've baked all lights.

#

Including directional.

hollow lagoon
#

Which lights you bake isn't really important, but which meshes need lightmaps for receiving baked lighting

lethal mica
#

Yeah. So I guess I can fix indoor lights in my scene (the area around the walls) by using a separate plane. But how about outdoor scenes? I want to see shadows of static objects and moving objects in the open, during day time. Like shadows created by sun light.

#

I guess that's not possible/ideal with baking directional light.

hollow lagoon
#

Can't get any baked shadows from moving objects

lethal mica
#

Maybe realtime directinal light would be better for that. I'm not sure.

lethal mica
#

So what do you suggest? I should use realtime lights for outdoor?

hollow lagoon
#

Depends what kind of lighting you need

lethal mica
#

Wait

hollow lagoon
#

In the images I see the terrain as being in total darkness which probably isn't indicative of what you want?

lethal mica
#

From GTA

#

See the shadow of cars, streetlights, NPCs and even if some plane is flying in air, it casts shadow on ground.

hollow lagoon
#

GTA has dynamic day and night cycle, do you need that also?

lethal mica
#

And all shadows move with moving objects

lethal mica
#

Smooth transition from day and night like most games.

hollow lagoon
#

(try "few" rather than "most")

lethal mica
#

Yeah maybe

#

CS2 doesn't have I think

#

It has static so it could be baked.

#

So my original idea of CS2 like lights is wrong. Instead I want lights like GTA

#

Or maybe Far Cry 3

#

That also has dynamic day and night IIRC

#

ANDDDDD

#

Euro Truck Simulator 2 is perfect example

hollow lagoon
#

If you don't need accurate global illumination, meaning soft indirect bounce lighting that can be seen in the reference, then you could get by with just a realtime directional light and updating one light probe for global ambient lighting
But if you do (and to make that easier) you'd likely want to be using Realtime Global Illumination rather than realtime lighting alone

#

Nothing that needs to respond to change can be baked into lightmaps

lethal mica
#

I vaguely remember URP doesn't support realtime GI but only realtime lights. I think I read it in the tutorials.

#

But for now yeah I don't need very accurate results.

#

It's just learning experience.

#

Maybe I'll learn more in Prototyping tutorial.

hollow lagoon
#

Realtime GI support is dropping in the future, maybe even as soon as the newer unity 6 versions
But not 6.0 yet I believe, which is the one you should be using anyway

lethal mica
#

Yes I'm using 6.0 currently as tutorials are based on that.

lethal mica
hollow lagoon
#

No

lethal mica
#

OK

hollow lagoon
#

Realtime GI is also a baked ("precomputed") lightmap system

lethal mica
#

Good

hollow lagoon
#

So you have most if not all the same challenges with lightmap space as you would with baked lights

#

Rather than storing where light bounces during baking, it stores where it could bounce if a realtime light source was near, in some clever way