| @@ -70,6 +70,7 @@ export class MaterialExtender { | |||
| } | |||
| material.materialExtensions = [...material.materialExtensions || [], ...exts] | |||
| .sort((a, b)=>(b.priority || 0) - (a.priority || 0)) | |||
| if (!(material as any).__ext_beforeRenderListen) { | |||
| (material as any).__ext_beforeRenderListen = true | |||
| @@ -86,6 +86,11 @@ export interface MaterialExtension{ | |||
| */ | |||
| getUiConfig?: (material: IMaterial, refreshUi: UiObjectConfig['uiRefresh']) => UiObjectConfig | undefined | |||
| /** | |||
| * Higher priority extensions are applied first. | |||
| */ | |||
| priority?: number // default 0 | |||
| updateVersion?: number | |||
| // eslint-disable-next-line @typescript-eslint/naming-convention | |||
| __setDirty?: () => void // set by MaterialExtender, this increments updateVersion, which ends up calling needsUpdate on all the materials with this extension | |||