BSH Posted December 25, 2021 Share Posted December 25, 2021 I can't get Pixi game look crispy on mobile devices. Whenever window.devicePixelRatio is greater than 1, no matter what I do game doesn't look as crispy as it looks when window.devicePixelRatio equals to 1. Images for mobile version are saved separately (downscaled using photoshop). Using roundPixels = true on my sprites. devicePixelRatio:1 devicePixelRatio:3 Any help would be much appreciated. Here is how I am setting up my stage: if (window.devicePixelRatio){ RESOLUTION = window.devicePixelRatio; } PIXI.GRAPHICS_CURVES.adaptive = false; PIXI.settings.autoDensity = true; PIXI.settings.ANISOTROPIC_LEVEL = 0; PIXI.settings.RESOLUTION = window.devicePixelRatio; let app = new PIXI.Application({ width:window.innerWidth/RESOLUTION, height: window.innerHeight/RESOLUTION, antialias: true, autoResize: true, resize: (window.innerWidth/RESOLUTION, window.innerHeight/RESOLUTION), transparent: false, resolution: window.devicePixelRatio, rootRenderTarget: { resolution: window.devicePixelRatio }, backgroundColor: secondColor, }); Quote Link to comment Share on other sites More sharing options...
Exca Posted December 27, 2021 Share Posted December 27, 2021 Is your canvas scaled when using higher dpr? Also you have some options in the app creation that I cannot see in the docs. Resize & rootRenderTarget. You could try adding autoDensity:true to make the canvas css be set automatically based on resolution. I usually do those calculations manually, but should work via app also. BSH and hulkyuan 2 Quote Link to comment Share on other sites More sharing options...
BSH Posted December 28, 2021 Author Share Posted December 28, 2021 Placing autoDensity:true within new PIXI.Application({...}) did the magic. Appreciate your help! Thank you so much!!! 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.