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 png texture – alpha renders as white instead as transparent

the opacity attribute of material does the trick for you. Follows, example code snippet: var materialArray = []; materialArray.push(new THREE.MeshBasicMaterial( { map: THREE.ImageUtils.loadTexture( ‘images/xpos.png’ ), transparent: true, opacity: 0.5, color: 0xFF0000 })); materialArray.push(new THREE.MeshBasicMaterial( { map: THREE.ImageUtils.loadTexture( ‘images/xneg.png’ ), transparent: true, opacity: 0.5, color: 0xFF0000 })); materialArray.push(new THREE.MeshBasicMaterial( { map: THREE.ImageUtils.loadTexture( ‘images/ypos.png’ ), transparent: true, … 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

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)