dispose method

dynamic dispose()

Disposes of the PMREMGenerator's internal memory. Note that PMREMGenerator is a static class, so you should not need more than one PMREMGenerator object. If you do, calling dispose() on one of them will cause any others to also become unusable.

Implementation

dispose() {
  _dispose();

  if (_cubemapMaterial != null) _cubemapMaterial.dispose();
  if (_equirectMaterial != null) _equirectMaterial.dispose();
}