Draco v1.5.2 release. (#818)

This commit is contained in:
Tom Finegan 2022-02-17 14:06:05 -08:00 committed by GitHub
parent 9522c22a74
commit bd1e8de7dd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
23 changed files with 815 additions and 6 deletions

View File

@ -14,6 +14,11 @@ delays can result in transient errors that can be difficult to diagnose when
new Draco releases are launched. To avoid the issue pin your sites to a
versioned release.
### Version 1.5.2 release
* This is the same as v1.5.1 with the following two bug fixes:
* Fixes DRACO_TRANSCODER_SUPPORTED enabled builds.
* ABI version updated.
### Version 1.5.1 release
* Adds assertion enabled Emscripten builds to the release, and a subset of the
assertion enabled builds to GStatic. See the file listing below.

View File

@ -60,7 +60,7 @@ macro(draco_set_build_definitions)
# passed to libtool.
#
# We set DRACO_SOVERSION = [c-a].a.r
set(LT_CURRENT 3)
set(LT_CURRENT 4)
set(LT_REVISION 0)
set(LT_AGE 0)
math(EXPR DRACO_SOVERSION_MAJOR "${LT_CURRENT} - ${LT_AGE}")

View File

@ -6,7 +6,7 @@
News
=======
Check out the [README](https://github.com/google/draco/blob/1.5.1/README.md)
Check out the [README](https://github.com/google/draco/blob/1.5.2/README.md)
file for news about this release.
Description

View File

@ -1,6 +1,6 @@
{
"name": "draco3d",
"version": "1.5.1",
"version": "1.5.2",
"description": "Draco is a library for compressing and decompressing 3D geometric meshes and point clouds. It is intended to improve the storage and transmission of 3D graphics.",
"main": "draco3d.js",
"scripts": {

View File

@ -24,7 +24,7 @@ Draco github glTF branch URL: https://github.com/google/draco/tree/gltf_2.0_drac
News
=======
Check out the [README](https://github.com/google/draco/blob/1.5.1/README.md)
Check out the [README](https://github.com/google/draco/blob/1.5.2/README.md)
file for news about this release.
NPM Package

View File

@ -1,6 +1,6 @@
{
"name": "draco3dgltf",
"version": "1.5.1",
"version": "1.5.2",
"description": "This package contains a specific version of Draco 3D geometric compression library that is used for glTF Draco mesh compression extension.",
"main": "draco3dgltf.js",
"scripts": {

Binary file not shown.

View File

@ -18,7 +18,7 @@
namespace draco {
// Draco version is comprised of <major>.<minor>.<revision>.
static const char kDracoVersion[] = "1.5.1";
static const char kDracoVersion[] = "1.5.2";
const char *Version() { return kDracoVersion; }

View File

@ -99,6 +99,21 @@ std::string TextureUtils::GetExtension(ImageFormat format) {
}
}
int TextureUtils::ComputeRequiredNumChannels(
const Texture &texture, const MaterialLibrary &material_library) {
// TODO(vytyaz): Consider a case where |texture| is not only used in OMR but
// also in other texture map types.
const auto mr_textures = TextureUtils::FindTextures(
TextureMap::METALLIC_ROUGHNESS, &material_library);
if (std::find(mr_textures.begin(), mr_textures.end(), &texture) ==
mr_textures.end()) {
// Occlusion-only texture.
return 1;
}
// Occlusion-metallic-roughness texture.
return 3;
}
std::vector<const Texture *> TextureUtils::FindTextures(
const TextureMap::Type texture_type,
const MaterialLibrary *material_library) {

View File

@ -60,6 +60,13 @@ class TextureUtils {
// extension is returned when the |format| is NONE.
static std::string GetExtension(ImageFormat format);
// Returns the number of channels required for encoding a |texture| from a
// given |material_library|, taking into account texture opacity and assuming
// that occlusion and metallic-roughness texture maps may share a texture.
// TODO(vytyaz): Move this and FindTextures() to MaterialLibrary class.
static int ComputeRequiredNumChannels(
const Texture &texture, const MaterialLibrary &material_library);
static std::vector<const Texture *> FindTextures(
const TextureMap::Type texture_type,
const MaterialLibrary *material_library);

Binary file not shown.

View File

@ -0,0 +1,165 @@
{
"asset": {
"version": "2.0",
"generator": "draco_decoder"
},
"scenes": [
{
"nodes": [
0
]
}
],
"scene": 0,
"nodes": [
{
"children": [1, 2, 3, 4]
},
{
"children": [5]
},
{
"translation": [0.0, 2.0, 0.0],
"scale": [4, 4, 4],
"children": [5]
},
{
"translation": [2.0, 0.0, 0.0],
"scale": [2, 2, 2],
"children": [5]
},
{
"translation": [-2.0, 0.0, 0.0],
"scale": [3, 3, 3],
"children": [5]
},
{
"mesh": 0
}
],
"meshes": [
{
"primitives": [
{
"attributes": {
"NORMAL": 2,
"POSITION": 1,
"TEXCOORD_0": 3
},
"indices": 0,
"mode": 4,
"material": 0
}
]
}
],
"materials": [
{
"pbrMetallicRoughness": {
"baseColorFactor": [
0.75,
0.75,
0.75,
1
],
"metallicFactor": 0
}
}
],
"accessors": [
{
"bufferView": 0,
"byteOffset": 0,
"componentType": 5121,
"count": 36,
"normalized": false,
"max": [
23
],
"min": [
0
],
"type": "SCALAR"
},
{
"bufferView": 1,
"byteOffset": 0,
"componentType": 5126,
"count": 24,
"normalized": false,
"max": [
1,
1,
1
],
"min": [
0,
0,
0
],
"type": "VEC3"
},
{
"bufferView": 2,
"byteOffset": 0,
"componentType": 5126,
"count": 24,
"normalized": false,
"max": [
1,
1,
1
],
"min": [
-1,
-1,
-1
],
"type": "VEC3"
},
{
"bufferView": 3,
"byteOffset": 0,
"componentType": 5126,
"count": 24,
"normalized": false,
"max": [
1,
1
],
"min": [
0,
0
],
"type": "VEC2"
}
],
"bufferViews": [
{
"buffer": 0,
"byteOffset": 0,
"byteLength": 36
},
{
"buffer": 0,
"byteOffset": 36,
"byteLength": 288
},
{
"buffer": 0,
"byteOffset": 324,
"byteLength": 288
},
{
"buffer": 0,
"byteOffset": 612,
"byteLength": 192
}
],
"buffers": [
{
"byteLength": 804,
"uri": "buffer0.bin"
}
]
}

View File

@ -0,0 +1,329 @@
{
"asset" : {
"generator" : "Khronos glTF Blender I/O v1.5.17, with hand-edits for newer glTF extensions.",
"version" : "2.0"
},
"extensionsUsed": [
"KHR_materials_transmission",
"KHR_materials_volume",
"KHR_materials_variants"
],
"extensions": {
"KHR_materials_variants": {
"variants": [
{
"name": "Attenuation"
},
{
"name": "Surface Color"
}
]
}
},
"scene": 0,
"scenes" : [
{
"name" : "Scene",
"nodes" : [
0,
1
]
}
],
"nodes" : [
{
"mesh" : 0,
"name" : "Cloth Backdrop",
"scale" : [
3.5,
3.5,
3.5
],
"translation" : [
-0.15470129251480103,
-0.841584324836731,
-0.1703687310218811
]
},
{
"mesh" : 1,
"name" : "Dragon",
"rotation" : [
0.7071068286895752,
0,
0,
0.7071068286895752
],
"scale" : [
0.25,
0.25,
0.25
],
"translation" : [
0,
-0.7306479811668396,
0
]
}
],
"materials" : [
{
"name" : "Cloth Backdrop",
"pbrMetallicRoughness" : {
"baseColorTexture" : {
"index" : 0
},
"metallicFactor" : 0,
"roughnessFactor" : 0.4934999942779541
}
},
{
"name": "Dragon with Attenuation",
"pbrMetallicRoughness": {
"baseColorFactor": [
1,
1,
1,
1
],
"metallicFactor": 0,
"roughnessFactor": 0
},
"extensions": {
"KHR_materials_transmission": {
"transmissionFactor": 1
},
"KHR_materials_volume": {
"attenuationColor": [
0.921,
0.640,
0.064
],
"attenuationDistance": 0.155,
"thicknessFactor": 2.27,
"thicknessTexture": {
"index": 1,
"texCoord": 0
}
}
}
},
{
"name": "Dragon with Surface Coloring Only",
"pbrMetallicRoughness": {
"baseColorFactor": [
0.921,
0.640,
0.064,
1
],
"metallicFactor": 0,
"roughnessFactor": 0
},
"extensions": {
"KHR_materials_transmission": {
"transmissionFactor": 1
},
"KHR_materials_volume": {
"thicknessFactor": 2.27,
"thicknessTexture": {
"index": 1,
"texCoord": 0
}
}
}
}
],
"meshes" : [
{
"name" : "Cloth Backdrop",
"primitives" : [
{
"attributes" : {
"POSITION" : 0,
"NORMAL" : 1,
"TEXCOORD_0" : 2
},
"indices" : 3,
"material" : 0
}
]
},
{
"name" : "Dragon",
"primitives" : [
{
"attributes" : {
"POSITION" : 4,
"NORMAL" : 5,
"TEXCOORD_0" : 6
},
"indices" : 7,
"material" : 1,
"extensions": {
"KHR_materials_variants": {
"mappings": [
{
"material": 1,
"variants": [
0
]
},
{
"material": 2,
"variants": [
1
]
}
]
}
}
}
]
}
],
"textures" : [
{
"sampler" : 0,
"source" : 0
},
{
"sampler" : 0,
"source" : 1
}
],
"images" : [
{
"mimeType" : "image/jpeg",
"uri" : "checkerboard.jpg"
},
{
"mimeType" : "image/jpeg",
"uri" : "Dragon_ThicknessMap.jpg"
}
],
"accessors" : [
{
"bufferView" : 0,
"componentType" : 5126,
"count" : 62570,
"max" : [
0.9809443354606628,
1.0221298933029175,
1.4283748865127563
],
"min" : [
-0.8216659426689148,
0.0015843699220567942,
-0.46063709259033203
],
"type" : "VEC3"
},
{
"bufferView" : 1,
"componentType" : 5126,
"count" : 62570,
"type" : "VEC3"
},
{
"bufferView" : 2,
"componentType" : 5126,
"count" : 62570,
"type" : "VEC2"
},
{
"bufferView" : 3,
"componentType" : 5123,
"count" : 131337,
"type" : "SCALAR"
},
{
"bufferView" : 4,
"componentType" : 5126,
"count" : 76809,
"max" : [
7.0467000007629395,
3.1512999534606934,
0
],
"min" : [
-7.0467000007629395,
-3.1512999534606934,
-9.939900398254395
],
"type" : "VEC3"
},
{
"bufferView" : 5,
"componentType" : 5126,
"count" : 76809,
"type" : "VEC3"
},
{
"bufferView" : 6,
"componentType" : 5126,
"count" : 76809,
"type" : "VEC2"
},
{
"bufferView" : 7,
"componentType" : 5125,
"count" : 273648,
"type" : "SCALAR"
}
],
"bufferViews" : [
{
"buffer" : 0,
"byteLength" : 750840,
"byteOffset" : 0
},
{
"buffer" : 0,
"byteLength" : 750840,
"byteOffset" : 750840
},
{
"buffer" : 0,
"byteLength" : 500560,
"byteOffset" : 1501680
},
{
"buffer" : 0,
"byteLength" : 262674,
"byteOffset" : 2002240
},
{
"buffer" : 0,
"byteLength" : 921708,
"byteOffset" : 2264916
},
{
"buffer" : 0,
"byteLength" : 921708,
"byteOffset" : 3186624
},
{
"buffer" : 0,
"byteLength" : 614472,
"byteOffset" : 4108332
},
{
"buffer" : 0,
"byteLength" : 1094592,
"byteOffset" : 4722804
}
],
"samplers" : [
{
"magFilter" : 9729,
"minFilter" : 9987
}
],
"buffers" : [
{
"byteLength" : 5817396,
"uri" : "DragonAttenuation.bin"
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 565 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 164 KiB

288
testdata/sphere_lights.gltf vendored Normal file
View File

@ -0,0 +1,288 @@
{
"asset": {
"version": "2.0",
"generator": "draco_decoder"
},
"extensionsUsed": [
"KHR_lights_punctual"
],
"extensions": {
"KHR_lights_punctual": {
"lights": [
{
"name": "Blue Lightsaber",
"type": "spot",
"intensity": 3,
"color": [
0.72,
0.71,
1.00
],
"range": 100,
"spot": {
"innerConeAngle": 0.2,
"outerConeAngle": 0.8
}
},
{
"name": "The Star of Earendil",
"type": "point",
"intensity": 5.0,
"color": [
0.90,
0.97,
1.00
],
"range": 1000
},
{
"name": "Arc Reactor",
"type": "directional",
"color": [
0.9,
0.9,
0.9
],
"range": 200
},
{
"type": "spot",
"spot": {
}
}
]
}
},
"scenes": [
{
"nodes": [
0,
1
]
}
],
"scene": 0,
"nodes": [
{
"mesh": 0
},
{
"translation": [
0,
0,
0
],
"rotation": [
-0.13959079166529637,
-0.6590063691119785,
-0.12632793024247307,
0.7281938412213848
],
"scale": [
1,
1,
1
],
"extensions": {
"KHR_lights_punctual": {
"light": 0
}
},
"children": [
2,
3
]
},
{
"extensions": {
"KHR_lights_punctual": {
"light": 2
}
}
},
{
"extensions": {
"KHR_lights_punctual": {
"light": 3
}
},
"children": [
4
]
},
{
"extensions": {
"KHR_lights_punctual": {
"light": 1
}
}
}
],
"meshes": [
{
"primitives": [
{
"attributes": {
"NORMAL": 2,
"POSITION": 1,
"TANGENT": 4,
"TEXCOORD_0": 3
},
"indices": 0,
"mode": 4,
"material": 0
}
]
}
],
"materials": [
{
"normalTexture": {
"index": 0
},
"pbrMetallicRoughness": {
"baseColorTexture": {
"index": 1
},
"metallicFactor": 0
}
}
],
"textures": [
{
"source": 0
},
{
"source": 1
}
],
"images": [
{
"uri": "sphere_Texture0_Normal.png"
},
{
"uri": "sphere_Texture1_BaseColor.png"
}
],
"accessors": [
{
"bufferView": 0,
"byteOffset": 0,
"componentType": 5121,
"count": 672,
"normalized": false,
"max": [
230
],
"min": [
0
],
"type": "SCALAR"
},
{
"bufferView": 1,
"byteOffset": 0,
"componentType": 5126,
"count": 231,
"normalized": false,
"max": [
1,
1,
1
],
"min": [
-1,
-1,
-1
],
"type": "VEC3"
},
{
"bufferView": 2,
"byteOffset": 0,
"componentType": 5126,
"count": 231,
"normalized": false,
"max": [
1,
1,
1
],
"min": [
-1,
-1,
-1
],
"type": "VEC3"
},
{
"bufferView": 3,
"byteOffset": 0,
"componentType": 5126,
"count": 231,
"normalized": false,
"max": [
0.920301,
0.991284
],
"min": [
0.00871642,
0.00967127
],
"type": "VEC2"
},
{
"bufferView": 4,
"byteOffset": 0,
"componentType": 5126,
"count": 231,
"normalized": false,
"max": [
0.997891,
0.961565,
0.962921,
1
],
"min": [
-0.926271,
-0.9153,
-0.994848,
1
],
"type": "VEC4"
}
],
"bufferViews": [
{
"buffer": 0,
"byteOffset": 0,
"byteLength": 672
},
{
"buffer": 0,
"byteOffset": 672,
"byteLength": 2772
},
{
"buffer": 0,
"byteOffset": 3444,
"byteLength": 2772
},
{
"buffer": 0,
"byteOffset": 6216,
"byteLength": 1848
},
{
"buffer": 0,
"byteOffset": 8064,
"byteLength": 3696
}
],
"buffers": [
{
"byteLength": 11760,
"uri": "sphere_buffer0.bin"
}
]
}