Flake Posted July 26, 2016 Share Posted July 26, 2016 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 :) Quote Link to comment Share on other sites More sharing options...
Sebavan Posted July 26, 2016 Share Posted July 26, 2016 You can use opacityTexture.coordinatesIndex = 1 to make it use the second set of uvs. Flake 1 Quote Link to comment Share on other sites More sharing options...
Flake Posted July 26, 2016 Author Share Posted July 26, 2016 Sweet! Once again Babylon makes it look easy. Thanks @Sebavan Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.