Rendering WebGL image in headless chrome without a GPU

There’s an open bug which affects systems without X11 libraries: crbug.com/swiftshader/79. It prevents Chrome OS from running with SwiftShader, but the same issue would also happen on a headless Linux system which has no X11 support. Fortunately it should be feasible to install X11 and get things running. I’m not 100% sure which packages provide … Read more

Three.js detect webgl support and fallback to regular canvas

Yes, it’s possible. You can use CanvasRenderer instead of WebGLRenderer. About WebGL detection: 1) Read this WebGL wiki article: http://www.khronos.org/webgl/wiki/FAQ if (!window.WebGLRenderingContext) { // the browser doesn’t even know what WebGL is window.location = “http://get.webgl.org”; } else { var canvas = document.getElementById(“myCanvas”); var context = canvas.getContext(“webgl”); if (!context) { // browser supports WebGL but initialization … Read more

Three.js: How can I make a 2D SnapShot of a Scene as a JPG Image?

There are a couple of things you will have to do to save the frame as a jpg image. Firstly initialize the WebGL context like this renderer = new THREE.WebGLRenderer({ preserveDrawingBuffer: true }); preserveDrawingBuffer flag will help you to get the base64 encoding of the current frame The code for that will be something like … Read more

Optimising the drawing of overlapping rectangles

You are making the very wrong assumption that the performance you will be getting on the desktop browser will somehow determine the performance on your iPhone. You need to understand that the iPhone hardware implements tile-based deferred rendering which means that the fragment shader is used very late in the pipeline anyway. As Apple themselves … Read more

Deploy WebGL applications as native iOS or Android applications?

As an extension to Joris’ answer (which appears to be based on the work of Nathan de Vries), the following is the code I needed to enable WebGL within the iOS 5.0 SDK: Somewhere near the top of your view controller implementation: @interface UIWebView() – (void)_setWebGLEnabled:(BOOL)newValue; @end Programmatically creating a UIWebView and enabling WebGL: UIWebView … Read more

SceneJS vs Three.JS vs others [closed]

As SceneJS author I thought I’d throw this in if it helps: SceneJS is specialised towards fast rendering of large numbers of individually articulated objects, without game engine effects like shadows, reflections etc. In other words it’s aimed at requirements of CAD, medical anatomy, engineering visualisations, things with 1000’s of nuts and bolts, organs etc. … Read more

Get CPU/GPU/memory information

This code will print GPU info and will list all info you can get from the Performance object of this browser (it’s different for each browser). <html> <body> <canvas id=”glcanvas” width=”0″ height=”0″></canvas> <script> var performance = window.performance || window.mozPerformance || window.msPerformance || window.webkitPerformance || {}; const performanceKeys = []; for (var value in performance) { … Read more

Differences between WebGL and OpenGL

WebGL is “OpenGL ES 2”, not plain OpenGL (the ES stands for ‘for Embedded Systems’). So there’s the first difference. OpenGL ES is essentially a subset of OpenGL. In addition, WebGL is almost the same as OpenGL ES 2, but has some subtle differences, explained in the link you provide. There’s not much to add … Read more