Phantomjs: Support WebGL

Created on 30 Oct 2011  ·  34Comments  ·  Source: ariya/phantomjs

_[email protected] commented:_

This enables PhantomJS as a headless WebGL renderer.

Disclaimer:
This issue was migrated on 2013-03-15 from the project's former issue tracker on Google Code, Issue #273.
:star2:   21 people had starred this issue at the time of migration.

QWebkit stale

Most helpful comment

Honestly, I can't understand the reasoning behind commenting “+1” on Github. Does anyone seriously think that makes a difference? It only annoys the maintainer and people who are subscribed. If this has been sitting for three and a half years, a comment won't make it happen.

All 34 comments

_[email protected] commented:_

Drawback: OpenGL becomes a necessary requirement, at least when WebGL support is activated. In many scenarios (with full headless demand, e.g. continuous integration server), there is no guarantee that a decent graphics card is available.

_[email protected] commented:_

Alternative approach: use OpenGL-based software rasterizer, e.g. from Mesa llvmpipe.

_[email protected] commented:_

Working on a WebGL based project (p3d.in) this would make phantomjs a whole lot more interesting for us for testing, but also enable us to do server side rendering of thumbnails for user uploaded 3d models.

So +1 from me :)

_[email protected] commented:_

Support?

Hey,
I'm well aware of the consequences of adding OpenGL to phantomJS but in my use case this is not a problem. (The app will always be run on desktops which have graphic cards). I have been looking around to compile PhantomJS with OpenGL. Without much success I was wondering if you could help me I've made a post on SO: http://stackoverflow.com/questions/16626182/phantomjs-compile-with-webgl

Otherwise headless WebGL would be amazing. I can see stuff like 3D video rendering through phantomJS and stuff like that. so +1 if it's feasible

@ariya Any idea when to expect this (if at all)? I'm evaluating different options for rendering three.js on a server, and wanted to know if Phantom could be one of them.

SlimerJS does it

@bunther SlimerJS isn't headless, so it's not really an option as a Phantom replacement.

@ariya is this still in the horizon? Especially for end-to-end testing ATM there's no option that I'm aware of, and with Panthom's wide adoption it would be nice if it could support this technology.

:+1: this would certainly be an amazing feature to have available!

:+1: That'd be great

:+1:

wondering if there's any progress on WebGL support, as we're planning to try famo.us, and I expect some pitfalls in famo.us rendering by PhantomJS...
otherwise PhantomJS is an amazing piece of software, and extremely helpful to our projects!

+1

:+1:

+1

+1

+1

+1

:+1:

A server-side software based renderer would be awesome for SceneVR. :+1:

+1

+1

Honestly, I can't understand the reasoning behind commenting “+1” on Github. Does anyone seriously think that makes a difference? It only annoys the maintainer and people who are subscribed. If this has been sitting for three and a half years, a comment won't make it happen.

When can we expect WebGL support for the phantom js.?? I need to capture the screen when a web gl has rendered it?

I don't know when/if it's going to be added in Phantom, but in the meantime you could use SlimerJS to render pages that might contain WebGL.

If you just need to render WebGL, you could even use packages gl or node-webgl instead.

This _could_ be as simple as adding

m_customWebPage->settings()->setAttribute(QWebSettings::WebGLEnabled, true);

to webpage.cpp near the existing block of similar settings. But I have no way of testing that, and it could cause the binary to not work at all in the absence of some specific graphics chip, or something equally inconvenient like that.

That's not that easy. WebGL requires OpenGL. OpenGL requires XCB on Linux. That means that you will not be able to use PhantomJS in full headless environment. I doubt that this will be implemented in near future.

There is a project https://github.com/mapbox/headless-gl. Could this be adapted to solve this problem? It says it has a dependency on OpenGL so my suspicion is no.

@hwhelchel Your suspicion is correct, thus you answered your own question.

+1

+1

+100500

Yasss! 👍 💯

Implementing this is a major undertaking and currently beyond the scope of the project.
You are however free to work on it on your own or sponsor someone to implement it. Once it is in a state where we can consider it for inclusion, please reopen this issue and submit a pull request of the implementation. Thank you!

Was this page helpful?
0 / 5 - 0 ratings