#Why more Shadow when more light sources?

44 messages · Page 1 of 1 (latest)

neon hawk
#

When only one Light source is active, the parts that are not black are not shadowed. but when two light sources are active, parts show shadow which did not, when just one light source is active.

am i wrong here in any way? why is that? how can i fix it?
And another thing: a wall that is not directly hit by the light is completely black. in reality the room is lighten and the not-from-the-light-hitten wall is still not completely dark. How to fix that?

tiny kiln
#

light sources are additive, so places affected by two light sources will be brighter than places affected by only one light source, in the shadow of the other

#

also about ambient lighting, by default godot uses the environment background (like the sky) as ambient lighting for the entire world, but if you don't have a background set up in the environment, or it's a dark background, or you've disabled ambient lighting in the environment properties, shaded areas become very dark like in your screenshot
(edit: environment like one provided by a World environment node)

#

if you don't want to use the background as an ambient light source, you can also use a custom ambient light color in the environment, and if you don't want to use ambient lighting at all, there are other ways to light things indirectly in a more realistic fashion, see this page about global illumination techniques and all their trade-offs
https://docs.godotengine.org/en/stable/tutorials/3d/global_illumination/introduction_to_global_illumination.html

neon hawk
#

hmm, so, when i use background color and ambient light color in the worldenvironment node as black, i cant have really dark places, except i do some negative lights, right?

"mix" instead of "add" multiple light sources is also not possible in a 3d environment?

#

i dont get where to let the objects reflect the light

tiny kiln
#

mix lighting is not possible in godot afaik because of the forward shading approach where each light is processed in a loop after the previous light results are applied

#

additive lighting is realistic anyway

#

"objects reflecting light" is a complex topic that's solved in different levels of quality with different drawbacks, the article I posted lists every form of indirect lighting that godot supports

#

for example if your lights don't need to move or be toggled during gameplay, you could use LightmapGI to bake lighting

neon hawk
#

ok btu where does i set this up?

tiny kiln
#

LightmapGI is a node, but before you can bake lighting you need some extra setup (changing the GI mode of lights that you want to bake to static, ensuring meshes have UV2s or generating them in godot)
https://docs.godotengine.org/en/stable/tutorials/3d/global_illumination/using_lightmap_gi.html

#

other methods are also covered in the first article, and other articles under the parent "Global Illumination" category

neon hawk
#

works good, but i face another problem. light shines through walls. how can i avoid/stop this?

tiny kiln
#

is that with LightmapGI?

#

it only sees meshes with GI mode set to static and a valid UV2

#

if the wall is missing either of those things it will be ignored during baking

#

and you need to bake LightmapGI again after making changes to the scene to update it

neon hawk
#

no i deleted the LightmapGI Node and it still happens

tiny kiln
#

with dynamic lighting (no LightmapGI) you need to enable shadows on each light that should have shadows

neon hawk
#

shadow is enabled

tiny kiln
#

is the last screenshot with or without LightmapGI? it looks quite weird if it's without

#

even with, I have no idea what's causing the "stepped" shadows on the left

neon hawk
#

the node was set so not visible when i made the screenshot

tiny kiln
#

what are all the lighting, reflection, and environment nodes you are using?

neon hawk
#

this are the only 2 light sources in the scene. they are OmniLight3D, shadow enabled.
My worldenvironment has SSO enabled and SDFGI anabled

tiny kiln
#

what about SDFGI disabled?

#

SDFGI is known to cause light leaks (lighting passing through thin objects)

#

still can't see why the omni light doesn't seem to be casting any kind of shadows

#

the scene still looks like it's using some sort of LightmapGI, for some reason

#

could try deleting the LightmapGI node (and the .lmbake and .exr files) if you don't want to use it

neon hawk
#

nearly the same result with disabled SDFGI

#

lightmapGI node is already deleted

tiny kiln
#

oh yeah did you enable "vertex shading" anywhere in the project? that does not support shadows, apparently

#

even though at the start, you clearly had shadows, did you change some project settings or modify materials in the meantime?

#

or if you changed the rendering method of the project, I found a comment on github that says the engine uses a workaround for shadows with vertex lighting in compatibility, but not on mobile and forward+ (which do not support shadows when using vertex lighting)

neon hawk
#

ah it is the shadows opacity and bias settings that causes this

#

it still goues through the wall, but shadow is black again

#

SDFGI makes the white wall appear greenish instead of black. thats good

tiny kiln
#

the lighting still looks very strange, I don't know why

#

like the hard cutoff on the left

#

and the blocky shadows near the stalls