Combining two image files into one texture


I need to create a 2 side plane with a texture that is loaded from two separate jpeg files.
How can I combine these two?
Usually I would lode a single texture with

var mat = new BABYLON.StandardMaterial("", scene);
mat.diffuseTexture = new BABYLON.Texture("gargleblaster.jpg", scene);

Can this be done within the StandartMaterial class?


you may need to just have two planes?

ah. ok.
I was basically following this pg:
Which would be basically what i’d want to achieve.
Only with two different jpgs for the front and back

1 Like

In an image editing software combine the two images as happens with front and back of card

Sure ;). Ok, Sorry wasnt clear:
the images will come from a cms and they will be in two different files,
so the merging would have to happen client side.
If BJS cannot handle that I just use some other JS and then pass the result ro BJS

The texture packer could handle this.

But so could just a custom canvas element script

I haven’t been diving deeper into the canvas element. only into frameworks like BJS, phaser et. al. so far.
How does BJS handle the image data? Does something like a rendertexture exist?

We should all know to listen to DK in the first place. This is the most straight forward method for separate image files.

Thank you.
but it seems A rendertexture cannot be created from another texture. Only a mesh, etc?

well you can create custom procedural textures that could consume your texture: Use Procedural Textures - Babylon.js Documentation