_Zac_

Members
  • Content Count

    7
  • Joined

  • Last visited

  1. Hello, I have a basic question. Is there a way of getting the raw data from the Textures. For example: new PIXI.Text(this.message, this.textSettings).texure; How do I get the individual pixel data for that texture? I looked through the documentation but I did not find how to get the pixel data. Thanks in advance!
  2. Hey Ivan just to give you some clarity we were wrong about the ticker. Should definitely delete the post above. The actual problem which I can 100% confirm is due to JS Number vs string Number. The code in question is actually: createSprites(){ if(this.props.unique_IDS == null) { throw new Error("Error - props.unique_IDS is null"); } const tempSpriteList={}; for(const entity in this.props.unique_IDS) { const flower = new Flower(textures[this.props.unique_IDS[entity].category]); flower.x = this.props.unique_IDS[entity].position.x; flower.y = this.props.unique_IDS[entity].position.y; The position.x and y are loaded in from a json. By changing the above code to: createSprites(){ if(this.props.unique_IDS == null) { throw new Error("Error - props.unique_IDS is null"); } const tempSpriteList={}; for(const entity in this.props.unique_IDS) { const flower = new Flower(textures[this.props.unique_IDS[entity].category]); flower.x = Number(this.props.unique_IDS[entity].position.x); flower.y = Number(this.props.unique_IDS[entity].position.y); We got a 1000% increase in frames. My apologies for my confusion earlier on in this post. I can definitely confirm this was the culprit. Thanks for your help Ivan.
  3. So we have determined the app.ticker was the problem. By disabling the sharedTicker and forcing our own animationRequest we got the expected results with the ParticleContainer outperforming the Container by 300%.
  4. The returned value is 62347, I hardcoded that value to 70 000. Hard coding the value did not change the performance. I also checked to make sure webgl was running for both instances(just for sanity purposes). Both cases are using WebGL.
  5. The title pretty much says it all. I know that that contradicts the documentation, so I am assuming I have done something that is destroying performance. We have a texture atlas which that has 5 textures inside of it. Here is how we create our textures. pixiApp.loader.onComplete.add(async ()=>{ const baseTexture = pixiApp.loader.resources.sprites.texture.baseTexture; const flowers_textures_info = await d3.json('./flowers-textures-1.json'); for (let texture_name in flowers_textures_info.frames) { const frame = flowers_textures_info.frames[texture_name].frame; const texture = new PIXI.Texture( baseTexture, new PIXI.Rectangle(frame.x, frame.y, frame.w, frame.h) ); textures[texture_name.replace('.png','')] = texture; } this.createSprites(); viewBuffer.setDrawList(this.props.data); viewBuffer.drawObjects(container); }) pixiApp.loader.load(); Then we create all of our sprites and load them into one particle container. createSprites(){ if(this.props.unique_IDS == null) { throw new Error("Error - props.unique_IDS is null"); } const tempSpriteList={}; for(const entity in this.props.unique_IDS) { const flower = new Flower(textures[this.props.unique_IDS[entity].category]); flower.x = this.props.unique_IDS[entity].position.x; flower.y = this.props.unique_IDS[entity].position.y; //flower.alpha = 0.0; flower.scale.x = 1/7; flower.scale.y = 1/7; tempSpriteList[entity] = flower; container.addChild(flower); } viewBuffer = new ViewBuffer(tempSpriteList); } Flower is a class that extends sprite. We create our particle container like so: container = new PIXI.ParticleContainer(Object.keys(this.props.unique_IDS).length, { scale: false, position: true, rotation: false, uvs: false, alpha: false, tint: false, }); And here are the profiles. If we use a PIXI.Container we get 30fps while a PIXI.ParticleContainer gets 3 fps. I am honestly at a loss. The only thing that changes in the code is the container creation. I would love some insight, thank you in advance.
  6. I tried 5.2.1 and 5.1.6. I was not able to find the updateText function in both versions.
  7. Hello, I am trying to create a text that renders to the Rope class. let test = new PIXI.Text("Hello my name is computer", {fontSize:28}); test.updateText(); console.log(test); let rope = new Knotz(test, [new PIXI.Point(0,0), new PIXI.Point(10,0),new PIXI.Point(0,10),new PIXI.Point(20,0)]); The problem is updateText() is not a function within the pixi.ts. If I dont call updateText it does not force the texture of Text to update. The result is I bind a texture to the rope that has a width and height of 0. Any work arounds?