Workflow
WebGL material workflow
Use compact procedural maps and predictable channel settings for Three.js, custom WebGL renderers, and browser-based material previews.
- Target
- Three.js / custom WebGL
- Recommended route
- GLB for quick load or PNG maps for custom shaders
- Primary output
- GLB material or individual PNG maps
Channel setup
Color map
Use sRGB color space for the visible base color texture in Three.js or the equivalent color conversion in custom shaders.
Normal
Sample normal maps as data textures and tune normal scale in the material rather than rebaking the texture.
Roughness and AO
Keep roughness and AO linear. In Three.js, AO also needs UV2 or matching secondary UV handling.
Repeat and wrapping
Enable repeat wrapping for seamless materials and set repeat values in code so the same export can cover different asset sizes.
Import steps
Choose GLB or map files
Use GLB when you want a quick carrier material. Use individual PNG maps when your renderer owns the shader and texture binding.
Configure texture color space
Assign sRGB to color maps and keep roughness, normal, height, and AO as linear data textures.
Enable repeat behavior
Set wrapS and wrapT to repeat for seamless surfaces, then control scale through material repeat values or shader uniforms.
Profile the map budget
Test resolution, compression, and number of channels on the target device before using large map sets in production.
Common checks
Missing UV2 for AO
If AO has no visible effect in Three.js, confirm the geometry has the UV set required by the material.
Wrong colorSpace
A base color map treated as linear can look too dark; data maps treated as sRGB can break roughness or normal response.
Too many large maps
Browser scenes are sensitive to texture memory. Use the smallest resolution that survives the camera distance.
Workflow FAQ
Is GLB the easiest WebGL route?
For quick material review, yes. For production renderers, individual maps often give better control over compression, loading, and shader inputs.
Can seamless maps repeat in Three.js?
Yes. Set the texture wrapping mode to repeat and control repeat scale on the material or texture instance.