I’m having some trouble getting light probes to work. Hoping for some tips.
The game is a grid-based dungeon crawler so I’ve placed probes programmatically into each corner of each grid square and also at their center. I thought this was a clever way to form the light probe “volumes”, but I might be on the wrong track there?
I’ve also turned on “Blend Probes” on all of the enemy Skin Mesh Renderers.
And, I’ve baked the lighting to NOT “Add Direct Light” under Light Probes (also tried turning this setting on, for what it’s worth).
What I’m finding though, is that the enemies are not at all affected when they move past a baked-only light source (the wall torches). It was my interpretation of light probes that this is where the model should appear to be lit by the non-realtime lightsource? Maybe my understanding is just incorrect?
They should never intersect with any geometry. I always put them 0.5 inset from walls/floors/ceilings. You just need to adjust your automatic placement slightly.
They say not to put them in a grid, but I’ve never had any issues doing it.
I’m not understanding the concept of their “volumes” then. I thought by placing one in the center of each grid square at 0.5 height, this was creating triangular volumes - like 6 pyramids inside each grid square.
They are sitting inside the geometry sometimes though due to the pillars in the corners.
I think I know what to do… I’ll just copy what @Stardog did! That forms cube volumes… maybe that’s what it has to be.
And yes, @hippocoder , I did bake them. I’m only slightly stupid - not entirely stupid
These are my new positions per grid square… don’t know if that’s going to be any better. Also, it sure is a lot of probes. I think I asked elsewhere as to the overhead produced by each probe, but didn’t get a response. Should their use be conservative, or can I go nuts?
In my case I just make a whole bunch of them all over the world volume scattered, then eliminate any that overlap colliders or are too close to others - works rather well and is as messy as can be, some sort of weird hippo nonsense.
I actually am a bit tidier than that - I spawn them coming from navmesh edges, but that’s not really relevant to your case.
Why not see if they work with manual placement first so you can experiment to see what the issue is.
edit: you should place one higher up in the middle of each area too so they can form the volume (it can’t work flat) if that’s your problem…
Yeah at first I was just placing them at random heights between 0.0 and 1.0 (floor to ceiling in my game), but I think I was still putting them in the corners from memory. They weren’t working that way either though - i.e. they didn’t seem to have any effect.
Are they told to have effect on your mesh renderers? Also the shaders need to support them… anything derived from surface shader should work. I am not sure about legacy shaders.
I’m using Unity’s Standard shader almost everywhere (is that lazy?). And I definitely have the setting turned on for the monster’s mesh renderers. I’ll bake some levels with these alternate probe placements and see if anything is different.
Still nothing. Using those new numbers I end up with an array shown below (in the side view the purple lines are obscured by the pillars, but they are there).
Should that work?
I’m seeing literally NOTHING on the model passing through the lit area. On the model’s Skinned Mesh Renderer, I have the Light Probes setting set to “Blend Probes”, and I’m baking the scene after laying out the light probes. Is there anything else? A step I’m missing?
They appear to have different intensities of the orange/yellow torch light to them.
None of the meshes that will be affected by light probes are in the scene at the time of the bake. That’s not a problem is it? They’re all instantiated by spawn points at runtime only.
I read something that I now can’t find which led me to believe that in my situation (baked lighting plus realtime lighting) you should turn off this setting.
I love that when you search the Unity manual, there doesn’t seem to be a single reference to that “Add Direct Light” setting. It’s a feature of the software, yet it’s completely undocumented?
I think it might have actually been in a YouTube video where they mentioned that it should be off.
I’ll try again with it ON, but I had done this previously and it never made a difference to anything.
As suggested by Stardog, can you perhaps download this simple scene and let us know if it works for you as expected?
While it’s technically correct to place the probes in a grid-like fashion, you should consider in which parts of your level you want more light interpolation for your game object? For instance, if you want to achieve a more smooth interpolation near the torch lights, you should maybe consider adding more probes around it. Although the project I provide is just a simple scene, I manually tweaked the position of probes to achieve better results while the drone is transitioning from one light source to another.
But first, we should ensure that it works as expected. So, in your case, you should definitely ‘Add direct light’ option in your scene. Next, are you checking if your model has ‘generate lightmap UVs’ option enabled in import settings and most importantly, is it a dynamic object?
Please let us know if the mesh is getting sampled by probes.
If you have small dynamic objects that can be near floors (dropped items for example) this does not cut it since it uses the center of the probe to determine which volume to use). I have them like this
The green probe is used when its close to the floor like this, if i move it up it willl use the red instead far, far away not in shadow because its lower down on the Y axis.
I did finally get this working. Just haven’t taken the time to post back as I’m been struggling with other issues.
I’ll post a screenshot when I can take one, but it did all come down to precise placement for me. Once I got the probes just right for my particular situation (grid-based game, characters moving from center to center), things started working… very nicely actually.
I also changed the code to only place them for grid squares within a certain distance of torches. Works really well.