matquango Posted February 16, 2015 Share Posted February 16, 2015 I'm currently using pixi to build an animated navigation menu for a website i'm working on. For the sake of example, imagine a bunch of clickable squares with images in a grid like layout. I've added some "responsiveness" javascript code to the menu to shift items depending on the browser window width as well. It's much like having a lot of floated content that will transition from a grid into a single column at smaller widths. When a user resizes and hits one of these breakpoints I call a resize to the Pixi renderer which in turn resizes the canvas (using renderer.resize(w,h) ) after reflowing content. For most cases, this works perfectly fine. I've noticed, though that when I use the WebGL renderer (I'm using autoDetectRenderer to take advantage of gpu throttling) the displayed content starts offsetting and scaling when the renderer resize is setting a height greater than 4000. The hitAreas and interaction seem to be correct, but all my menu icons are in the wrong position. Through testing, I've noticed that the displayed contents perceived y position decreases (moves up and off of the canvas) as the WebGL renderers height is increased passed 4000 until I can't see the content at all.Strange thing is that this doesn't happen in the regular CanvasRenderer. Any thoughts as to what's going on here? Quote Link to comment Share on other sites More sharing options...
xerver Posted February 17, 2015 Share Posted February 17, 2015 Have you tried doing this in a regular webgl context without PIXI? I've noticed that sometimes browsers have a limit on the size a context can be. Quote Link to comment Share on other sites More sharing options...
kyptov Posted February 18, 2015 Share Posted February 18, 2015 Mayby power of 2? Some GPU can`t render textures more than 2048*2048, some can 4096*4096. Here some discussion: http://www.html5gamedevs.com/topic/6762-max-texture-size-for-webgl/ Quote Link to comment Share on other sites More sharing options...
lukasyno Posted February 18, 2015 Share Posted February 18, 2015 Webg has bug/size limit to 4096(2^12) max.please see herehttp://jsfiddle.net/jhickner/862de4nj/ and set width/height with big number (> 4096), you can see distortion..more details about this webgl size limit/bug you can see herehttps://github.com/mrdoob/three.js/issues/5194 BTW, IE don't have this bug. Quote Link to comment Share on other sites More sharing options...
DennisSmolek Posted March 1, 2015 Share Posted March 1, 2015 Out of curiosity why are you using Canvas to do what you are doing? It seems you would be better served by letting the browser and CSS handle the resizes, and if you needed to have all the boxes be their own canvas they can each be it's own instance. Another option, as you said it's for a nav, I'm guessing you are using it to change a view. You could layer the boxes onto your view area and simulate that they are in the same space. 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.