update WebglshaderCache to use events
Related issue: #24451
Description
This adds 2 events to ShaderMaterial:
- VertexShaderChanged
- FragmentShaderChanged
These events get caught by the renderer to track if the shader cache is up to date with the material. The shader cache updates the internal identifier of that material only when the event has rung for this material. The internal identifier is used further without needing to worry about the full text again.
Maybe we don't need such a complex solution, see https://github.com/mrdoob/three.js/issues/24451#issuecomment-1209021806.
Any chance of this PR going further?
TBH, I'm not sure about the PR's complexity....
I'll be closing this since this is really out of date.