karhu Posted February 23, 2017 Share Posted February 23, 2017 Hello all! I'm currently playing around with pixi.js and i have used to these things with normal canvas. I think this might have been asked many times, but how do i disable that image anti-aliasing from pixi.js? In normal canvas i could use context.imageSmoothingEnabled= false, but i think that this doesn't help here? - I have tried to set canvas css to image-rendering: pixelated; - i tried PIXI.settings.SCALE_MODE = PIXI.SCALE_MODES.NEAREST; but it doesn't help. - I also used antialising: disabled at the autoDetectRender -function. Anybody have any idea how to make it work? Or can you even disable it? Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted February 23, 2017 Share Posted February 23, 2017 It depends on version of pixi. We have found that PIXI.setttings.SCALE_MODE wasnt respected by some objects. Try http://pixijs.download/dev/pixi.js Quote Link to comment Share on other sites More sharing options...
karhu Posted February 24, 2017 Author Share Posted February 24, 2017 20 hours ago, ivan.popelyshev said: It depends on version of pixi. We have found that PIXI.setttings.SCALE_MODE wasnt respected by some objects. Try http://pixijs.download/dev/pixi.js Nope, that didn't work. Is there any other versions to try? Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted February 24, 2017 Share Posted February 24, 2017 I need to see your demo, then Quote Link to comment Share on other sites More sharing options...
karhu Posted February 24, 2017 Author Share Posted February 24, 2017 19 minutes ago, ivan.popelyshev said: I need to see your demo, then I tried to scratch something up fast. Here it is: http://roitto.info/helpme/ Does it have something to do with the way i load the sprites? Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted February 24, 2017 Share Posted February 24, 2017 PIXI.settings.SCALE_MODE = PIXI.SCALE_MODES.NEAREST; That should be before loader, not after textures are set up. But even with that fix , I dont see that it works I'm gonna think about it Quote Link to comment Share on other sites More sharing options...
ClusterAtlas Posted February 25, 2017 Share Posted February 25, 2017 Isn't the antialias supposed to be set: false, instead of disabled? :/ Quote Link to comment Share on other sites More sharing options...
karhu Posted February 26, 2017 Author Share Posted February 26, 2017 On 2/25/2017 at 5:56 AM, ServerCharlie said: Isn't the antialias supposed to be set: false, instead of disabled? :/ Yeah i tried both ways. On 2/24/2017 at 2:40 PM, ivan.popelyshev said: PIXI.settings.SCALE_MODE = PIXI.SCALE_MODES.NEAREST; That should be before loader, not after textures are set up. But even with that fix , I dont see that it works I'm gonna think about it Yeah it didn't work. It's weird that the canvas rendering works fine, there is no smoothing. But if it uses webgl, it goes smooth. Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted February 26, 2017 Share Posted February 26, 2017 That's definitely a bug with "settings". You can mark with NEAREST all the textures manually before the first render. Otherwise you have to wait while somebody finds the mistake and fixes it, i dont have time right now. Quote Link to comment Share on other sites More sharing options...
karhu Posted February 26, 2017 Author Share Posted February 26, 2017 12 minutes ago, ivan.popelyshev said: That's definitely a bug with "settings". You can mark with NEAREST all the textures manually before the first render. Otherwise you have to wait while somebody finds the mistake and fixes it, i dont have time right now. How do i change the scalemode for textures manually? I found the scalemode variable from texture -> basetexture -variable, is it the right one to change? E: Yeah it worked manually. Guess i have to make function which changes them manually then. Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted February 26, 2017 Share Posted February 26, 2017 Found it. Gonna fix it Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted February 26, 2017 Share Posted February 26, 2017 @karhu Please try this one: https://dl.dropboxusercontent.com/u/46636530/pixijs/scalemode/pixi.js Quote Link to comment Share on other sites More sharing options...
karhu Posted February 26, 2017 Author Share Posted February 26, 2017 10 minutes ago, ivan.popelyshev said: @karhu Please try this one: https://dl.dropboxusercontent.com/u/46636530/pixijs/scalemode/pixi.js thanks! It seems that it works! http://roitto.info/helpme2/ (even though the player sprites position looks a bit weird) Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted February 26, 2017 Share Posted February 26, 2017 Thank you! Now I we know about that and we can fix it: https://github.com/pixijs/pixi.js/pull/3787 karhu and ClusterAtlas 2 Quote Link to comment Share on other sites More sharing options...
ClusterAtlas Posted February 26, 2017 Share Posted February 26, 2017 It just got merged, awesome. Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted February 26, 2017 Share Posted February 26, 2017 It was approved by two others, was merged and after a second i hear the sound that someone answered in forum. ClusterAtlas 1 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.