ambient light is just a small value that is added everywhere to compensate for the fact that you can’t calculate all the light reflections in real time. lighting in OF (and in most real time systems) only calculates the direct reflection from a light bouncing off an object and ending up in the camera which would make anything that is not directly hit by a light source completely dark.
you can 't setup a light as ambient light then, every material can specify how it reacts to ambient light, which color it reflects when hit by ambient light, you usually want to set this, using
ofMaterial::setAmbientColor to the same value as the diffuse. and every light adds a bit of ambient light which lights up the whole scene uniformly, again you can set the color of this ambient value per light using
ofLight::setAmbientColor and usually it should be the same color as the diffuse but at a much lower intensity. By default the ambient per light is disabled (set to black)
that way if a light emits red light and a material has white reflection it’ll look red when lighten up by such a light. the diffuse of the light is “mixed” with the diffuse of the material, the ambient with the ambient and the specular with the specular.
the specular is the color a material will show in the specular reflections, most of the times you want to set this the same color as the diffuse in the light and white in the material for non metallic objects and the same as the diffuse for metallic objects
and finally the diffuse is the areas where the light hits the object directly from the light source but at an angle where it no longer creates specular reflections
a spot light is a cone of light, the cutoff set through setSpotlightCutOff allows to define the radius of that cone, and setAttenuation the way the light fades out with distance
area lights allow to define a light that has some area as opposed to a point light which has infinitesimal size. it allows to for example create a fluorescent panel or something similar to a diffuse light if there where shadows such a light would create softer shadows than a point light. and as the comments say it can only be used with the programmable renderer, if you setup opengl version 3 or more when creating the opengl context in main.cpp
there are some parameters that are set when a light changes type that are probably not well reset when going from one type to another we should probably have ofPointLight, ofSpotLight… instead of a generic ofLight and so it’s advisable to not change the type of a light once it’s set but instead create several lights and enable / disable them