tuneboy Posted May 27, 2021 Share Posted May 27, 2021 I've been facing an issue where the webgl context is lost after loading ~2500 textures each 1920 x 1080 and assigning about 700 of them. To get around this I'm attempting to use basis so the textures don't overload the GPU. Based on the documentation https://pixijs.download/dev/docs/PIXI.BasisLoader.html I think it should be working, but when I try running the program it loses context at 700 assigned textures again indicating no performance gain. I'm not getting issues about finding the basis files when calling loadTranscoder. Is there anything wrong with my basis implementation? package.json { "main": "main.js", "scripts": { "start": "electron ." }, "devDependencies": { "electron": "^6.0.10" }, "dependencies": { "@pixi/compressed-textures": "6.0.4", "@pixi/basis": "6.0.4", "pixi-filters": "^4.1.1", "pixi.js": "6.0.4", } } Renderer const BASIS = require('@pixi/basis'); const PIXI = require('pixi.js'); module.exports = class PixiRenderer { constructor(config) { this.app = new PIXI.Application({width: config.width, height: config.height, antialias: config.antialias}); BASIS.BasisLoader.loadTranscoder('./public/scripts/basis_transcoder.js', './public/wasm/basis_transcoder.wasm'); PIXI.Loader.registerPlugin(BASIS.BasisLoader); } } Loader const PIXI = require('pixi.js'); module.exports = class Loader { constructor(config) { this.config = config; this.loader = new PIXI.Loader(); config.Frames.forEach((framePath) => { this.loader.add(framePath, framePath); }); this.loader.load((loader) => { config.sprite.texture = this.loader.resources[config.Frames[0]].texture; }); } draw(frame) { this.config.sprite.texture = this.loader.resources[frame].texture; } } Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted May 27, 2021 Share Posted May 27, 2021 Unfortunately, there's no ongoing known bugs with basis, so we need complete reproduction , posted on pixijs "issues" or "disccusions" github tab, with tagging whoever added basis to pixi, possibly @Shukant Pal Quote Link to comment Share on other sites More sharing options...
tuneboy Posted May 27, 2021 Author Share Posted May 27, 2021 I figured out the issue is that I wasn't using .basis files. I thought the BasisLoader converted image files to the compressed basis format automatically. Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted May 28, 2021 Share Posted May 28, 2021 > I thought the BasisLoader converted image files to the compressed basis format automatically. That is the first thing I thought about, I was too polite to suggest that Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.