Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebGL support #5

Open
H-Maverick opened this issue Jan 4, 2023 · 11 comments
Open

WebGL support #5

H-Maverick opened this issue Jan 4, 2023 · 11 comments

Comments

@H-Maverick
Copy link

Will it be any support for WebGL ?

@gindemit
Copy link
Owner

gindemit commented Jan 6, 2023

Hello, thanks for the question!
I haven't tried to build the plugin for web gl. I am affraid that it is not possible since the rlottie cpp library uses a lot of multi threading. But I'll write done into my todo list to try it out.

@H-Maverick
Copy link
Author

Thanks a lot, i hope it is supported

@enigmablue
Copy link

would love this too.

@enigmablue
Copy link

This error on WebGL

WebGLBuild.framework.js:3 DllNotFoundException: Unable to load DLL 'LottiePlugin'. Tried the load the following dynamic libraries:

But i think we already know that

@gilzoide
Copy link

gilzoide commented Feb 2, 2024

WebGLBuild.framework.js:3 DllNotFoundException: Unable to load DLL 'LottiePlugin'. Tried the load the following dynamic libraries:

WebGL native plugins are static libraries and should be using the special __Internal DLL name, just as it's done for iOS.

@gilzoide
Copy link

gilzoide commented Feb 2, 2024

I am affraid that it is not possible since the rlottie cpp library uses a lot of multi threading.

It seems you must build rlottie with LOTTIE_THREAD_SUPPORT defined for multithreading to be used. I don't know how the WebGL static library was built, but if threading support is disabled in it, it's quite possible that it will just work.

@zaixiaoqu
Copy link

Hello everyone, I've searched all over the search engines and haven't found a good solution. Have you solved it?

@gindemit
Copy link
Owner

gindemit commented May 8, 2024

Hello @zaixiaoqu, I spend few days on it long time ago without any success. I would love to add the web gl support to the plugin.

@zaixiaoqu
Copy link

WebGLBuild.framework.js:3 DllNotFoundException: Unable to load DLL 'LottiePlugin'. Tried the load the following dynamic libraries:

WebGL native plugins are static libraries and should be using the special __Internal DLL name, just as it's done for iOS.

I am affraid that it is not possible since the rlottie cpp library uses a lot of multi threading.

It seems you must build rlottie with LOTTIE_THREAD_SUPPORT defined for multithreading to be used. I don't know how the WebGL static library was built, but if threading support is disabled in it, it's quite possible that it will just work.

Hello @gindemit, Thank you so much. I used @gilzoide 's open source code (https://github.com/gilzoide/unity-lottie-player), It successfully runs in the webgl environment. I think @gilzoide should have solved the problem according to the two methods he provided himself above.

@gindemit
Copy link
Owner

gindemit commented May 9, 2024

Oh, thanks @zaixiaoqu for pointing this out. I will take a shot again to solve this problem.

@gilzoide
Copy link

gilzoide commented May 10, 2024

Yeah, I had to disable rlottie's threading support (that is, build it without LOTTIE_THREAD_SUPPORT defined) for it to not crash the game on WebGL. On CMake, setting LOTTIE_THREAD option to OFF on web builds should do the trick.
That plus using [DllImport("__Internal")] should work =]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants