How to use the gltf-pipeline.processGltf function in gltf-pipeline

To help you get started, we’ve selected a few gltf-pipeline examples, based on popular ways it is used in public projects.

github vpdb / vpx-js / lib / gltf / gltf-exporter.ts View on Github external
quantizeTexcoordBits: this.options.dracoOptions!.quantizeTexcoord,
							quantizeColorBits: this.options.dracoOptions!.quantizeColor,
							unifiedQuantization: this.options.dracoOptions!.unifiedQuantization,
						},
					});
					return result.glb;

				} else {
					return glb;
				}

			} else {
				this.outputJSON.buffers[0].uri = blob;
				if (this.options.compressVertices) {
					logger().info('[GLTFExporter.parse] Compressing vertices...');
					const result = await gltfPipeline.processGltf(this.outputJSON, {
						dracoOptions: {
							compressionLevel: this.options.dracoOptions!.compressionLevel,
							quantizePositionBits: this.options.dracoOptions!.quantizePosition,
							quantizeNormalBits: this.options.dracoOptions!.quantizeNormal,
							quantizeTexcoordBits: this.options.dracoOptions!.quantizeTexcoord,
							quantizeColorBits: this.options.dracoOptions!.quantizeColor,
							unifiedQuantization: this.options.dracoOptions!.unifiedQuantization,
						},
					});
					return result.gltf;

				} else {
					return this.outputJSON;
				}
			}
github vpdb / server / src / app / vpinball / gltf / gltf-exporter.ts View on Github external
quantizeTexcoordBits: this.options.dracoOptions.quantizeTexcoord,
							quantizeColorBits: this.options.dracoOptions.quantizeColor,
							unifiedQuantization: this.options.dracoOptions.unifiedQuantization,
						},
					});
					return result.glb;

				} else {
					return glb;
				}

			} else {
				this.outputJSON.buffers[0].uri = blob;
				if (this.options.compressVertices) {
					logger.info(this.options.state, '[GLTFExporter.parse] Compressing vertices...');
					const result = await gltfPipeline.processGltf(this.outputJSON, {
						dracoOptions: {
							compressionLevel: this.options.dracoOptions.compressionLevel,
							quantizePositionBits: this.options.dracoOptions.quantizePosition,
							quantizeNormalBits: this.options.dracoOptions.quantizeNormal,
							quantizeTexcoordBits: this.options.dracoOptions.quantizeTexcoord,
							quantizeColorBits: this.options.dracoOptions.quantizeColor,
							unifiedQuantization: this.options.dracoOptions.unifiedQuantization,
						},
					});
					return result.gltf;

				} else {
					return this.outputJSON;
				}
			}

gltf-pipeline

Content pipeline tools for optimizing glTF assets.

Apache-2.0
Latest version published 3 months ago

Package Health Score

81 / 100
Full package analysis

Similar packages