I copied your class and tested first applying the lightcontrol, but don’t move it around. Then setting the light position without using a LightControl (ie just matching translation of the node and position of light). Here they are at red: 10, 2, 10 and green: 20, 2, 20, and blue: 30, 2, 30.
@ndebruyn can you try with different JME versions (e.g. 3.3, 3.4, 3.5, 3.6) and see if it happens in all versions? Finding the version that regression happened might be of great help to detect the issue.
Thanks for checking.
Yes, let me take some time and check in which version it started.
I do however remember from long ago, like jME 3.3 or 3.2 that it happend.
But that might have been something else.
Let me check.
Could the issue be this: vec3 viewDir = normalize(-wvPosition);
viewdir is defined in the vertex shader, so it would be affected by the vertex position? Edit: Wrong explanation, but you know what I mean. It introduces an error due to interpolation.
Ref different scales on the board changes apparent error:
I think PBR does things in world space instead of view space and thus avoids a bunch of interpolation issues. Also the nature of PBR means that it will calculate some things per fragment that lighting tries to do per vertex.
This is without looking at the code again and only going from memory and remembering long-ago discussions. (I always wished Lighting.j3md had been done in world space also because then I wouldn’t have needed to write my own for trilinear mapping and stuff.)
I have a side question relating to pointlights and spotlights.
The question is, if I want shadows on my spotlights or pointlights do I need to add a SpotLightShadowRenderer or PointLightShadowRenderer for each light to the viewPort?
Do we not have one for them all?
An what will the performance impact be with lets say 10 or 20 shadow renderers?