baseTexture.polynomial.js 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. import { CubeMapToSphericalPolynomialTools } from "../../Misc/HighDynamicRange/cubemapToSphericalPolynomial.js";
  2. import { BaseTexture } from "./baseTexture.js";
  3. BaseTexture.prototype.forceSphericalPolynomialsRecompute = function () {
  4. if (this._texture) {
  5. this._texture._sphericalPolynomial = null;
  6. this._texture._sphericalPolynomialPromise = null;
  7. this._texture._sphericalPolynomialComputed = false;
  8. }
  9. };
  10. Object.defineProperty(BaseTexture.prototype, "sphericalPolynomial", {
  11. get: function () {
  12. if (this._texture) {
  13. if (this._texture._sphericalPolynomial || this._texture._sphericalPolynomialComputed) {
  14. return this._texture._sphericalPolynomial;
  15. }
  16. if (this._texture.isReady) {
  17. if (!this._texture._sphericalPolynomialPromise) {
  18. this._texture._sphericalPolynomialPromise = CubeMapToSphericalPolynomialTools.ConvertCubeMapTextureToSphericalPolynomial(this);
  19. if (this._texture._sphericalPolynomialPromise === null) {
  20. this._texture._sphericalPolynomialComputed = true;
  21. }
  22. else {
  23. this._texture._sphericalPolynomialPromise.then((sphericalPolynomial) => {
  24. this._texture._sphericalPolynomial = sphericalPolynomial;
  25. this._texture._sphericalPolynomialComputed = true;
  26. });
  27. }
  28. }
  29. return null;
  30. }
  31. }
  32. return null;
  33. },
  34. set: function (value) {
  35. if (this._texture) {
  36. this._texture._sphericalPolynomial = value;
  37. }
  38. },
  39. enumerable: true,
  40. configurable: true,
  41. });
  42. //# sourceMappingURL=baseTexture.polynomial.js.map