jhh1198 Posted August 27, 2017 Share Posted August 27, 2017 Hello, everyone. I am using an SVG file to render resolution independent textures. My device has a pixel ratio of 3, and so I set the PIXI resolution to 3 for a crisp display. My SVG texture becomes weirdly pixelated if the canvas it is rendered to is too large. This only happens when using the WebGL renderer. I have two comparison pictures: http://imgur.com/a/5bQxM First one crisp (Canvas), second one pixelated (WebGL). The size of the texture is 1528x1528 and my screen resolution is 1920x1080. Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted August 27, 2017 Share Posted August 27, 2017 Show us the fiddle Quote Link to comment Share on other sites More sharing options...
jhh1198 Posted August 27, 2017 Author Share Posted August 27, 2017 My bad, this seems to only be an issue with the Cocoon Webview+. There is no issue on the normal Webview. Thank you! Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted August 27, 2017 Share Posted August 27, 2017 Cocoon webview+ resolution logic is different, we did experiments on that. @bQvle knows how to do it, there were special PR's to make pixi behave differently in cocoon. It seems that we need some real debugging there again. Quote Link to comment Share on other sites More sharing options...
jhh1198 Posted August 27, 2017 Author Share Posted August 27, 2017 Yes. I just posted a bug topic on the Cocoon.io forum: https://forums.cocoon.io/t/webview-pixelates-textures-too-large-webgl-only/6112 Quote Link to comment Share on other sites More sharing options...
jhh1198 Posted August 27, 2017 Author Share Posted August 27, 2017 Here is a JSFiddle I created to see the issue. Again, this only occurs in Cocoon's Webview+: https://jsfiddle.net/L5zw0n7e/show/ Quote Link to comment Share on other sites More sharing options...
jhh1198 Posted August 28, 2017 Author Share Posted August 28, 2017 To those who are interested, I've discovered this has to do with the way images are being cached by Cocoon. If I clear the app's cache, the first time run there is no issue. But when I close out the app and run again, it is pixelated. Quote Link to comment Share on other sites More sharing options...
jhh1198 Posted September 1, 2017 Author Share Posted September 1, 2017 I've went even further and discovered this is not the cache. Any texture above 1040 pixels in Webview+ becomes oddly jagged. This doesn't occur if Pixi uses the canvas renderer. My current workaround is to round the texture to the nearest power of two. That seems to fix the issue. Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted September 2, 2017 Share Posted September 2, 2017 You may also switch this thing before you create the renderer: PIXI.settings.PRECISION_FRAGMENT = PIXI.PRECISION.HIGH; Quote Link to comment Share on other sites More sharing options...
jhh1198 Posted September 2, 2017 Author Share Posted September 2, 2017 Thanks for your help, @ivan.popelyshev, but setting that option had no effect. I had put it before creating the renderer. 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.