Gachl Posted January 23, 2015 Share Posted January 23, 2015 I'm probably super dumb and overlook some tiny detail that messes up everything I do. Browser:Firefox 35.0Chrome 40.0.2214.91 m Code:<!DOCTYPE html><html> <head> <title>Nothing to see here</title> <style> body { background-color: #000; } canvas { background-color: #222; } </style> </head> <body onload="init();"> <div align="center"> <canvas id="game-canvas" width="512" height="384"></canvas> </div> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script> <script src="pixi.dev.js"></script> <script type="text/javascript"> <!-- function init() { var stage = new PIXI.Stage(0x0168b1); var renderer = PIXI.autoDetectRenderer(512, 384, $("#game-canvas")); renderer.render(stage); } --> </script> </body></html>This is pretty much the exact code that the first tutorial ever shows. WebGL creation failed and Expected behaviour What I have here is a javascript function called init that is being called by the body onload event which I expect to run after things such as pixi.dev.js and jquery have loaded.In this init function, I initialise a stage with a specific blue background colour, I retrieve the canvas to render to and I use the autoDetectRenderer method to have it automatically select WebGL or Canvas. Then the stage is rendered.At this point, when loading the page (in Firefox), I expect the grayish canvas to be completely blue, because I'm rendering an empty blue stage. Instead I got a bunch of error messages: Error: WebGL: Refused to create ANGLE OpenGL context because of blacklisting. pixi.dev.js:5519Error: WebGL: Refused to create native OpenGL context because of blacklisting. pixi.dev.js:5519Error: WebGL: WebGL creation failed. pixi.dev.js:5519Error: WebGL: Refused to create ANGLE OpenGL context because of blacklisting. pixi.dev.js:5519Error: WebGL: Refused to create native OpenGL context because of blacklisting. pixi.dev.js:5519Error: WebGL: WebGL creation failed. pixi.dev.js:5519"Pixi.js v2.2.3 - http://www.pixijs.com/" pixi.dev.js:228 It seems that me, a russian and someone over at kitchenpages were the only people on the whole internet with this issue. And theirs isn't even pixi related. Thankfully, the kitchenpage post has led me to the solution: Go to about:config and set webgl.force-enabled to true. I'm confused why I am the only other person with this issue... Anti-aliasing or naw? After correcting the force-enabled value, the errors disappeared, some new ones appeared but those shouldn't actually be errors, more like warnings. I mean, I can render without anti-aliasing, right? Right!? Error: WebGL: Disallowing antialiased backbuffers due to blacklisting. pixi.dev.js:5519Error: WebGL: Disallowing antialiased backbuffers due to blacklisting. pixi.dev.js:7884"Pixi.js v2.2.3 - http://www.pixijs.com/" pixi.dev.js:228 Turns out I can't. Nothing is being rendered. All I see is the gray defined by css. This was all Firefox so far as Chrome doesn't say anything about it. It's only the gray square of doom and no output at all. So, as you may have guessed, this is my first time using pixi.js or, for that matter, any graphical javascript library. I have no idea what I'm doing wrong nor do I know where to look to figure it out. I've been to several pixi.js demo pages and all of the apps run perfectly fine. I'm sitting here and can't even get an empty stage to render and it's driving me insane. Please help me understand what's going on and why any of this is happening. tl;drWebGL in my script only works when setting about:config webgl.force-enable to true, yet all demos work with it set to false. Why? Nothing is being rendered. Why? Am I stupid?Thanks for your replies. Quote Link to comment Share on other sites More sharing options...
rich Posted January 23, 2015 Share Posted January 23, 2015 Your GPU is blacklisted from using WebGL on a browser level. Nothing you do in the config settings will fix this. Buying a new GPU, or possibly upgrading its drivers are the only options to use WebGL. You can still use Pixi, but you should force it to use the Canvas renderer. For some reason autoDetect clearly doesn't work for your set-up, as it's still trying to use WebGL when it should be falling back to Canvas. So instead force it to use Canvas. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.