Why does Babylon.js use bumpTexture for normal maps?
In Babylon.js, PBRMaterial.bumpTexture accepts tangent-space normal maps directly and automatically treats them as normals.
WebGL / WebGPU Material Generator
Configure Babylon.js PBRMaterial channel flags without hunting through API docs: toggle packed glTF ORM metallicTexture channels (R:AO, G:Roughness, B:Metallic), DirectX Y-flip, and ClearCoat, then copy clean TypeScript.
import { PBRMaterial, Texture, type Scene } from "@babylonjs/core";
export function create_WeatheredBrick(scene: Scene): PBRMaterial {
const mat = new PBRMaterial("WeatheredBrick", scene);
mat.albedoTexture = new Texture("/textures/WeatheredBrick_albedo.png", scene);
mat.bumpTexture = new Texture("/textures/WeatheredBrick_normal.png", scene);
mat.invertNormalMapX = false;
mat.invertNormalMapY = false; // Native OpenGL +Y
mat.metallicTexture = new Texture("/textures/WeatheredBrick_orm.png", scene);
mat.useAmbientOcclusionFromMetallicTextureRed = true;
mat.useRoughnessFromMetallicTextureGreen = true;
mat.useMetallnessFromMetallicTextureBlue = true;
mat.useRoughnessFromMetallicTextureAlpha = false;
mat.clearCoat.isEnabled = true;
mat.clearCoat.intensity = 0.65;
mat.clearCoat.roughness = 0.12;
return mat;
}| Babylon.js Property | Value for glTF ORM | Channel Read |
|---|---|---|
| useAmbientOcclusionFromMetallicTextureRed | true | Red (R) = Ambient Occlusion |
| useRoughnessFromMetallicTextureGreen | true | Green (G) = Roughness |
| useMetallnessFromMetallicTextureBlue | true | Blue (B) = Metallic (note double-L spelling) |
| useRoughnessFromMetallicTextureAlpha | false | Prevents Alpha overriding Green |
Babylon.js defaults to reading Roughness from Alpha unless useRoughnessFromMetallicTextureAlpha is explicitly set to false, and its legacy property name uses double-L (useMetallnessFromMetallicTextureBlue). Generating exact boilerplate eliminates silent shiny-material bugs.
glTF 2.0 mandates OpenGL (+Y) normal maps. If an imported asset uses DirectX (-Y) normals, setting mat.invertNormalMapY = true corrects lighting immediately without re-exporting textures.
In Babylon.js, PBRMaterial.bumpTexture accepts tangent-space normal maps directly and automatically treats them as normals.
Check that useRoughnessFromMetallicTextureAlpha is set to false and useRoughnessFromMetallicTextureGreen is true.
Yes—use our free ORM Channel Packer to combine AO, Roughness, and Metallic into one PNG.
Yes, pairing packed ORM maps with UASTC KTX2 cuts WebGL/WebGPU VRAM by 75%.
Optional Google Analytics
Accept loads Google Analytics 4 for traffic and conversion measurement. Reject keeps it off. Necessary first-party product events and the cookie-free pageview counter remain active. This choice never enables advertising.