Search Unity

Problem with Spot Lights on Terrain

Discussion in 'Global Illumination' started by QuindecimX, Apr 20, 2022.

  1. QuindecimX

    QuindecimX

    Joined:
    Jul 12, 2017
    Posts:
    22
    I'm doing small projects messing around with lights and learning how to use each kind of light effectively.
    I have an imported model I'm using as the terrain for my character to walk on. Then I set up a few spotlights to shine on certain parts of the terrain. However, I don't see any lights.

    I thought the spot lights weren't working at all, but then I noticed that when the spotlight's shining on my player character, the light works. But only on the character. The terrain right below the player has no light on it, as if it's some bizarre effect going on. Even when I increase the spot angle/range settings (to make the light wider), it changes nothing. Only the player receives the light, but the terrain model does not.

    I also tried the other types of Unity lights like the point, etc. but it led to the same problem. Oddly enough, when I use directional light, it "works" in the sense that it provides white-colored light to light up the whole scene. But if I change the color to anything but white, only my character changes in color, whereas the terrain stays lit in white light.

    How do I fix this?
     
  2. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    1,366
    If the spot light is baked, you might have too low lightmap resolution for the terrain to make the light show up. A screenshot of the light inspector and the terrain inspector will make it easier to reason about.
     
  3. QuindecimX

    QuindecimX

    Joined:
    Jul 12, 2017
    Posts:
    22
    Here's a screenshot of the light properties. I changed the Mode settings to realtime, mixed, and baked. Yet none of those settings work.
    upload_2022-4-22_11-13-24.png

    As for my imported model I'm using as the terrain, here's the settings I have for it from the inspector:
    upload_2022-4-22_11-52-51.png
     
  4. Giantbean

    Giantbean

    Joined:
    Dec 13, 2012
    Posts:
    144
    Did you ever work this out? I have a light that works fine on local terrain but when I network it it will hit mesh objects but not the terrain.
     
  5. _creatio_

    _creatio_

    Joined:
    Mar 21, 2013
    Posts:
    43
    I had the same issue on Unity 2022.2.4f1 HDRP with point light under the water. The only way I found to make it visible, is to put huge values for the intensity. Otherwise there's no noticeable effect at all.

    Maybe I'm missing something, but I tried checking all possible settings and a couple tutorials.
     
    Last edited: Mar 19, 2023
  6. dracauz

    dracauz

    Joined:
    Apr 24, 2023
    Posts:
    1
    I have a similar issue, i have a spot light and it's only visible on the trees of the terrain, not on the terrain itself
     
  7. SteenPetersen

    SteenPetersen

    Joined:
    Mar 13, 2016
    Posts:
    104
    I am having a similar issue, directional light works fine, but point and spot lights arent workin on my errain, grass and tress and player are hit by the lights but not the terrain. I am using microsplat, not sure if this could be a variable others are seeing?

    EDIT: Solved this, turns out its a URP setting, I went into URP settings -> Lighting -> Additional Lights and set that to 'Per Pixel' and it fixed it.

    I found the answer on this thread (Resolved - Pointlight and Spotlight stopped working in my project ! (URP) - Unity Forum)

     
    Last edited: May 15, 2023
    Giantbean likes this.