Ambient Lighting, normals, and particles

Hi all,

I have a bunch of particles that I added normals to by making my own Emitter and TriMesh (basically just copies of the existing ones with some added features I require).

I’ve been doing some tests with lighting lately and am finding that ambient lighting is not working as I thought it does… it seems to be affected by my normals?

Here is a screen shot with only ambient lighting, normals pointing upwards (it’s just a cylinder that is lit correctly by ambient, with the particles on the side of it)

And here is the same scene shot from below

It has been my understanding that any ambient lighting color is merely added on top of all other lighting calculations, regardless of normals, positioning, distance, etc. Is this assumption not correct?

I’m at a bit of a loss as to why this is happening

Edit: I’ve noticed in the Lighting.frag shader, in this line (204 in mine)


gl_FragColor = AmbientSum * diffuseColor +

DiffuseSum * diffuseColor * light.x +

SpecularSum2 * specularColor * light.y;


If light.y is hardcoded to 1, everything works just fine. However setting my particle material to have the following does not change anything:

[java]mat.setColor(“Specular”, ColorRGBA.BlackNoAlpha.clone());[/java]