Missing ambient lighting options - any solutions?

I’ve been looking for a way to set an ambient light for a scene and so far haven’t been able to find one. Using the material ambient values wouldn’t be very helpful as I want to have objects move between areas that would have different ambient light levels (or rather, different branches of the node tree). Also I don’t want to use the shadow systems, as I think it’d be too much of a performance hit.

I searched the forums and wiki, found a few possible solutions, and added my own, but they all have issues:

  • Using another directional light opposed to the main scene light leaves areas perpendicular to the line darkened.

  • Using the material ambient value isn’t great since it seems to be a multiplier of the diffuse light, and I’d rather it be a seperate colour.

  • Using 6 directional lights arranged top/bottom/left/right/front/back is the closest to the effect I want to achieve, but leaves visible artifacts on surfaces with many polys (sphere in my tests).

  • Writing a custom fragment shader, but I am new to GLSL and don’t know if you can pass variables to them like that, or even if that would be a sensible way to do it.

    I read in one of the topics that the ambient light class was removed some time ago because it worked in a strange way - and the supposed replacement went with jme2. Is there a proper ambient lighting solution in jme3?

You might want to check the nightly/SVN version of jME3, since we just added a new type of light called “AmbientLight” that pretty much does what you want

Ah, thankyou for the info - it seemed strange that such a light didn’t already exist.

I’ll take a look right away! :slight_smile: