Jump to content

Question about Lighting


DKnight

Recommended Posts

Ok, i know very little about Unity lighting in any of the render pipelines.

  O     |          |
 \|/    |  =====>  |
 / \    |          | 
        |          |
 -------|----------|---------
  A         B         C 

  A: the character is running around on Gaia Terrain 
     - Nornal Day/Night Lighting 

  B: the character is transitioning from a Gaia Terrain to a dungion/cave area 
     - the lighting should be gradiating to a black enviroment

  C: the charater is now in a dungeon/cave 
     - the lighting should be black, the character needs a torch to see.

the code block is the user case that I would like to have an example of. A/B/C could be in the same scene, or seperate scenes. Either way will still give me a good idea of how to do this task. And I do beleive this would be very usefull for other coders.

 

DKnight

Link to comment
Share on other sites

I'm not a 100% expert on lighting, but I can share what I know / how I would approach this: Build a small sample scene with a little house / cave for experimentation with the lighting settings first:
image.png

What you will find most likely is that even though you are inside the cave / house, it is still quite bright in there. This is due to the settings for Environment Lighting / Environment Reflection in the Window > Rendering > Lighting dialogue. If you turn those down, you get proper deep black shadows:

image.png

If you have a light source for the "torch" inside the building, that behaves now as expected as well and will light the environment accordingly:

image.png

As you might have noticed, the environment lighting & reflection settings also affect the outside of the building - so you can't find good settings and leave them as they are, as those would be inappropriate for outdoor lighting. You would need to create a system where those values are dimmed when entering a building. I know that all pipelines do have override volumes for post processing at least - meaning that if a player enters one of these volumes, you can override the post processing settings for this area, but I'm not 100% certain if you can override things like the environment lighting as well this way in all pipelines.
If not, you would need to create a script that adjusts those settings e.g. by setting two points, one on the outside, one on the inside, and figuring out if the player is between those two points, then interpolating between the values as the player goes "deeper" inside.
If you & others think that would be interesting, we could do a proper tutorial or maybe a template project on this "Transitioning from outdoor to indoor lighting and back"

  • Like 1
Link to comment
Share on other sites

"What you will find most likely is that even though you are inside the cave / house, it is still quite bright in there. This is due to the settings for Environment Lighting / Environment Reflection in the Window > Rendering > Lighting dialogue. If you turn those down, you get proper deep black shadows:"

This is the important part... and one issue is a lot of unity weather systems take control of these numbers so it can be hard to control them without simply turning the weather off (which will obviously affect the timekeeping in the weather system). You can use volumes to control it to some extent but depending on the pipeline that can be hit and miss and another layer of compromises you need to make.

Link to comment
Share on other sites

On 1/4/2022 at 2:45 AM, DKnight said:

Ok, i know very little about Unity lighting in any of the render pipelines.

  O     |          |
 \|/    |  =====>  |
 / \    |          | 
        |          |
 -------|----------|---------
  A         B         C 

  A: the character is running around on Gaia Terrain 
     - Nornal Day/Night Lighting 

  B: the character is transitioning from a Gaia Terrain to a dungion/cave area 
     - the lighting should be gradiating to a black enviroment

  C: the charater is now in a dungeon/cave 
     - the lighting should be black, the character needs a torch to see.

the code block is the user case that I would like to have an example of. A/B/C could be in the same scene, or seperate scenes. Either way will still give me a good idea of how to do this task. And I do beleive this would be very usefull for other coders.

 

DKnight

not going to go over A, most others have nailed this. 

 

as far as B and C, this is something that is super important, in any scene, game engine or not.. Lighting.. .  when you are entering a building, cave, or what not, lighting changes, and has little to bounce off.   Some of the things Peter is talking about are spot on..  

Any time, you work even in 3d scene say in Maya, we use what is called 3   point lighting and so forth.  So, what you want to do, is make more lighting sources, but make sure they are subtle static lighting to the transition area.    

Also as far as 3 point lighting, in the cave entrance, you may need to turn off things like shadows, and such.  Its more about the subltle lighting is what matters..  This is super important, having other light sources, in that area.

Transitions are what is the most important and setting those light sources around those areas, but make very subtle changes. 

This is Unreal, but does not matter, I use many different engines, this is all about the technique..... for lighting.. Also when I work with scanned data, as an example,  I use a color card, this is something he does here, and I rarely see people doing this and they should be... if its for scanned data anyways.... Lighting is one of the most important aspects to making a scene look realistic and good... you can have a shit model, but if your textures, lighting is great, it will LOOK amazing...  I know this from making textures and working with lighting....    Use this tutorial as a guide, if you don't have scanned data, ignore the color card part, and look at how the lights are set up.   This is for inside the cave, for transitions follow what I said above.. and Peter as well Mentioned .

Peter you sure you don't know about lighting?? haha  you pretty much are on the mark as far as that goes.. 🙂

 

  • Like 1
Link to comment
Share on other sites

  • Tell a friend

    Love Canopy - Procedural Worlds? Tell a friend!
  • Need help?

    We work with some of the biggest brands in global gaming, automotive, technology, and government to create environments, games, simulations, and product launches for desktop, mobile, and VR.

    Our unique expertise and technology enable us to deliver solutions that look and run better at a fraction of the time and cost of a typical project.

    Check out some of our non-NDA work in the Gallery, and then Contact Us to accelerate your next project!

×
×
  • Create New...