vdddslep

Members
  • Content Count

    17
  • Joined

  • Last visited

  1. vdddslep

    Microlags with fast-moving objects

    Thank you for reply, I guess I understand the idea.
  2. vdddslep

    Microlags with fast-moving objects

    Am I right that it is impossible to make smooth animation because of this lags?
  3. vdddslep

    Microlags with fast-moving objects

    Hi everyone, Sorry for delayed response. I checked the forum couple of days after the post and decided there wouldn’t be response at all. In my game I do not use Tweens to move the objects, I used it just for the demo, because I thought that tweenLight use some kind of interpolation under the hood, seems like I was wrong. So, in the game, on each iteration I calculate the distance using actual time elapsed, I thought that it is kind of interpolation: This is how I do it: let curTime = performance.now(); let delta = curTime - this.lastTickTime; let distance = 0.001 * this.pawn.speed * delta * GRID.SIZE; And then: this.transform.position.x += this.direction.x * distance; this.transform.position.y += this.direction.y * distance; BTW, thank you for the link on TweenLight static.ticker, I didn't know about it before. And yes I made demo with: chunk.cacheAsBitmap = true; because I thought that it could be related to microlags which I have
  4. vdddslep

    Microlags with fast-moving objects

    When trying to move an object with high speed across the scene, I've noticed that the movement is not really smooth - there are some small but really annoying glitches. I've tried both manual moving and moving with TweenLite, the glitches persist in both cases. I'm using Pixi.js 4.5.3 This is how I create the Render, maybe something wrong with it: let canvas = <HTMLCanvasElement>document.getElementById("canvas"); this.renderer = PIXI.autoDetectRenderer(1500, 1200, { // ScenesManager.renderer = new PIXI.CanvasRenderer(800, 600, { view: canvas, antialias: false, roundPixels: false, }); this.renderer.backgroundColor = 0x000000; document.body.appendChild(this.renderer.view); And this is my tween: let wall:PIXI.Sprite = PIXI.Sprite.fromFrame("1.png"); this.addChild(wall); wall.position = new PIXI.Point(4*64, 2*64); TweenLite.to(wall.position, 15, { x: 99*64, y: 2*64, ease: Linear.easeNone}); And I also made the demo (see the attachment) I would really appreciate any help or ideas on what can cause such microlags, cause I've spent many hours trying to sort this out. The number of objects on scene doesn’t really matter, there are lags even on small test scene with just 1 moving object. Any thoughts on what's happening? TestTween.zip
  5. vdddslep

    Need help! I have a bug with cacheAsBitmap = true

    Yep, someday, PIXI is pure JS, I came from Java and for now I am still struggling even with TypeScript
  6. vdddslep

    Need help! I have a bug with cacheAsBitmap = true

    Looks like it works for me as a workaround: getLocalBounds(rect?: PIXI.Rectangle): PIXI.Rectangle { let bounds:PIXI.Rectangle = super.getLocalBounds(rect); return new PIXI.Rectangle(Math.round(bounds.x), Math.round(bounds.y), Math.round(bounds.width), Math.round(bounds.height)); } If I put it to the Chunk class. Thank you for your collaboration, without it I would never found it.
  7. vdddslep

    Need help! I have a bug with cacheAsBitmap = true

    As I understand localbounds is not integers because I use this.cannonClip.anchor.set( 0.5, 0.3); despite the fact that sizes of all textures are power of 2 after using anchor.set localbounds becomes not integers. So, how can I set the anchor to keep localbounds integers?
  8. vdddslep

    Need help! I have a bug with cacheAsBitmap = true

    YES! I did it! I spent hours before I found the way to reproduce it. Somehow it is reproduced only with turret and only if it has a gun as a child of it To better reproduction scroll the scene all the way down using WASD and try to build(mouse click) the turret there And thank you for your help. Test.zip
  9. vdddslep

    Need help! I have a bug with cacheAsBitmap = true

    It weird, but in my demo it just works, I will try to figure it out
  10. Hi, friends I am working on the game where I have more than 10 thousand objects in 9 different layers on the scene. Thank God that I can easily cache it, to do that I split each layer up into small pieces, I called them chunks. So, I cached each chunk using cacheAsBitmap = true and everything was great, until I changed the scene. Of course, I recached the chunk: let chunk:PIXI.Container = this.chunkGrid[chunkPosition.x][chunkPosition.y]; if (chunk.cacheAsBitmap) { chunk.cacheAsBitmap = false; } if(chunk.width > 0 && chunk.height > 0) { chunk.cacheAsBitmap = true; } But after I do it, chunk position is changing (See the screenshot). I have no idea why and how could I deal with it I'll be appreciate for any help Best regards, Denis
  11. vdddslep

    Gaps between sprite tiles when scaling the stage

    I am sorry that I didn't explain it in more detail: 1) I use WebGL because I need to use some shaders for my demo, so WebGL is a crucial for my demo 2) I've solved the problem with the tiles by using roundPixels set to true and TexturePacker with "extrude" option That was a good part =), but: I have lets say asteroid field in my demo and each asteroid have a random animation like this: public update() { this.asteroid.rotation += 0.0005; } and I am calling that "update" each frame As you can see the precision of the rotation is very high and I have some kind of distortion when I rotate asteroid with that precision and that is the problem for me now. Thank you and I'll appreciate any help.
  12. vdddslep

    Pixi v4 Shaders

    Thank you, you save a week of my work I think
  13. vdddslep

    Gaps between sprite tiles when scaling the stage

    Or maybe there is any other way to to set roundPixels to true for my desired object only instead of the entire scene
  14. vdddslep

    Gaps between sprite tiles when scaling the stage

    Thank you Fatalist It helped, I can't believe it, but yep it works! The only problem is that I have to set roundPixels to true which I don't like because the tiles jumps when I scroll the scene. Is there any other option except roundPixels which I could use?