Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Scene in complete darkness in Unity

Tags:

unity3d

I want to create a scene in complete Darkeness, which will be iluminated just by the lightnings of a storm. But I am already failing in the first step, I am not able to make the scene completely in darkness, even if I remove all lights in the scene and set background of the camera as black, I still get this:

enter image description here

And Hier my Hierarchy where you can see there are no lights:

enter image description here

What am I missing?

like image 520
Fobos Avatar asked Dec 19 '22 04:12

Fobos


1 Answers

You can try to set the ambient light to black, so it will be all in darkness. You can do this programatically with this line:

RenderSettings.ambientLight = Color.black;

And also, to switch off any light you may have in your scene (just in case)

Light[] ligths = FindObjectsOfType(typeof(Light)) as Light[];
    foreach (Light ligth in ligths) {
        ligth.enabled = false;
}

Take care also of the follwing three things, which may be adding some light into the scene.

  • Turn off or delete any light maps.
  • Ensure shaders are not using self-illuminating or particle shaders.
  • Ensure that "use scene lighting" is turned on in the scene view.

However I think in your case with the ambient light set to Black will be enough. Your scene seems quite simple.

like image 200
Ignacio Alorre Avatar answered Jun 16 '23 16:06

Ignacio Alorre