three.js icon indicating copy to clipboard operation
three.js copied to clipboard

update WebglshaderCache to use events

Open gero3 opened this issue 3 years ago • 1 comments

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.

gero3 avatar Aug 08 '22 22:08 gero3

Maybe we don't need such a complex solution, see https://github.com/mrdoob/three.js/issues/24451#issuecomment-1209021806.

Mugen87 avatar Aug 09 '22 07:08 Mugen87

Any chance of this PR going further?

gero3 avatar Aug 10 '22 14:08 gero3

TBH, I'm not sure about the PR's complexity....

Mugen87 avatar Aug 10 '22 17:08 Mugen87

I'll be closing this since this is really out of date.

gero3 avatar Aug 01 '23 10:08 gero3