After spending some more time with this issue I want to share my new findings with you.
I reevaluated some different approaches for drawing SVGs on textures and saw, that the very same issue also occurs for
Originally we solved our use case with DynamicTextures which seemed to have some (different) problems in IOS V14 and below, see forum post.
Seems like the issue mentioned in this forum post can be solved by using a different base64 conversion (
btoa instead of
createObjectUrl) but that’s a different story.
Anyway here is the updated PG example which shows 4 different planes with SVGs on it.
- yellow: solved with Dynamic Texture / no embedded fonts => works
- red: solved with CreateFromBase64Sring / no embedded fonts => works
- blue: solved with Dynamic Texture / embedded fonts => doesn’t work
- green: solved with CreateFromBase64Sring / embedded fonts => doesn’t work
…so the problem are the base64 embedded fonts for both
The fixes for
CreateFromBase64String are the same:
- reload the page
- or call dedicated function twice
So I tried to find what part exactly has to be done twice in order to make it work.
=> It’s the image loading process.
After the image has been loaded once, set the image source again (with the exact same value) and wait for another
This can be seen in the previously mentioned playground example in line 89.
Another thing worth mentioning is that adding the “erronous image” to the HTML page is working.
You can try it in line 100.
So the image itself doesn’t seem to be broken, it must be related to the usage inside the texture.