Search the Community
Showing results for tags 'roughness'.
-
Hello everyone. First of all I would like to say thank you, the posts in this forum often helped me. You guys have a great community! Now to my Problem. I need to create a PBRMaterial out of 4 different textures. There is a BumpTexture, an AlbedoTexture, a Metallic- AND a RoughnessTexture but I only found a way to create this by using a combination of MetallicRoughness. Actually I am using the code below: let pbr = new BABYLON.PBRMaterial("pbr", this._scene); //Create bumpTexture and flip normal. (DirectX <-> OpenGL) pbr.bumpTexture = new BABYLON.Texture("materials/" +filePath +"/02_Texturepack/" +materialName+"Normal.png", this._scene); pbr.bumpTexture.level = -1; //Create albedoTexture pbr.albedoTexture = new BABYLON.Texture("materials/" +filePath +"/02_Texturepack/" +materialName+"BaseColor.png", this._scene); //Create reflectionTexture pbr.reflectionTexture = BABYLON.CubeTexture.CreateFromPrefilteredData("textures/environment.dds", this._scene); //Create metallicRoughnessTexture pbr.metallicTexture = new BABYLON.Texture("materials/" +filePath +"/02_Texturepack/" +materialName+"MetallicRoughness.png", this._scene); //Set metallic and roughness to 1 to use it from the metallicRoughnessTexture pbr.metallic = 1.0; pbr.roughness = 1.0; //set channel with metallic and roughness pbr.useRoughnessFromMetallicTextureAlpha = false; pbr.useRoughnessFromMetallicTextureGreen = true; pbr.useMetallnessFromMetallicTextureBlue = true; //set new material to mesh this._activeMesh.material = pbr; Is there any possibility to seperate the metallic and roughness informations in two different images? At the moment I am editing the metallic texture with photoshop and put the information of roughness into the green channel and the metallic information into the blue channel which works pretty well. unfortunaly thats not a solution, because customer have thousonds of texturepacks I need to show in Babylon without merging metallic and roughness. Greetings, Chris.
- 3 replies
-
- pbrmaterial
- metallic
-
(and 1 more)
Tagged with: