We have some meshes in our project that have frequent source changes (think television screen with the channels changing between images, videos and dynamic canvases). Would there be any performance gain to us writing our own texture class that is a combination of the existing texture classes like VideoTexture, HTMLElementTexture, etc.
We have been studying some of the underlying classes and can see, for example, the video texture when switching from a poster to the video just creates a new texture within the class and updates it in the engine. Not sure the exact under the hood mechanism, but somehow materials must know of this change in texture.
Would this approach to creating a custom texture type that switches between various sources (image, video, canvas, etc) have any advantage over just constantly swapping out the texture on a material to one of the existing texture types?
i.e is there any performance difference between
myMat.texture = mySpecialNewTextureTypeThatHandlesMultipleSourceTypes
vs
myMat.texture = builtInBabylonTextureTypesButIamChangingThisPropertyOften