New MultiTexture feature

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!

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.

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

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!

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

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

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

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 :slight_smile:

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.

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…

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

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

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

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

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…