# New MultiTexture feature

**URL:** <https://forum.babylonjs.com/t/new-multitexture-feature/63985>\
**Category:** Questions\
**Created:** [August 21, 2026, 6:52pm UTC](https://forum.babylonjs.com/t/new-multitexture-feature/63985 "2026-08-21T18:52:16Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alex2](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/alex2/32/19545_2.png) [@Alex2](https://forum.babylonjs.com/u/Alex2)\
**Post date:** [August 21, 2026, 6:52pm UTC](https://forum.babylonjs.com/t/new-multitexture-feature/63985/1 "2026-08-21T18:52:16Z")

</div>

I have opened a new PR to implement an idea I had for blending multiple textures using 2D texture arrays.

If there’s any interest in this, I think it’s ready to go. I would really appreciate any nits or showstoppers regarding this idea. Happy to iterate with the team!

> <https://github.com/BabylonJS/Babylon.js/pull/18822>
>
> This class adds the ability to load multiple textures at once that get combined …at the shader level. It uses \`RawTexture2DArray\` (WebGL2+ only) and adds methods to add, remove, insert, and update layers. 
> 
> Usage:
> 
> \`\`\`
> const allTextures = \[
> 'http://localhost:3000/textures/Rock064\_1K-JPG/Rock064\_1K-JPG\_Color.jpg',
> 'http://localhost:3000/textures/Rock064\_1K-JPG/01\_yellow\_star.png'
> \]
> const mat = new BABYLON.PBRMaterial('mat', scene);
> let mt = new BABYLON.MultiTexture("myMT", allTextures, scene, {width: 128, height: 128})
> mat.bumpTexture = new BABYLON.Texture("http://localhost:3000/textures/Rock064\_1K-JPG/Rock064\_1K-JPG\_NormalDX.jpg", scene)
> mat.metallicTexture = new BABYLON.Texture("http://localhost:3000/textures/Rock064\_1K-JPG/Rock064\_1K-JPG\_Roughness.jpg", scene)
> mat.albedoTexture = mt;   
>    
> mt.blendMode = BABYLON.MultiBlendMode.ALPHA\_BLEND
> \`\`\`
> \<img width="294" height="295" alt="image" src="https://github.com/user-attachments/assets/aa3f5769-b5d3-4726-939e-a8617665be54" /\>
> \<img width="305" height="267" alt="image" src="https://github.com/user-attachments/assets/fa332121-2283-46d6-9abf-77292558b0f2" /\>

---

<div class="post-metadata">

**Author:** ![Alex2](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/alex2/32/19545_2.png) [@Alex2](https://forum.babylonjs.com/u/Alex2)\
**Post date:** [August 21, 2026, 7:04pm UTC](https://forum.babylonjs.com/t/new-multitexture-feature/63985/2 "2026-08-21T19:04:28Z")

</div>

Some notes:

- I had to rely on an LLM for some of the algorithms for ADD/SUBTRACT/ETC so those could use closer scrutiny
- I tried to tread lightly, so if there are other integration points let me know. It works in the local Playground
- I did my best to punch holes in it to test disposal and speed. I didn’t catch any obvious memory leaks

EDIT: Looks like the bot found a few issues so I’ll review those shortly.

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [August 24, 2026, 4:46pm UTC](https://forum.babylonjs.com/t/new-multitexture-feature/63985/3 "2026-08-24T16:46:37Z")

</div>

Love the idea, I ll do a final pass on the PR after the auto feedback and @AlitarSemiramis discussions

---

<div class="post-metadata">

**Author:** ![Alex2](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/alex2/32/19545_2.png) [@Alex2](https://forum.babylonjs.com/u/Alex2)\
**Post date:** [August 28, 2026, 11:20pm UTC](https://forum.babylonjs.com/t/new-multitexture-feature/63985/4 "2026-08-28T23:20:13Z")

</div>

Just a quick note, a lot of the test issues were because I was inheriting ProceduralTexture. I’m working on a refactor to use composition over inheritance. I think that’s the right way to go with this. Much less surface area for maintenance. Let me know if you folks have a concern with that!

---

<div class="post-metadata">

**Author:** ![Alex2](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/alex2/32/19545_2.png) [@Alex2](https://forum.babylonjs.com/u/Alex2)\
**Post date:** [August 31, 2026, 3:21pm UTC](https://forum.babylonjs.com/t/new-multitexture-feature/63985/5 "2026-08-31T15:21:52Z")

</div>

Ok, I think I’ve addressed all comments. This was a bigger task than I anticipated since it’s a first class Babylon class!

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [August 31, 2026, 3:50pm UTC](https://forum.babylonjs.com/t/new-multitexture-feature/63985/6 "2026-08-31T15:50:07Z")

</div>

Coool I ll let @AlitarSemiramis tell me once all good on his side and we ll have @Evgeni_Popov double check the PR 🙂

---

<div class="post-metadata">

**Author:** ![AlitarSemiramis](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/alitarsemiramis/32/49920_2.png) [@AlitarSemiramis](https://forum.babylonjs.com/u/AlitarSemiramis)\
**Post date:** [August 31, 2026, 4:53pm UTC](https://forum.babylonjs.com/t/new-multitexture-feature/63985/7 "2026-08-31T16:53:19Z")

</div>

Getting there! Left a couple of new issues, and @RaananW has also left some comments.

---

<div class="post-metadata">

**Author:** ![Alex2](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/alex2/32/19545_2.png) [@Alex2](https://forum.babylonjs.com/u/Alex2)\
**Post date:** [August 31, 2026, 5:07pm UTC](https://forum.babylonjs.com/t/new-multitexture-feature/63985/8 "2026-08-31T17:07:09Z")

</div>

Awesome! I did flag one existing bug with WebGL vs WebGPU alpha values. I confirmed the bug with Playwright using probes into the shader inputs and that is why the resulting values diverge. The fix is to update the texture 2D array class but that seemed out of scope. Should I fix (possibly affecting stuff unintentionally) or file a bug?

Second question was about coverage of add/remove/insert happening in functional tests vs unit tests. I _think_ it’s covered but I’m seeing some of these Babylon internals for the first time. It’s different from the inside 🙂

EDIT: Also, kudos to the team for the Playwright system. Once I got integration tests working it became so much faster to validate code changes.

---

<div class="post-metadata">

**Author:** ![Alex2](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/alex2/32/19545_2.png) [@Alex2](https://forum.babylonjs.com/u/Alex2)\
**Post date:** [August 31, 2026, 6:16pm UTC](https://forum.babylonjs.com/t/new-multitexture-feature/63985/9 "2026-08-31T18:16:14Z")

</div>

Fixed all issues besides the alpha test. Do you have a preference for how to tackle? I could post an issue along with the test script my LLM created for verification of the bug.

EDIT: working on a possible easy solution for this…

---

<div class="post-metadata">

**Author:** ![AlitarSemiramis](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/alitarsemiramis/32/49920_2.png) [@AlitarSemiramis](https://forum.babylonjs.com/u/AlitarSemiramis)\
**Post date:** [September 1, 2026, 4:48pm UTC](https://forum.babylonjs.com/t/new-multitexture-feature/63985/11 "2026-09-01T16:48:06Z")

</div>

All looks good on my end now, still some comments from others 🙂 Great job!

---

<div class="post-metadata">

**Author:** ![Alex2](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/alex2/32/19545_2.png) [@Alex2](https://forum.babylonjs.com/u/Alex2)\
**Post date:** [September 1, 2026, 4:53pm UTC](https://forum.babylonjs.com/t/new-multitexture-feature/63985/12 "2026-09-01T16:53:08Z")

</div>

I thought I addressed everything? Let me know if I missed anything. In the age of LLMs, the comments fly fast and furiously 😄

---

<div class="post-metadata">

**Author:** ![AlitarSemiramis](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/alitarsemiramis/32/49920_2.png) [@AlitarSemiramis](https://forum.babylonjs.com/u/AlitarSemiramis)\
**Post date:** [September 1, 2026, 5:05pm UTC](https://forum.babylonjs.com/t/new-multitexture-feature/63985/13 "2026-09-01T17:05:52Z")

</div>

You are right, Raanan comments seem to be also addressed 🙂 Added also the label for you.

---

<div class="post-metadata">

**Author:** ![Alex2](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/alex2/32/19545_2.png) [@Alex2](https://forum.babylonjs.com/u/Alex2)\
**Post date:** [September 1, 2026, 6:21pm UTC](https://forum.babylonjs.com/t/new-multitexture-feature/63985/14 "2026-09-01T18:21:14Z")

</div>

Awesome! It was a fun feature to work on. Let me know if there’s anything else I need to do.

---

<div class="post-metadata">

**Author:** ![Alex2](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/alex2/32/19545_2.png) [@Alex2](https://forum.babylonjs.com/u/Alex2)\
**Post date:** [September 11, 2026, 7:19pm UTC](https://forum.babylonjs.com/t/new-multitexture-feature/63985/15 "2026-09-11T19:19:27Z")

</div>

Looks like I have all the approvals now. Thanks, everyone! When it’s merged I have some ideas on how best to demo this in the Playground…

---

<div class="post-metadata">

**Author:** ![RaananW](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/raananw/32/28955_2.png) [@RaananW](https://forum.babylonjs.com/u/RaananW)\
**Post date:** [September 14, 2026, 4:01pm UTC](https://forum.babylonjs.com/t/new-multitexture-feature/63985/16 "2026-09-14T16:01:14Z")

</div>

merged! 🙂  
Thank you so much!

---

<div class="post-metadata">

**Author:** ![Alex2](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/alex2/32/19545_2.png) [@Alex2](https://forum.babylonjs.com/u/Alex2)\
**Post date:** [September 15, 2026, 3:51pm UTC](https://forum.babylonjs.com/t/new-multitexture-feature/63985/17 "2026-09-15T15:51:01Z")

</div>

Here’s a decent demo. You have two overlay images and using the color picker, you can update just the bottom layer. This would be very useful for product customization or layered textures (brick, then moss, then water, etc)

> **[Babylon.js Playground](https://playground.babylonjs.com/#PETUJT%233)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL and WebGPU 3D scenes

---

<div class="post-metadata">

**Author:** ![HiGreg](https://avatars.discourse-cdn.com/v4/letter/h/c5a1d2/32.png) [@HiGreg](https://forum.babylonjs.com/u/HiGreg)\
**Post date:** [October 19, 2026, 11:32am UTC](https://forum.babylonjs.com/t/new-multitexture-feature/63985/18 "2026-10-19T11:32:27Z")

</div>

Suppose I have an globe of earth and diffuseTexture. I draw a longitude / latitude grid with labeled lines on a canvas, white grid on black background. Then I apply the canvas image as the emmisiveTexture and the grid shows up (faintly) on the globe, mostly appearing in spots not aldready fully illuminated.

Would a multiTexture be good for overlaying the grid directly onto the diffuseTexture so that 1) the grid is clearly visible as part of diffuseTexture, and 2) not having to modify the original diffuseTexture?

---

<div class="post-metadata">

**Author:** ![Alex2](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/alex2/32/19545_2.png) [@Alex2](https://forum.babylonjs.com/u/Alex2)\
**Post date:** [October 19, 2026, 2:19pm UTC](https://forum.babylonjs.com/t/new-multitexture-feature/63985/19 "2026-10-19T14:19:15Z")

</div>

That’s exactly the right use case!
