Fixed interleaving and added comment

This commit is contained in:
Sean Lilley 2017-07-28 18:00:39 -04:00
parent 487eca91f8
commit cda657e9a6
1 changed files with 3 additions and 2 deletions

View File

@ -427,10 +427,10 @@ function createSpecularGlossinessTexture(gltf, specularImage, glossinessImage, o
if (packSpecular) { if (packSpecular) {
// Write into the R, G, B channels // Write into the R, G, B channels
var redChannel = getImageChannel(specularImage, 0, width, height, scratchChannel); var redChannel = getImageChannel(specularImage, 0, width, height, scratchChannel);
var greenChannel = getImageChannel(specularImage, 1, width, height, scratchChannel);
var blueChannel = getImageChannel(specularImage, 2, width, height, scratchChannel);
writeChannel(pixels, redChannel, 0); writeChannel(pixels, redChannel, 0);
var greenChannel = getImageChannel(specularImage, 1, width, height, scratchChannel);
writeChannel(pixels, greenChannel, 1); writeChannel(pixels, greenChannel, 1);
var blueChannel = getImageChannel(specularImage, 2, width, height, scratchChannel);
writeChannel(pixels, blueChannel, 2); writeChannel(pixels, blueChannel, 2);
} }
@ -824,6 +824,7 @@ function addMesh(gltf, materials, images, bufferState, uint32Indices, mesh, opti
var hasNormals = mesh.normals.length > 0; var hasNormals = mesh.normals.length > 0;
var hasUVs = mesh.uvs.length > 0; var hasUVs = mesh.uvs.length > 0;
// Attributes are shared by all primitives in the mesh
var accessorIndex; var accessorIndex;
var attributes = {}; var attributes = {};
if (hasPositions) { if (hasPositions) {