WombatTurkey Posted November 21, 2016 Share Posted November 21, 2016 Here is the issue: http://jsfiddle.net/Dillybob/7LLqnxw1/30/ If you can help fix this jitterness bug, please pm me with your paypal email and the link to the new jsfiddle. I've been trying to fix for about 2 weeks, I've given up. Only happens when an angle is present on a sprite. Link to comment Share on other sites More sharing options...
Babsobar Posted November 21, 2016 Share Posted November 21, 2016 game.renderer.renderSession.roundPixels = false; Solves it for me. Link to comment Share on other sites More sharing options...
WombatTurkey Posted November 21, 2016 Author Share Posted November 21, 2016 Just now, Babsobar said: game.renderer.renderSession.roundPixels = false; Solves it for me. When camera starts to pan, jitterness comes back Edit: Forgot to mention that, sorry Link to comment Share on other sites More sharing options...
Babsobar Posted November 21, 2016 Share Posted November 21, 2016 oh right, camera follow is commented out in your fiddle Link to comment Share on other sites More sharing options...
Babsobar Posted November 21, 2016 Share Posted November 21, 2016 I got this from the documentation, follow(target, style, lerpX, lerpY) Tell the camera which sprite to follow. You can set the follow type and a linear interpolation value. Use low lerp values (such as 0.1) to automatically smooth the camera motion. If you find you're getting a slight "jitter" effect when following a Sprite it's probably to do with sub-pixel rendering of the Sprite position. This can be disabled by setting game.renderer.renderSession.roundPixels = true to force full pixel rendering. I can't see the sprites your using, but just know that the jittering happens also with the default box Link to comment Share on other sites More sharing options...
WombatTurkey Posted November 21, 2016 Author Share Posted November 21, 2016 4 minutes ago, Babsobar said: I got this from the documentation, follow(target, style, lerpX, lerpY) Tell the camera which sprite to follow. You can set the follow type and a linear interpolation value. Use low lerp values (such as 0.1) to automatically smooth the camera motion. If you find you're getting a slight "jitter" effect when following a Sprite it's probably to do with sub-pixel rendering of the Sprite position. This can be disabled by setting game.renderer.renderSession.roundPixels = true to force full pixel rendering. I can't see the sprites your using, but just know that the jittering happens also with the default box Yep. Even if we enable roundPixels it still happens. But, if we disable roundPixels it doesn't happen but only jitter when camera pans. Very nasty Link to comment Share on other sites More sharing options...
rich Posted November 21, 2016 Share Posted November 21, 2016 I don't get any jittering with this: http://jsfiddle.net/vnzzfnmg/ WombatTurkey 1 Link to comment Share on other sites More sharing options...
WombatTurkey Posted November 21, 2016 Author Share Posted November 21, 2016 5 minutes ago, rich said: I don't get any jittering with this: http://jsfiddle.net/vnzzfnmg/ Yeah, I tried this way but then the tiles / background in the back become distorted when panning. Then, using `game.camera.roundPx = true;` will fix the background distortion, but then the sprite's jitterness is back. LOL Link to comment Share on other sites More sharing options...
rich Posted November 21, 2016 Share Posted November 21, 2016 Fix the fiddle with some proper assets that show this, because I don't see it on the above. Link to comment Share on other sites More sharing options...
WombatTurkey Posted November 21, 2016 Author Share Posted November 21, 2016 Ok. Here: http://jsfiddle.net/Dillybob/vnzzfnmg/1/ Now, hold down S + D and keep your eyes on the tilemap's background you can see the jitter (when camera pans) Now do: game.camera.roundPx = true; The sprite jitter's, but not the tilemap / background However, if you move the sprite by doing `.x+=speed` instead of velocity, there is no problem whatsoever (except for collisions lol) Link to comment Share on other sites More sharing options...
WombatTurkey Posted November 25, 2016 Author Share Posted November 25, 2016 Some updates on this Nasty bug http://stackoverflow.com/questions/40811148/how-to-remove-jitterness-from-phasers-sprite-background And https://github.com/photonstorm/phaser/issues/2885 Link to comment Share on other sites More sharing options...
Recommended Posts