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

Problem with realtime lighting

Discussion in 'Global Illumination' started by Roldo, Jun 23, 2019.

  1. Roldo

    Roldo

    Joined:
    Oct 25, 2014
    Posts:
    41
    In the game i am making the map(a big maze) is generated at runtime. Thus the lighting is mostly realtime(apart from a few large structures). The issue i have is that the light shines through the walls(and you dont want that in a maze). Raycasting from every light on the map to the camera is not an option as it can harm performance. All of the walls in the map have cast shadows option on. Walls are made from multiple models (walls, pillars, etc.). Can i solve the issue with shaders? I am a noob when it comes to shaders(and lighting) so sorry if its an obvious solution. Can i do anything else to solve the issue?

    P.S. sorry for my English, its not my native language)
     
  2. TheGabmeister

    TheGabmeister

    Joined:
    Jun 4, 2015
    Posts:
    10
    Is the game first-person or third-person view? I think if the game is in first-person, then you can optimize and deactivate sections of the maze that are not visible.
     
  3. Roldo

    Roldo

    Joined:
    Oct 25, 2014
    Posts:
    41
    It is first- person. How would you suggest going about disabling parts of the maze? Raycasting from every object to camera? Or something else?
     
  4. kristijonas_unity

    kristijonas_unity

    Unity Technologies

    Joined:
    Feb 8, 2018
    Posts:
    1,080
  5. markjanzen88

    markjanzen88

    Joined:
    May 31, 2017
    Posts:
    68
    you have to change the wall gameobject shadows from on to double sided and it should fix your issue