freetoplay Posted August 12, 2018 Share Posted August 12, 2018 Is it possible to change the texture color in code if I am given a texture image by the artist? Would the best approach be swapping out the texture url with a different url that contains a desired color? For example: scene.meshes[2]._material._albedoTexture.url Quote Link to comment Share on other sites More sharing options...
Sebavan Posted August 12, 2018 Share Posted August 12, 2018 Hello, you can replace the texture like this: scene.meshes[2].material.albedoTexture = new BABYLON.Texture("url," scene); But if you only want to mix a color with your texture you can also use this: scene.meshes[2].material.albedoColor = new BABYLON.Color3(1, 0, 0); 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.