Man, i have to admit i’m really bad with APV -.-"
So, i’m tried APV on URP with my main project on Unity 6 (just testing to see if i can update it to Unity 6), but it sks, is not baking shadows, i already did what the documentation says, i tried some settings from some posts, also some youtube videos. everything is on “Light probes” APV is active on “project settings > blablabla > Light probe lighting” Even with Min probe spacing at .01 and at 0.9 i get this:
So, you want shadows cast by the directional light, from the tree, onto the ground plane?
Setting a light to mixed means to bake direct contribution into probes. How shadows are handled depends on your chosen Mixed Lighting Mode.
If you are using baked indirect mode, you’ll never get baked shadows - static objects will only cast realtime shadows.
If you are using shadowmask or subtractive mode, you will get baked shadows. In shadowmask mode you only see the baked shadows by default after a certain cutoff distance, otherwise the shadows are realtime. This is known as distance shadowmask mode.
In other words, if you want shadows baked into probes, use subtractive or shadowmask mode. If you only want realtime shadows, use baked indirect. Other than that, make sure the tree and plane are marked as static, and that both the light and tree have shadows enabled. If you’ve done all that and it still isn’t working, let me know.
As for that bug you show - haven’t seen that before. Feel free to submit a bug report. Looks like it could be an issue with streaming (are you using disk/gpu streaming?)
I also tried with the directional light mode at Baked, I also tried Shadowmask and Subtractive and i got the same results, also, the tree and the plane are marked as static.
The camera is very close, that’s not a tree, it is a bush, for reference here is an image with a placeholder for cars
Advance pro giga chad user right there… thanks @sacb0y …
now, i have this pretty ugly dithering noise, any chance you know why? or how to get rid of it?
Just a quick question, is there a way to change all my objects to recieve GI from lightmaps to light probes at the same time? because, you know, i have lots and lots of objects in the scene, all prefabs are “lightmaps” but the objects in the scene are “light probes” and now, i want to going back to “Lighmaps”
Is there a way to do it for lots ob objects at the same time?
I didn’t wait and i asked Chatgpt to make me an script for that, it appear on the top menu, on Tools, there are two options: Set GI to Light Probes and Set GI to Lightmaps.
If you need it (edited for unity 6):
using UnityEngine;
using UnityEditor;
public class SetLightmapGI : EditorWindow
{
[MenuItem("Tools/Set GI to Lightmaps")]
public static void SetGILightmap()
{
// Get all the objects in the scene
GameObject[] allObjects = FindObjectsOfType<GameObject>();
foreach (GameObject obj in allObjects)
{
Renderer renderer = obj.GetComponent<Renderer>();
if (renderer != null && renderer.gameObject.activeInHierarchy)
{
// Set "Receive Global Illumination" to Lightmaps (1 in Unity 6)
SerializedObject so = new SerializedObject(renderer);
SerializedProperty receiveGI = so.FindProperty("m_ReceiveGI");
if (receiveGI != null)
{
receiveGI.intValue = 1; // 1 corresponds to receiving GI from Lightmaps
so.ApplyModifiedProperties();
}
// Ensure the object is marked as Static for GI contribution
StaticEditorFlags currentFlags = GameObjectUtility.GetStaticEditorFlags(obj);
currentFlags |= StaticEditorFlags.ContributeGI; // Keep Contribute GI checked
GameObjectUtility.SetStaticEditorFlags(obj, currentFlags);
}
}
Debug.Log("All objects set to receive GI from Lightmaps.");
}
[MenuItem("Tools/Set GI to Light Probes")]
public static void SetGILightProbes()
{
// Get all the objects in the scene
GameObject[] allObjects = FindObjectsOfType<GameObject>();
foreach (GameObject obj in allObjects)
{
Renderer renderer = obj.GetComponent<Renderer>();
if (renderer != null && renderer.gameObject.activeInHierarchy)
{
// Set "Receive Global Illumination" to Light Probes (2 in Unity 6)
SerializedObject so = new SerializedObject(renderer);
SerializedProperty receiveGI = so.FindProperty("m_ReceiveGI");
if (receiveGI != null)
{
receiveGI.intValue = 2; // 2 corresponds to receiving GI from Light Probes
so.ApplyModifiedProperties();
}
// Ensure the Contribute GI checkbox is still checked
StaticEditorFlags currentFlags = GameObjectUtility.GetStaticEditorFlags(obj);
currentFlags |= StaticEditorFlags.ContributeGI; // Keep Contribute GI checked
GameObjectUtility.SetStaticEditorFlags(obj, currentFlags);
}
}
Debug.Log("All objects set to receive GI from Light Probes, with Contribute GI intact.");
}
}
Sorry i don’t understand… Are you talking about the script i shared? The only options i have on Unity 6 on that drop down menu are: Bake Probe Volumes, Bake Reflection Probes and Clear Baked Data (which i just selected by error -.-" XD)
I was talking about this drop down menu on every asset
i have this pretty ugly dithering noise, any chance you know why? or how to get rid of it?
The dithering noise is to make the transitions between neighboring bricks with different values less harsh. You can adjust it or remove it using a volume with some overrides.
Keep in mind that baking direct occlusion into probes (ie. using subtractive or non-distance shadowmask mode) will always look a bit blocky, since direct occlusion is a high frequency signal, but is being quantized to the probe grid. You can see what I mean by using the “Probe Occlusion” debug mode in the rendering debugger:
I don’t know if you remember a previous posts when i was trying APV on 2023 (i think) you said that i can use a mixed between lightmaps and APV, well, that’s what i’m doing now and yes i need not exactly perfect shadows because is not a realistic style, is more like toys, but the ones with APV are pretty blocky and ugly imo XD… I tried the “Sampling noise” thanks, i didn’t know about that, but is still bad:
This is Min probes spacing at 0.1, Lightmaps size: 1024 and resolution: 40
The only way that i can get rid of those blocks is if i increase to almost max that “Sampling Noise” property but is too much noise and not even Blurred Antialiassing (TAA) at maximun can work with it haha, so that’s the best i can get with APV
I can use an higher angle on “baked shadows angle” on the light properties, but it then lacks details and the shadows from buildings looks really bad.
So, is there a case where backing shadows with APV is good? as you can see i’m pretty noob with APV i’m probably missing something or maybe APV is not useful for shadows… ? Thanks in advance.
So, is there a case where backing shadows with APV is good? as you can see i’m pretty noob with APV i’m probably missing something or maybe APV is not useful for shadows…
Baked shadows with APV don’t look great up-close. Initially the system didn’t support them at all, but I implemented it since it’s better than the alternative - no shadows at all! Subtractive and Shadowmask mode mean to bake shadows from mixed lights either into probes or lightmaps. Before APV supported this, these shadows would simply be missing and affected objects would be fully unshadowed.
Personally I would only recommend using baked shadows in APV with distance shadowmask mode. This was the primary intention: Close to the camera, you use crisp realtime shadows. Far from the camera, you use the more blocky shadows from APV. But since the affected objects are far from the camera, it doesn’t matter so much that the shadows are blocky.
If you can’t afford realtime shadows, your options are to either accept the inherent blocky-ness or to use lightmaps. Depending on the style of your game, you may also be able to mitigate the blocky-ness a bit with vertex sampling. That should smooth out the shadows a bit but in turn also lower their fidelity. Same goes for baked shadow angle as you have noted.
The reason I write “inherent” blocky-ness is because this is a consequence of quantizing direct occlusion to a sparse grid, you will get this kind of aliasing. Direct occlusion is a high frequency signal (it varies a lot spatially). It’s kind of like trying to get crisp baked shadows on a lightmap with super low resolution.