diff --git a/packages/troika-three-utils/src/DerivedMaterial.js b/packages/troika-three-utils/src/DerivedMaterial.js index 0d18c357..0cc3f17a 100644 --- a/packages/troika-three-utils/src/DerivedMaterial.js +++ b/packages/troika-three-utils/src/DerivedMaterial.js @@ -66,7 +66,7 @@ let materialInstanceId = 1e10 * output value. Will be injected near the end of the `void main` function, but before any * of ThreeJS's color postprocessing shader chunks (tonemapping, fog, etc.), and before the * `fragmentMainOutro`. - * @param {function({fragmentShader: string, vertexShader:string}): + * @param {function({fragmentShader: string, vertexShader:string}): * {fragmentShader: string, vertexShader:string}} options.customRewriter - A function * for performing custom rewrites of the full shader code. Useful if you need to do something * special that's not covered by the other builtin options. This function will be executed before @@ -170,6 +170,11 @@ export function createDerivedMaterial(baseMaterial, options) { constructor: {value: DerivedMaterial}, isDerivedMaterial: {value: true}, + type: { + get: () => baseMaterial.type, + set: (value) => {baseMaterial.type = value} + }, + isDerivedFrom: { writable: true, configurable: true,