Leaderboard


Popular Content

Showing content with the highest reputation on 05/20/20 in all areas

  1. 1 point
    I'm currently looking for a way to represent a large number of points, following the example of 'particles' and 'particles-patched' ... these work very well for me, they allow me to zoom in and see the points very well. Example particles example particles-patched By changing the code a little to get the same result as in the example but with the most real coordinates and quantities, the rendering fails me and I get the following: When I zoom, the points disappear. Generate a very different shape than the texture I'm sending you (the same texture I use for the first image) with this function I generate the texture for both cases: generateCircleTexture(radius) { const gfx = new PIXI.Graphics(); const tileSize = radius * 3; const texture = PIXI.RenderTexture.create(tileSize, tileSize); gfx.beginFill(0x000000); // color base gfx.drawCircle(tileSize / 2, tileSize / 2, radius); gfx.endFill(); this.rendererPixi.render(gfx, texture); return texture; } this code create of containers this.pixiContainer = new PIXI.Container(); const innerContainer = new PIXI.ParticleContainer(400000, {vertices: true}); this.pixiContainer.addChild(innerContainer); This is the route I do in the firstDraw for the example markers.forEach(function(marker) { const projectedCenter = project([marker.latitude, marker.longitude]); const circleSprite = new PIXI.Sprite(that.texturePixi); circleSprite.x = projectedCenter.x; circleSprite.y = projectedCenter.y; circleSprite.center = projectedCenter; circleSprite.anchor.set(0.5); circleSprite.scale.set(invScale); innerContainer.addChild(circleSprite); cirlceSprites.push(circleSprite); }); And this is the route that I already do with what I need _.forEach(points.features, function (feature, position) { if (feature.geometry !== null) { _.forEach(feature.geometry.coordinates, function (point, posCoordinate) { const projectedCenter = project([point[1], point[0]]); const circleSprite = new PIXI.Sprite(that.texturePixi); circleSprite.x = projectedCenter.x; circleSprite.y = projectedCenter.y; circleSprite.center = projectedCenter; circleSprite.anchor.set(0.5); circleSprite.scale.set(invScale); innerContainer.addChild(circleSprite); cirlceSprites.push(circleSprite); }); } }); Do you have any idea what may be happening?
  2. 1 point
    bbyford

    WASM in pixijs

    Just wondering if Pixijs currently has or is planning to use WASM for its core library? Been a little while now and WASM has pretty good browser support, game engines are good candiates to get some of its benefits and wondered if this was something that would happen or would mind someone tinckering with maybe in the community?
  3. 1 point
    Thanks, I'll look down Observer route.
  4. 1 point
    Previous thread: Solution: "That is the problem out of scope of pixijs. https://github.com/bramstein/fontfaceobserver/"
  5. 1 point
    Pools only add more difficulty, dont add them if you dont know when exactly you free objects, believe me - you'll have many problems even without them.
  6. 1 point
    Hello and Welcome to the forums! Yes, its that complicated. You didnt mention WebGL objects which are not treated by regular GC, that makes everything even more difficult My usual approach is just let it flow, profile and take memory heap regularly to ensure you are not leaking anything. One rule - dont create new objects every frame, unless its capped by amortization: if you know you will create 100 objects per second, but you want to create 50 of them in this frame - its fine.
  7. 1 point
    khleug35

    I want to make a leader board

    Hello , Are you planning to add online leaderboard or offline leaderboard??? about offline You can try localStorage to save the score. https://www.panda2.io/docs/api/Storage https://www.panda2.io/examples#storage-get about online, you need to use server side programming languages if your game export to mobile device, you can integration Google play services hope can help
  8. 1 point
    ivan.popelyshev

    Why is this not allowed?

    Good. This technique is used not only in canvas rendering, it will help you in other places too - two big copies flip-flopping data.
  9. 1 point
    ivan.popelyshev

    Why is this not allowed?

    you wrote two lines , one makes something that is rendered, second renders. just pass different textures there one tick you'll do texture1->texture2 the second texture2->texture1
  10. 1 point
    ivan.popelyshev

    Why is this not allowed?

    use two renderTextures, one of them is active. re-render one to second. I use that in pixi-layers: https://github.com/pixijs/pixi-layers/blob/master/src/Layer.ts#L68 , however my particular implementation somehow fails in v5, i didnt investigate yet If you learn how to do it with two textures and changing sprite texture every time - you can go even further and try to make a fake texture that points to one or another, here's the trick from the same file: if (group.useDoubleBuffer) { renderer.texture.unbind(rt); this.currentBufferIndex = 1 - this.currentBufferIndex; let buffer = db[this.currentBufferIndex]; (rt.baseTexture as any)._glTextures = (buffer.baseTexture as any)._glTextures; (rt.baseTexture as any).framebuffer = (buffer.baseTexture as any).framebuffer; } anyway, its not possible without two renderTextures. PixiJS does have flip-flopping only in FilterSystem and its not usable outside
  11. 1 point
    ivan.popelyshev

    Why is this not allowed?

    input = output in your case, cant use renderTexture in sprite that is being in the same renderTexture. Its WebGL restriction. use another renderTexture.