mateuszduda Posted January 24 Share Posted January 24 Hi, I need help to discuss an issue about merging together two defferent textures - one contains RGB data and is in JPG format, another contains only information about the alpha channel and is in PNG format. We now use an approach where a canvas element is created, the we first draw the alpha texture and use "source-in" composite operation (https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/globalCompositeOperation) to draw RGB texture on top. Due to an error with Apple devices, when creating multiple canvas elements one of them is returned as undefined. Is there any way I can combine these textures while not using a canvas? I prepared a simple demonstration of the process here: https://playcode.io/1734929 Quote Link to comment Share on other sites More sharing options...
mateuszduda Posted January 29 Author Share Posted January 29 For next generations: I just used one canvas and rendered the content to multiple Image elements using .toDaraUrl(). iOS seems to no longer crash because of this. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.