-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Description
If multiple entities share the same video as material map. Only one texture is created and shared across all materials. It's not possible to configure each material independently like for example setting different texture offsets.
We can change how this works in multiple ways. We could generate separate hashes for each texture and create multiple textures if the material data differs. this wouldn't work as expected if all materials sharing the same video map start with the same material values and then change. Changing the material values will result in changes on the shared texture.
We could completely forgo caching video textures. Shared video materials are unusual vs. shared texture images. This is the simplest solution. We would increase resource usage when a single video is used in different materials but not common in practice.
An example to play with:
https://glitch.com/edit/#!/zippy-bush-quill?path=index.html%3A43%3A37
Can see that if both entities share same video element cannot set texture offsets independently since they modify the same shared texture.
This is something we have to address but not sure yet about the best solution.