lauro

Members
  • Content Count

    1
  • Joined

  • Last visited

  1. lauro

    PIXI Extract

    Hello, I am having similar issues and I cannot make it work even on a simple example. I am trying to extract image with filter applied and I always get an empty image as a result. I tried different approaches, extracting the sprite, generating texture of the sprite and extracting it, putting it into some vanilla container and extracting, and also extracting the whole stage, but always the same result. Everything works fine without the filter applied. Is there something that I am doing wrong? Below is the simple example code that did not work on Pixi Playground, the rendering works fine, it is just the extracting that is not working. /** * This is the default playground. * You should see a bunny spinning in the right preview pane. * Feel free to use this as a starting point for you own playground! */ // Create our application instance var app = new PIXI.Application({ width: window.innerWidth, height: window.innerHeight, backgroundColor: 0x2c3e50 }); document.body.appendChild(app.view); // Load the bunny texture app.loader.add('bunny', 'https://pixijs.io/examples/examples/assets/bunny.png') .load(startup); function startup() { var bunny = new PIXI.Sprite(app.loader.resources.bunny.texture); // Center the sprite's anchor point bunny.anchor.set(0.5); bunny.filters=[new PIXI.filters.BlurFilter()] // Move the sprite to the center of the screen bunny.x = app.renderer.width / 2; bunny.y = app.renderer.height / 2; const photoContainer = new PIXI.Container(); photoContainer.addChild(bunny); app.stage.addChild(photoContainer) const texture = app.renderer.generateTexture(photoContainer, photoContainer.getBounds()) console.log(app.renderer.extract.base64(texture)); console.log(app.renderer.extract.base64(photoContainer)); console.log(app.renderer.extract.base64(bunny)); console.log(app.renderer.extract.base64(app.stage)) }