No, it will not fix the problem entirely. Lightmap can have separate UV sets, so it will be broken even with the same scale if an offset is applied based on different UV space, because lightmaps often consist of multiple objects entirely in UV they are less dense, like with higher scale. Or even there can be close to the current pixel pixel from different object in lightmap uv.
And it is not something that can be fixed any way except just removing offset for lightmap, I change it that way and now lightmaps stop flying around
The pull request would need to handle one offset per combination (matrix/uvindex) which is “a lot” to add. Maybe there could be at leat a flag to not apply offset as it could be enough in quite a lot of cases. The flag could be true if the other textures use a different uvindex pr texture matrix.
Okay, I can try the second option because I am not sure performance will be okay with the first option, if I understand it correctly recursive search for offset will be done per each matrix in worst case.
So, can you please help me understand where uvindex for each sampler defined?
Is it ./ShadersInclude/samplerFragmentDeclaration ?
If yes, can you please explain how it works? Is it some part of the build process that do some magic?