Why does x_ambient_lt make my scene darker?

Previous topic - Next topic

FutureCow

I would've thought a white ambient light would really light up my scene. Why though do I get the following results? You'll see a screenshot of the same scene from my game - firstly with only an x_ambient_lt 0, rgb(255,255,255) ambient light scource, and then the scene with no lighting at all (ie. no x_ambient_lt or x_spot_lt commands).

Why is my scene with a pure white light ambient light darker than the one without any light source at all?


[attachment deleted by admin]

Moru

If you don't have any light-sources at all, you don't get shading so everything is rendering with the same light-level. If you add light-sources this stops happening. At least that is what I have understood so far :-)

Hemlos

#2
The input value we use for ambient light in x_ambient_lt is not really ambient...it is diffuse.
The real ambient color value in x_ambient_lt is preset to darkgrey...and can not be altered directly(Not sure why).
So this will make your scene with white and grey, depending on the camera angle and the object normals.
Spot lights are additive, but the default ambient grey color is not changed with these.
More vertices helps with lighting too, but keep in mind this reduces performance of the gpu.

I made a function to reset the default ambient grey color in x_ambient_lt:
http://www.glbasic.com/forum/index.php?topic=3849.0

Side note: You can use this function to set emission light too, but i dont recommend this in a loop....it would be faster to use glsl shaders for emissive color addition.
Bing ChatGpt is pretty smart :O

FutureCow

Ahh, that makes more sense now!! Thanks!
(Now I just have to learn about shaders *sigh*)

Hemlos

Not a problem.

About shaders...i have 2 in this link:
http://www.glbasic.com/forum/index.php?topic=3148.0

One is for brightness, the other is for color....the color one can be used instead for brightness too by proportionally increasing the color on all 3 bands...RGB.

Bing ChatGpt is pretty smart :O