Unfortunately I am not allowed to share the presumably ‘guilty’ input file in a PG, but I’ll try to describe the issue as clearly as I can instead.
I import a .babylon scene and assign to a flat square mesh a standard material created in code, that has an opacity texture. That texture has the same proportions as the target mesh. I want the texture pattern to appear once, and to cover the entire mesh surface. To achieve that, I pretty much leave the texture settings untouched.
This worked as expected with the previous version of the product that I am working on.
I am now attempting to use a different set of input (.babylon scene + texture file) and the opacity texture is no longer displayed at the desired scale: the texture gets stretched along u, which means only a fraction of the image fits on the mesh.
The new mesh and texture file have different dimensions compared to the previous ones, but their proportions are still identical.
Using the Inspector in the Sandbox, I have spotted a difference between the old and the new .babylon scenes which I believe could be the source of the issue: In the imported scene, the mesh I’m having problem with is apparently assigned a material that contains a single channel (albedo). In the old scene, the texture for that channel had the same proportions as the mesh itself. In the new scene however, the texture is 20 times wider than the mesh.
Setting the uScale of my opacity texture to 20 effectively addresses the display issue, which suggests that I might have found the root cause.
But I would like to understand why the material that I define from scratch in code does not completely override any previous material settings contained in the input scene.
Side question: now that I have (hopefully!) spotted the texture that is causing the issue, how would you go about tracing down possible side effects of that texture on the display?
I can see that the original material using the albedo texture contains 4 meshMap objects. Three of which I have not attempted to modify, and a 4th one being ‘undefined’. (Maybe after I assign my material to that mesh?). But I don’t find much info about meshMap in the doc so before digging further that hole, I figured I would ask the pros for some advice
Thanks for reading!