@three-material-editor/core
Advanced tools
Comparing version 0.2.2 to 0.2.3
@@ -1205,29 +1205,29 @@ 'use strict'; | ||
// wait the first compilation that will inject data into the material shaders | ||
// setTimeout(() => { | ||
setTimeout(function () { | ||
newMaterial.onBeforeCompile = function (shader) { | ||
// troika break if we attribute uniforms | ||
if (!newMaterial.isDerivedMaterial) { | ||
// sometimes we lose the uniforms ? | ||
shader.uniforms = newMaterial.uniforms; | ||
} | ||
newMaterial.onBeforeCompile = function (shader) { | ||
// troika break if we attribute uniforms | ||
// if (!newMaterial.isDerivedMaterial) { | ||
// sometimes we lose the uniforms ? | ||
// TODO FIX ALSO POUR SSR + ROUTE | ||
shader.uniforms = Object.assign(shader.uniforms, newMaterial.uniforms); // } | ||
// if (shader.uniforms) { | ||
// shader.uniforms.muidEditor = { | ||
// value: newMaterial.id | ||
// } | ||
// } | ||
// initialize with the oBC of the material | ||
// @ts-ignore | ||
if (shader.uniforms) { | ||
shader.uniforms.muidEditor = { | ||
value: newMaterial.id | ||
}; | ||
} // initialize with the oBC of the material | ||
if (this.editorOnBeforeCompile) { | ||
// @ts-ignore | ||
this.editorOnBeforeCompile.call(this, shader); | ||
} else { | ||
// override with the editor | ||
shader.vertexShader = shader.vertexShader; | ||
shader.fragmentShader = shader.fragmentShader; | ||
} // if time detected in obc or material, automatically update the value | ||
}; // }, 0); | ||
if (this.editorOnBeforeCompile) { | ||
// @ts-ignore | ||
this.editorOnBeforeCompile.call(this, shader); | ||
} else { | ||
// override with the editor | ||
shader.vertexShader = shader.vertexShader; | ||
shader.fragmentShader = shader.fragmentShader; | ||
} // if time detected in obc or material, automatically update the value | ||
}; | ||
}, 0); | ||
return { | ||
@@ -1234,0 +1234,0 @@ debug: null, |
@@ -1197,29 +1197,29 @@ import React, { useState, useRef, useEffect, useLayoutEffect } from 'react'; | ||
// wait the first compilation that will inject data into the material shaders | ||
// setTimeout(() => { | ||
setTimeout(function () { | ||
newMaterial.onBeforeCompile = function (shader) { | ||
// troika break if we attribute uniforms | ||
if (!newMaterial.isDerivedMaterial) { | ||
// sometimes we lose the uniforms ? | ||
shader.uniforms = newMaterial.uniforms; | ||
} | ||
newMaterial.onBeforeCompile = function (shader) { | ||
// troika break if we attribute uniforms | ||
// if (!newMaterial.isDerivedMaterial) { | ||
// sometimes we lose the uniforms ? | ||
// TODO FIX ALSO POUR SSR + ROUTE | ||
shader.uniforms = Object.assign(shader.uniforms, newMaterial.uniforms); // } | ||
// if (shader.uniforms) { | ||
// shader.uniforms.muidEditor = { | ||
// value: newMaterial.id | ||
// } | ||
// } | ||
// initialize with the oBC of the material | ||
// @ts-ignore | ||
if (shader.uniforms) { | ||
shader.uniforms.muidEditor = { | ||
value: newMaterial.id | ||
}; | ||
} // initialize with the oBC of the material | ||
if (this.editorOnBeforeCompile) { | ||
// @ts-ignore | ||
this.editorOnBeforeCompile.call(this, shader); | ||
} else { | ||
// override with the editor | ||
shader.vertexShader = shader.vertexShader; | ||
shader.fragmentShader = shader.fragmentShader; | ||
} // if time detected in obc or material, automatically update the value | ||
}; // }, 0); | ||
if (this.editorOnBeforeCompile) { | ||
// @ts-ignore | ||
this.editorOnBeforeCompile.call(this, shader); | ||
} else { | ||
// override with the editor | ||
shader.vertexShader = shader.vertexShader; | ||
shader.fragmentShader = shader.fragmentShader; | ||
} // if time detected in obc or material, automatically update the value | ||
}; | ||
}, 0); | ||
return { | ||
@@ -1226,0 +1226,0 @@ debug: null, |
{ | ||
"name": "@three-material-editor/core", | ||
"version": "0.2.2", | ||
"version": "0.2.3", | ||
"description": "Internal, core", | ||
@@ -55,3 +55,3 @@ "author": "Renaud ROHLINGER", | ||
}, | ||
"gitHead": "ac61d4279a2d204bdcd593603cc3374e5d710a0a" | ||
"gitHead": "a5bf04edc6af05aaf859c1f959cf538e7cdd75cb" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
327340