Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question [Resolved] Lighting using prefab lights procedurally

Discussion in 'High Definition Render Pipeline' started by arnull, Sep 5, 2022.

  1. arnull

    arnull

    Joined:
    Jun 8, 2019
    Posts:
    5
    Hi,

    I raised this in HDRP thread, but have realised this may be something to do with the lighting / the prefab lights being instantiated.

    I am new to unity HDRP. However, I have done projects in Unity before just not using the HDRP.

    I have encountered an issue upon rendering / playing a procedural level.

    The below image is how the game looks upon pressing play.


    Like below you can see in the wall liners but not the floor, walls or ceiling textures.
    But when you move about 50 paces in any direction, it then renders correctly.


    If you pace 2 or 3 steps either side it will flip between being rendered as image one and then being rendered as image two in almost a circle from X = 0 and Z = 0.

    I am not sure what I am missing here and have a Global Light active, a Global Volume and lights placed procedurally throughout the level.

    Any help would be appreciated and apologies if this is a rookie mistake, still learning HDRP.

    I can post images of the GL / GV and the lights themselves if needed. Or any texture I am using.

    Thank you!

    Edit* I have completed some further testing and it seems like the issue could have something to do with the amount of prefab lights being added to a scene.

    The way I have the map generated is with an X and Z value. If I set this to a 15 x 16 box it will render okay. However, if I increase this to the range that is required for the project to something like 75 x 76, it will not light the scene in play mode. Yet it renders fine in the scene view.

    Any thoughts / ideas appreciated :).
     

    Attached Files:

    Last edited: Sep 9, 2022
  2. arnull

    arnull

    Joined:
    Jun 8, 2019
    Posts:
    5
    Just an update to give a better example of what is happening.

    upload_2022-9-9_18-4-28.png

    As you can see, the editor is rendering as expected but the camera is not showing the intended outcome. The above shows the game view as well as the editor as well as the camera view within the editor.

    Thankfully, I am still able to progress with the game for the moment (other additions and such), but would like to get this sorted as soon as I can.

    I have tried changing all lighing, rendering and camera settings but to no success. I do have per layer culling enabled on the camera (to increase performance) but this is based on distance from the player so should render correctly in the space around the camera / player.

    *edit* If I set the size to 17 by 18 it will not render for each corner square but will render fine for the rest of the map. Is there a render radius / lighting / material option to extend what is rendered properly? All prefabs seem to have been rendered properly just not the quads used for the maze in those corners.
     
    Last edited: Sep 10, 2022
  3. arnull

    arnull

    Joined:
    Jun 8, 2019
    Posts:
    5
    [Resolved] will update this in the title.

    This was resolved by making some tweaks to occlusion and making some changes to a per layer culling script. This was set to spherical culling which I believe was positioned at the 0,0,0 coords. Changing this to the player itself or disabling it resolved this.

    Really racked my brain, just had to try every button!
    upload_2022-9-11_19-5-33.png
     
    Last edited: Sep 12, 2022