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.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

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;
				}
			}