Playing around with freezing materials and seeing some weirdness when freezing materials and using video texture. I created a PG that switches between a webcam video texture and a default texture. If I freeze the materials, then the webcam texture is upside down, but if I don’t, then it is correct. I even tried unfreezing right before swapping the texture and refreezing after swapping and it made no difference.
Why is freeze preventing the texture from flipping correctly in this case and where do I need to unfreeze in order to prevent it?
I don’t really have a list of what does and doesn’t work in frozen mode. A list would certainly help, but we would probably forget some cases as it’s possible to change a lot of things wrt a material…
Setting a new texture should work, even if it’s a video (what does not work in your example is the vScale=-1 part, not the texture itself).
@Evgeni_Popov I’m running into a situation in our production code where e1 is never not equal to e2. I’m guessing this occurs when a material update is not required or maybe has already happened by the time I get e1? Can I use onCompiled or a dirty flag to tell when the material has been updated?
You have the onEffectCreatedObservable which will tell you when an effect is “created” for a material. However, “created” here can mean “retrieved from cache”, if the effect we need already exists. Perhaps you can try to take advantage of this observable?