Hey guys, I’m really stuck here. In Unity 6.0.21 I did the following:
- Created a blank URP project using the URP Core template
- Added the Entities.Graphics package (default is 1.2.4) and restarted Unity.
- Disabled the Global Volume
- Added a subscene with a cube and two capsules.
- Assigned URP Simple Lit materials to all three objects - just simple 1024 textures.
- Built for release via File/Build Profiles/Windows/Run
The Scene View and Game View look just fine and play-mode behaves as expected. But the release build is all messed up. It looks like the only thing visible is specular lighting - all ambient light is gone making everything very black.
If I take the cube and capsules out of the subscene and build, everything works as expected. I was building for Windows under Windows 10 using the default URP 17. I tried Unity 6.0.20 and 6.0.21 and also Entities.Graphics 1.2.4 and 1.3.2 but none of those combinations helped. I also tried messing around with the lighting settings - global, realtime, etc, but never got anything but black. Once I tried IL2CPP but that just started spitting out a bunch of errors when I tried to build. I tried putting the directional light in the subscene. When I built the same scene for release using a new project with Unity 2022.3.39 (URP 14) everything in the subscene worked as expected. So this tells me that it has something to do with Unity 6.
One thing I noticed is that whenever I build, I get this warning (I don’t know if it is related): “Shader warning in ‘Hidden/Universal Render Pipeline/ScreenSpaceAmbientOcclusion’: implicit truncation of vector type at Packages/com.unity.render-pipelines.universal/Shaders/Utils/ScreenSpaceAmbientOcclusion.shader(167) (on d3d11)”
I talked with a couple of guys on Discord who are using Unity 6 and they haven’t noticed the problem.
So my question is - is there something fancy that Unity 6 requires to make ambient light work in subscenes? Do I need to configure subscene lighting settings differently? Maybe there is special way to build releases when using subscenes?