@gltf-transform/core
Advanced tools
Comparing version 0.12.3 to 0.12.4
{ | ||
"name": "@gltf-transform/core", | ||
"version": "0.12.3", | ||
"version": "0.12.4", | ||
"repository": "github:donmccurdy/glTF-Transform", | ||
@@ -43,3 +43,3 @@ "homepage": "https://gltf-transform.donmccurdy.com/", | ||
}, | ||
"gitHead": "9384b14214f1541f32bc1cdb6dadd60d799a7d34" | ||
"gitHead": "fbba79db7ac2edc817f48addab4313c039d058ab" | ||
} |
@@ -84,6 +84,9 @@ import { Format } from '../constants'; | ||
const textureInfoDef = { | ||
index: this.textureDefIndexMap.get(textureKey), | ||
texCoord: textureInfo.getTexCoord(), | ||
index: this.textureDefIndexMap.get(textureKey) | ||
} as GLTF.ITextureInfo; | ||
if (textureInfo.getTexCoord() !== 0) { | ||
textureInfoDef.texCoord = textureInfo.getTexCoord(); | ||
} | ||
this.textureInfoDefMap.set(textureInfo, textureInfoDef); | ||
@@ -90,0 +93,0 @@ |
@@ -417,7 +417,9 @@ import { Format, GLB_BUFFER, NAME, PropertyType, VERSION, VertexLayout } from '../constants'; | ||
materialDef.alphaMode = material.getAlphaMode(); | ||
if (material.getAlphaMode() !== Material.AlphaMode.OPAQUE) { | ||
materialDef.alphaMode = material.getAlphaMode(); | ||
} | ||
if (material.getAlphaMode() === Material.AlphaMode.MASK) { | ||
materialDef.alphaCutoff = material.getAlphaCutoff(); | ||
} | ||
materialDef.doubleSided = material.getDoubleSided(); | ||
if (material.getDoubleSided()) materialDef.doubleSided = true; | ||
@@ -427,6 +429,14 @@ // Factors. | ||
materialDef.pbrMetallicRoughness = {}; | ||
materialDef.pbrMetallicRoughness.baseColorFactor = material.getBaseColorFactor(); | ||
materialDef.emissiveFactor = material.getEmissiveFactor(); | ||
materialDef.pbrMetallicRoughness.roughnessFactor = material.getRoughnessFactor(); | ||
materialDef.pbrMetallicRoughness.metallicFactor = material.getMetallicFactor(); | ||
if (!MathUtils.eq(material.getBaseColorFactor(), [1, 1, 1, 1])) { | ||
materialDef.pbrMetallicRoughness.baseColorFactor = material.getBaseColorFactor(); | ||
} | ||
if (!MathUtils.eq(material.getEmissiveFactor(), [0, 0, 0])) { | ||
materialDef.emissiveFactor = material.getEmissiveFactor(); | ||
} | ||
if (material.getRoughnessFactor() !== 1) { | ||
materialDef.pbrMetallicRoughness.roughnessFactor = material.getRoughnessFactor(); | ||
} | ||
if (material.getMetallicFactor() !== 1) { | ||
materialDef.pbrMetallicRoughness.metallicFactor = material.getMetallicFactor(); | ||
} | ||
@@ -433,0 +443,0 @@ // Textures. |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
1258861
10922