1
\$\begingroup\$

I am facing the same problem over and over again with Dynamic Lights in Unity and don't know where next to look. I am still learning Unity so maybe I'm missing something trivial because it happens in the Glasses (Meta Quest App) but also in Editor Game Mode. Exactly the same thing.

The Problem:

Lighting generally works but as I turn my head (XR Camera) around when somewhat close to the light, the light is replaced by a strange square artifact that seems related to the rotation of the head (scene).

Some head rotations make the light correctly render, many others make the light disappear and that strange square appears instead - at the light position.

This happens independently of the "Additional Lights" settings (pixel count ...), EVEN WITH ONLY ONE LIGHT in the scene (this example!)

Unity dynamic lighting artifacts

You can also see it in this YouTube video.

Question Any idea about what can be the cause? I have touched everything and this problem stays.

Scene Details

  • URP for Meta Quest
  • scene 100% runtime generated, no lightmaps or baked lighting
  • No baked Shadows, Realtime Shadows disabled

Lighting / Project settings:

  • Cast Shadows: Off
  • Main Light: Per Pixel
  • Additional Lights: Per Pixel, Per Object Limit: 3
  • Rendering Path: Forward+ (recommended for Meta Quest)
  • Depth Priming Mode: Disabled
  • Depth Texture Mode: After Transparents
  • Post Processing: Disabled
  • Intermediate Texture: Auto
  • Foveated Rendering: 1.0 strngth (doesnt seem related in any case)
asked Jul 18 at 10:38
\$\endgroup\$
4
  • 1
    \$\begingroup\$ Can you show how you've configured this light, particularly its range property? Maybe it's getting culled? Do you have occlusion culling working in your scene? \$\endgroup\$ Commented Jul 18 at 12:07
  • 1
    \$\begingroup\$ The "strange square" is a tiny bit of the structure that is still being illuminated by the light source. Please let us know what version of Unity you're using. You might also try upgrading to the latest version, in case this is an engine bug that's been fixed in a newer version. Is the light source very close to the wall of the structure? What happens if you move the light source a bit? \$\endgroup\$ Commented Jul 18 at 22:59
  • \$\begingroup\$ I found the problem! Turned out to be the Camera Near Plane, that XR sets by default to 0.01 (too small I think). Increasing it to 0.1 makes all the artifacts go away - forever, and 0.1 is enough for XR (hands don't clip unless you put them in your nose). For the record I´m using Unity 6.1 and URP 17.x (also happened to me in Unity 6.0). Thanks a lot for your hints !!! \$\endgroup\$ Commented Jul 19 at 9:48
  • 1
    \$\begingroup\$ Remember to post your solution as an Answer below, so others struggling with a similar issue can find it easily. After a short delay, you'll be able to click the ✅ to mark the answer as Accepted, signalling that you've verified it works. \$\endgroup\$ Commented Jul 19 at 10:50

1 Answer 1

3
\$\begingroup\$

It turned out to be a very small value in the Camera Near Plane (0.01) that I think XR Rig sets by default - or maybe i lowered it time ago.

My guess is rounding issues lead to these artifacts when calculating the culling if the light is inside a structure. (This is just my shot in the dark - I'm sure you experts can have a better explanation)

Increasing camera near plane to 0.1 solves the issue. Tested in many different scenes with random lights and distances and the issue was gone.

An interesting observation - the point where everything goes dark shows this incremental clipping around the problematic rotation... keeping rotating the camera eventually un-clips it from the opposite side.

Lighting Artifacts

answered Jul 19 at 11:54
\$\endgroup\$

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.