Add WebGL Support
See original GitHub issueHello,
I spent all day experimenting and got WebGL working with headless shell. See the thumbnails here: https://www.reddit.com/r/pplay/ - they are rendered by lambda function from webgl scene.
To enable WebGL:
- I built osmesa using this script: https://github.com/devernay/osmesa-install . I changed
disable_shared
toenable_shared
(line 534) to create libOSMesa32.so file). On EC2 instance, then final file was called libMangledOSMesa32 - just copy it next to the headless chrome binary aslibosmesa.so
. - Remove
disable-gpu
flag, and tweak serverless-plugin-chrome, so thatlibosmesa.so
is included into distribution.
PS: I don’t remember whether I used headless_shell
from this repository.It might be from https://github.com/universalbasket/aws-lambda-chrome But still - the WebGL in AWS lambda is possible, and I’m very happy to share it 😃.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:5
- Comments:42 (5 by maintainers)
Top Results From Across the Web
Getting a WebGL Implementation
WebGL 1.0 is supported in the stable releases of most major browsers on both desktop and mobile platforms. Chrome, Firefox, Internet Explorer, Opera,...
Read more >Getting started with WebGL development - Unity - Manual
To build a WebGL application, you must first install the Unity Hub and then add the WebGL Build Support module. See how install...
Read more >downloading webGL module - Unity Forum
I'm trying to download the WebGL module. I clicked the button in build settings and it takes me here: http://download.unity3d.com/unity/f.
Read more >How to turn on WebGL in my browser - Human Support
Chrome offers full support for WebGL on all platforms, so if you are having trouble running WebGL on Chrome, you simply may need...
Read more >Activate WebGL on my computer - Assistance VR Offshore
To find out if WebGL is enabled in your browser, go to http://get.webgl.org/. To enable WebGL on your browser: Chrome: type "about: flags"...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@vsantosu
I was hoping you still had that build somewhere. @mvoropaiev pointed out the link doesn’t work.
I tried what @anvaka suggested without any luck. I have a zip with both
headless_shell
andlibosmesa.so
in there. The headless_shell works, but things fail with webgl.Here are my CLI args:
I’m actually firing this up with Puppeteer. The same command works locally, but I get errors on the lambda. My lambda works fine for non-webgl stuff.
Has anyone had experience using
swiftshader
instead ofmesa
when no GPU available?