Default lighting in Mobile and Compatibility

Godot Version

Godot 4.6

Question

Hi, Ive noticed than the “default” lightning works different in the different renderers. Ill describe my problem because I dont know how to ask this question in more general terms. In Forward+ and mobile, without any light source, when I test my 3d scene it looks like this (the same as in the editor):

It is very gloomy, kind of expected, since the scene doesnt have a light source. The ugly rectangle in an unshaded renderer with a viewport of a 2d scene (relevant next).
When I switch to the compatibility renderer, the light in the editor looks different (understadable, I guess):

Much shinier:


When I play, the picture is quite different:

Pitch black, except for the unshaded 2d scene. When I add a light, I can see again:

(Although the UV maps are really exagerated).

So my question is:

  1. Can I keep the behaviour of a base dim lighting of the other renderers in compatibility? Maybe with a specific light, other than tweaking options until I find something close.
  2. if possible, can I get the same look in the editor and my scene? I get that a pitch black editor wouldnt be really useful, but if theres a “default” light, can it be added to the scene?

Thanks!

You need to add the default sun and environment to your scene.

As for the differences, it makes perfect sense since difference rendering methods have a different set of features available to them.

Thanks! Adding the environment made it look like the mobile and forward renderers, even though my room is fully closed. Do you know if the world environment is supposed to afect a closed room?

It is weird that compatibility requires the environment to be added to the scene, although, as you said, its a different renderer.

light affects all surfaces if ambient light sky contribution is set higher than 0.0. This is not realistic, but can be used to fake ambient scenes like morning or cloudy scenes.
environment should affect all elements of the scene because that’s its purpose, things like tonemapping that changes the color and feel of the scene.

ALL renderers need an environment node for 3D.

There are a number of differences between forward+ and the mobile and compatibility modes, you should read up on them because they can involve things like limiting the number of lights to 8 of fewer. There’s also the compatibility problems that come from a cellphone. phones don’t have good gpus most of the time, and can be missing standard features that all PCs have.

the docs even include a table that compares the features of the three:

I had already looked at that page on the docs, and also another one about lightning. They didnt answer my question.

Do they? Thats where my issue came from. In the mobile renderer, with the preview sun and environment turned off, I could see both in the editor and the debug runs (and also when exporting). See here:

With compatibility, on the other hand, I have to turn the environment to see in the editor, and without an environment node, I wont see 3d stuff when running (debugging or after exporting). The Sprite3D are visible, though (not pictured). Like shown here:

To my (very inexperienced) eye, this behavior seems inconsistent, and cannot find it in the differences listed in the docs (maybe I dont know its name). But at least now I know what to do.

It’s lighting not lightning, btw. You keep repeating the same typo or letting autocorrect do it for you :wink:

you are right lol, look at me talking about thunderbolts

doesnt answer my question, though