Need help with vertex displacement script

so I got this Vertex displacement script which I adopted to my vegetation. I don’t know anything about GLSL so maybe someone with some knowledge about it might be able to help me.
It has two problems.
The vegetation is all displaced at the same time.
It accesses the objects via the material and therefore all objects with the same material are displaced equally and synchronously.
Displacing all objects via the material is fine but it would be nice to have them being displaced asynchronous.
The vertex displacement script makes the objects shadeless. I would like to have the diffuse normal and specular properties of the objects working again.

So if someone could have a look at the file and maybe help me out, I would really appreciate it!



PS: made in UPBGE 0.2.5