Skip to content

armgit / 67.js

Public Imported from GitHub
0

3D engine that AI agents drive

Compile graph outputs from the fixed output list (#860)

Nguyen Xuan Ane45ebd419b78
diff --git a/src/material-graph.js b/src/material-graph.js
index 47ba8d70..54d7f27a 100644
--- a/src/material-graph.js
+++ b/src/material-graph.js
@@ -659,7 +659,8 @@ export function compileMaterialGraph(graph, { size = 1, images } = {}) {
const state = { nodeCount: 0, cost: 0, size, images };
const outputs = Object.create(null);
let emissionFresnel;
- for (const name of names) {
+ for (const name of MATERIAL_GRAPH_OUTPUTS) {
+ if (!names.includes(name)) continue;
let node = graph[name];
if (name === 'emission') {
const split = splitEmissionFresnel(node);