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!
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!
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.
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…
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)
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?