I am using pbr material and when apply image as texture on mesh than actual texture of the mesh which is apply in blender is goes change in grey please suggest something

Please do not forget to add a link to a Playground

Hi,
I’m afraid this information alone will not be enough. As said, you should try include a ‘playground’ of your case, importing your model in the scene.

Else, you can try provide a couple of screenshots and an extract of the code you are using.
But definetely, the playground would be the better option.

Meanwhile, have a great day :sunglasses:


that is actual mug

and when apply texture it convert into grey

self.addtexture = new PBRCustomMaterial(“texture”, self.scene);
self.addtexture.albedoTexture = new Texture(“” + image.src, self.scene);
self.addtexture.roughness = 0;
self.addtexture.metallic = 0;
self.addtexture.albedoTexture.hasAlpha = false;
self.addtexture.albedoColor = Color3.Red;
// self.addtexture.alpha = 0.5;
self.addtexture.transparencyMode = Material.MATERIAL_ALPHABLEND;
self.addtexture.useAlphaFromAlbedoTexture = true;
self.addtexture.backFaceCulling = false;
if (self.scene.getMeshById(“editor-page”)) {
self.scene.getMeshById(“editor-page”).material = self.addtexture;

  // cloneMesh.alphaIndex = 0;
 
}

Please provide us with a Playground.

1 Like

Sry, I cannot see the texture going grey in this screenshot. Unless the texture you are writting about is the mug (not the image), is it?
For one thing albedoColor when combined with useAlphaFromAlbedoTexture and a transparent/png image is of no effect. By any means, it should be white or light-grey. Then I believe ‘roughness’ from the metallic channel should be set to 1, if no metallic. Also check the transparencyMode with ALPHABLEND, may be you should leave it unset (not defined). And as I said, for proper and more accurate answer, a PG would definetely be needed. It doesn’t have to be the full version. A simple case repro with your code above, the mug and a hardcoded image will do fine.