Jump to content

WebGL renderer bug?


simplyh
 Share

Recommended Posts

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!

Screenshot 2016-12-24 01.10.25.png

Screenshot 2016-12-24 01.09.39.png

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...