Jump to content

[Resolved] Seperate UVs for diffuse and opacity textures


Recommended Posts

Hi friends,

I searched for a while, but because of the fairly common search terms I might have missed the info I'm looking for in which case I apologies.

I want to use seperate/different UVs for diffuse and opacity textures in the StandardMaterial. Is this a thing that is possible, or would I have to modify the source?

As always, thanks for using you're precious time to help a pleb like me.

let mesh = new BABYLON.Mesh("face", scene);
let vertexData = new BABYLON.VertexData();
mesh.material = mat;
//set positions, indices, normals
vertexData.uvs = normalTextureUVs;
vertexData.uvs2 = alphaTexUVs;
vertexData.applyToMesh(mesh, 1);

let mat = new BABYLON.StandardMaterial('blup', scene);
mat.diffuseTexture = new BABYLON.Texture('./thing.png', scene);
mat.opacityTexture = new BABYLON.Texture('./alpha.png', scene);
mat.uv = vertexData.uvs2; // <<<< This is what I'm looking for :)



Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...