material.map is undefined, then I set material.map = new THREE.Texture() and material.needsUpdate = true. And I find the number of WebGLProgram in renderer.info.programs increase.
I didn’t find any case in threejs examples that material should dispose before set “map” property.
Should I dispose the material before set material.map and material.needsUpdate?
After multiple edits in threejs editor, a large number of useless WebGLProgram will be generated, and I don’t know how to deal with these WebGLPrograms.
Just disposing of materials and textures isn’t enough. You need to ensure there are no references to the disposed objects so they can be garbage collected. For example, if you console.log an object, it won’t be collected because the console holds a reference to it.