Sign in to follow this  

[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 :)



Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.