|
@@ -84,6 +84,31 @@
|
|
|
[link:https://github.com/stefanpenner/es6-promise include a polyfill]
|
|
|
providing a Promise replacement.</p>
|
|
|
|
|
|
+ <h2>Textures</h2>
|
|
|
+
|
|
|
+ <p>Textures containing color information (.map, .emissiveMap, and .specularMap) always use sRGB colorspace in
|
|
|
+ glTF, while vertex colors and material properties (.color, .emissive, .specular) use linear colorspace. In a
|
|
|
+ typical rendering workflow, textures are converted to linear colorspace by the renderer, lighting calculations
|
|
|
+ are made, then final output is converted back to sRGB and displayed on screen. Unless you need post-processing
|
|
|
+ in linear colorspace, always configure [page:WebGLRenderer] as follows when using glTF:</p>
|
|
|
+
|
|
|
+ <code>
|
|
|
+ renderer.gammaOutput = true;
|
|
|
+ renderer.gammaFactor = 2.2;
|
|
|
+ </code>
|
|
|
+
|
|
|
+ <p>GLTFLoader will automatically configure textures referenced from a .gltf or .glb file correctly, with the
|
|
|
+ assumption that the renderer is set up as shown above. When loading textures externally (e.g., using
|
|
|
+ [page:TextureLoader]) and applying them to a glTF model, colorspace and orientation must be given:</p>
|
|
|
+
|
|
|
+ <code>
|
|
|
+ // If texture is used for color information, set colorspace.
|
|
|
+ texture.encoding = THREE.sRGBEncoding;
|
|
|
+
|
|
|
+ // UVs use the convention that (0, 0) corresponds to the upper left corner of a texture.
|
|
|
+ texture.flipY = false;
|
|
|
+ </code>
|
|
|
+
|
|
|
<h2>Custom extensions</h2>
|
|
|
|
|
|
<p>
|