simplyh Posted December 24, 2016 Share Posted December 24, 2016 So I think I'm running into a WebGL renderer bug, and I wanted to confirm that I'm not missing something stupid before I make an issue on the Github. Basically, when I use the WebGLRenderer, everything renders twice as big as when using the CanvasRenderer (see attachments). I suspect it might be an issue with setting the `resolution` to `window.devicePixelRatio`, which I did in the following way: PIXI.settings.RESOLUTION = window.devicePixelRatio; PIXI.loader.add([ "../static/img/mountain.png", "../static/img/crown.png", ]) .load(function() { window.renderer = new PIXI.CanvasRenderer( $(window).width()/window.devicePixelRatio - 50, $(window).height()/window.devicePixelRatio - 50, {resolution: window.devicePixelRatio, antialias: true} ); // etc. } I'm using a Macbook Pro (which has a devicePixelRatio on Chrome of 2), and swapping the `CanvasRenderer` with `WebGLRenderer` causes the blowup below. I'm using an @2x image for the mountain below, but not for another similar image. Am I doing something wrong? While this isn't a huge issue for me right now, I would like to be able to use WebGLRenderer because I'm anticipating adding a lot of extra sprites to the screen and wouldn't mind performance. Thanks! 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.