mirror of
https://github.com/CesiumGS/obj2gltf.git
synced 2025-02-11 21:24:05 -05:00
Fixed interleaving and added comment
This commit is contained in:
parent
487eca91f8
commit
cda657e9a6
@ -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) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user