Hello all, I’m new to BabylonJS but an old hand at Pixi.
I’ve an asset management system running in Pixi and I was wondering if there’s any way to use a pre-loaded Pixi texture (which is pulled from a sprite sheet/atlas) and map it onto a plane in BabylonJS?
Unfortunately, I can’t quite figure out what’s going on with the ordering of the objects in scene, but it seems possible. @Deltakosh, got any idea why the sphere is getting clipped by the ground mesh?
You are rendering pixi in the main canvas and not to a texture. A dynamic texture wraps a canvas but usually a different one than the babylon one so either you need to make pixi render to a renderTarget or you need to use it on a separate canvas wrapped into a dynamicTexture.
I’ve worked out how to to do using a DynamicMaterial.
I’ve developed a framework in Pixi that handles the loading of assets (textures etc) and wanted to use this asset manager in my Babylon project. I also wanted to use the TexturePacker facility using sheets/atlases.
Firstly, to create a Babylon texture from a Pixi texture, I create a new DynamicMaterial then draw the Pixi source image into it: