Hey I am wondering if its possible to have real time shadows showing on a scene where almost all of the objects are set to (lightmap static) and have the lighting baked into them.
As I mentioned I have a bunch of lights in the seen with the “Baking” setting set to baked so all the walls floor and static objects have baked lightmaps. I have a character in the scene that is not static but I want the shadows to show on the floor and everything else.
I have tried using Light probes which gets the light correctly but it does not apply any shadows to anything in the scene. I have tried both Forward and Deferred rendering paths but still nothing.
I have also tried adding in realtime lights (as well as the already baked lights) to provide shadows coming from the Character. That works BUT it brightens up the rest of the scene so the lighting goes out of wack. I then tried to put it on a separate layer that only the character is on but then the Shadows don’nt show on anything.
Surely there is a way to get realtime shadows on a baked scene?
Any help would be awesome!
He’s not asking for mixed lights exactly. He’s asking for lights that only add a bit of realtime shadow to the character and do not contribute to light at all otherwise.
It can be done with a bit of tinkering in Unity 4 for mobile. Not sure how/if it can be done in 5 without too much fuss.
I was wondering this. So if you bake your static scene and want a few real time shadows, it cant be done? What is mixed lighting supposed to do? (it it worked?)
Eh? Its my understanding of mixed lights that it will do exactly as he wants. You would just delete the light probes. Set the lights to mixed which will bake for the static objects but light the dynamic objects as a realtime light including casting shadows on the baked stuff. Am I missing something here?
A couple of options:
A) setting the shadow-casting-realtime-light lightcolor to be very low(near black)
B) setting the shadow-casting-realtime-light light strength to be very low(near 0)
C) use “unlit” shader for other objects that supposedly not affected by light
Yeah unfortunately I have tried the latest Beta Unity 5.4.b10 and the mixed mode still doesn’t work. Tried it both with and without probes in there. Unless I am somehow I am doing it wrong.
Yeah that’s what I want, and what I assume would happen but it doesn’t. In the editor it looks like it works initially as it shows shadows (for both dynamic and static) objects and lighting correctly initially. But once you bake it the dynamic shadows disappear forever!
Just an update, the latest Beta 5.4.0b13 has some of this fixed.
Directional lights now work in mixed mode. So non static objects can cast realtime shadows on static objects whilst the static object can still have back shadows on it.
However this doesn’t work for spotlights or point lights (which doesn’t help me much) but at least its a start.
Very interesting. I give b13 then a try. We’re experiencing some major bugs currently with realtime shadows and static lightmaps. Not sure if they are related to mixed mode though.
@Harrison_Hough Where do you see it was fixed? It does not work in the latest beta. I had a look. You get both a dynamic shadow, and a baked shadow from a mixed light, but they do not blend properly(which is sort of the point of the whole thing). The realtime shadow is too dark. You can kind of adjust it by reducing intensity of shadow, but it will not work when you have a normal variation of light and shadow.
I’m sure unity would have a celebration and invite us all when mixed light mode is fixed! At least I hope they will tell us when they have something we can test
Sorry I shouldn’t have said “fixed” but I was able to use a realtime directional light (in addition to my baked spotlights) to get realtime shadows of the character into the scene with baked lighting. It is far from perfect however, the realtime shadows don’t always show correctly from different camera angles (weird I know). Also another problem with this option is that the directional light does add light to the rest of the scene so I had to turn the intensity down a bit.
But this seems to be the only way I could get the realtime shadows with the baked lighting setup.
This is actually both in 5.4.0b13 and 5.3.3f1.
And yes it doesn’t blend properly but the shadows are there
I’m having issues trying to do a similar thing I think.
I have a realtime directional light (the sun) which moves throughout the duration of the level to create a day night cycle.
However I’d like my streets to have street lamps that come on when it gets dark.
I’m using 5.3.4 f1
I thought I could do this at run time by switching in the nighttime baked lightmaps.
However realtime shadows only cast on the terrain where the baked light is on the lightmap.
With all realtime lights, this is the sort effect I want to achieve.
Realtime Directional & Points:
However if I change the point lights to baked and enabled baked GI
Set my realtime sun light to mixed
Point lights intensify, which i can work around but they work along with light probes for the dynamic characters.
However, the realtime GI & sun light doesn’t appear to affect the terrain, it’s baked bright.