Spec-compliant OpenGL (+Y) maps for Three.js and glTF 2.0
The official Khronos glTF 2.0 specification requires OpenGL (+Y) tangent-space normal maps, and Three.js MeshStandardMaterial and MeshPhysicalMaterial follow the same convention by default. Exporting the right green-channel polarity from the start ensures your 3D web scenes, product configurators, and React Three Fiber canvases light accurately without negating normalScale.y in JavaScript.
This workbench opens with OpenGL (+Y) active, wrapped tiling edges for repeating PlaneGeometry and SphereGeometry textures, and instant 3D lit inspection directly in the browser. Because web assets prioritize fast initial load times, you can inspect detail readability at 512, 1024, or 2048 pixels locally before compressing your final bundle.
Local generation runs inside this browser. Your source image is not sent to Normal Map Studio, FAL, or another model provider unless you deliberately open an AI workflow and confirm the upload disclosure.
- Strictly OpenGL (+Y) compliant for Three.js, Babylon.js, PlayCanvas, and glTF 2.0 viewers.
- Generates matching normalMap, bumpMap/displacementMap, aoMap, and roughnessMap PNGs.
- Power-of-two warnings guarantee WebGL mipmap generation and repeat wrapping work cleanly.
- Inspect specular and shadow direction under a movable light before writing shader code.
Three.js MeshStandardMaterial texture configuration reference
In modern Three.js (r152 and later), Texture.colorSpace defaults to NoColorSpace (linear), which is exact for data maps like normalMap, roughnessMap, and aoMap, while albedo color maps require SRGBColorSpace. Follow this reference when wiring TextureLoader or KTX2Loader.
| Material Property | Color Space | Important Three.js Detail |
|---|---|---|
| normalMap | THREE.NoColorSpace (linear) | Keep normalMapType = TangentSpaceNormalMap and normalScale = (1, 1) |
| roughnessMap | THREE.NoColorSpace (linear) | Three.js reads the Green channel; set scalar roughness = 1.0 when mapped |
| aoMap | THREE.NoColorSpace (linear) | Reads the Red channel; requires a second UV attribute (uv1 / uv2) on geometry |
| displacementMap | THREE.NoColorSpace (linear) | Requires subdivided geometry; start with displacementScale around 0.02–0.08 |
| wrapS / wrapT | THREE.RepeatWrapping | Enable Wrap / tile in this workbench to eliminate UV repeat border lines |
| flipY (glTF vs Manual) | false in glTF, true in TextureLoader | Keep consistent across all four maps so crevices line up pixel-for-pixel |
Optimizing web texture payloads and scaling up to 4K/8K
For interactive e-commerce viewers and WebGL hero sections, a 1024×1024 lossless PNG normal map (or a KTX2 / UASTC compressed derivative built from your lossless PNG master) delivers sharp shading while keeping GPU memory modest on mobile Safari and Chrome. Never feed a lossy JPEG directly into Three.js normalMap, because block artifacts create harsh faceting under PMREMGenerator environment lighting.
When building WebGPU architectural configurators or close-up luxury product demos that demand 4K textures or full material libraries, Pro Local ($29 one-time) unlocks up to 8K individual PNGs, 4K four-map ZIP packs, 2–12 texture batch queues, and ORH channel-packed PNGs (R: AO, G: Roughness, B: Height) that pack three maps into a single HTTP request and a single GPU sampler.
Common Three.js normalMap pitfalls and quick fixes
Two bugs account for almost every broken normal map in Three.js. First, accidentally assigning SRGBColorSpace to a normalMap shifts neutral flat vectors from (0.5, 0.5, 1.0) downward, causing the entire mesh to shade asymmetrically. Always leave normalMap on THREE.NoColorSpace.
Second, forgetting to set scalar roughness to 1.0 when attaching a roughnessMap causes Three.js to multiply your map by the default roughness value—making matte surfaces look artificially glossy or flat. Likewise, remember that aoMap requires a secondary UV set (uv1 in newer Three.js, uv2 in older builds) or else the occlusion texture will appear ignored.
- OpenGL vs DirectX Normal Map Guide — Confirm why glTF 2.0 and Three.js standardize on OpenGL +Y.
- Ambient Occlusion Map Generator — Tune subtle crevice occlusion maps for Three.js aoMap slots.
- Seamless Texture Generator — Eliminate repeat seams before setting RepeatWrapping in Three.js.
Questions about normal maps in Three.js and glTF
Direct answers for WebGL, Three.js, and React Three Fiber developers.
Does Three.js use OpenGL or DirectX normal maps?
Three.js and the glTF 2.0 standard use OpenGL (+Y) tangent-space normal maps by default. If you must use a DirectX map, either convert it locally or set normalScale.set(1, -1).
What colorSpace should I use for normalMap in Three.js?
Use THREE.NoColorSpace (linear). Only diffuse color maps (map and emissiveMap) should use THREE.SRGBColorSpace.
Why is my Three.js aoMap not showing on my mesh?
Three.js samples aoMap from the secondary UV attribute (uv1 in modern releases). Copy geometry.attributes.uv to uv1 if your mesh only has one UV channel.
Can I pack AO and roughness into one file for Three.js?
Yes. Three.js reads aoMap from the Red channel and roughnessMap from the Green channel, so a channel-packed ORH PNG exported with Pro Local works as both maps in one texture bind.
Should I convert my Three.js normal map PNG to WebP or JPEG to save bandwidth?
Avoid JPEG and lossy WebP for tangent-space normal maps because chroma subsampling creates blotchy specular seams. Keep lossless PNG or transcode your lossless PNG master into KTX2 UASTC with normal-map mode enabled.
Performance and VRAM budget tips for WebGL and React Three Fiber
Browser GPU memory is shared with every tab and constrained tightly on iOS Safari and mid-range Android phones. A single uncompressed 4096×4096 RGBA texture consumes roughly 85 MB of GPU VRAM once mipmaps are allocated, whereas a crisp 1024×1024 normal map consumes around 5.3 MB—sixteen times less memory for nearly identical shading on medium-sized viewport objects. Match texture size to real screen coverage rather than shipping oversized textures everywhere.
Always verify that repeat wrapping, anisotropic filtering (renderer.capabilities.getMaxAnisotropy()), and linear NoColorSpace are set cleanly in your loader utility. When authoring hero architectural configurators or close-up product showcases that truly need 4K/8K detail, generate your master PNGs locally with Pro Local before running your KTX2 or glTF-Transform asset build pipeline.