659a12f2a789980421c7136874e4ef41c0a1bea6cf8f49ca9f35483fdf9ae20e.json 11 KB

1
  1. {"ast":null,"code":"/**\n * Class used to store a texture sampler data\n */\nexport class TextureSampler {\n /**\n * | Value | Type | Description |\n * | ----- | ------------------ | ----------- |\n * | 0 | CLAMP_ADDRESSMODE | |\n * | 1 | WRAP_ADDRESSMODE | |\n * | 2 | MIRROR_ADDRESSMODE | |\n */\n get wrapU() {\n return this._cachedWrapU;\n }\n set wrapU(value) {\n this._cachedWrapU = value;\n }\n /**\n * | Value | Type | Description |\n * | ----- | ------------------ | ----------- |\n * | 0 | CLAMP_ADDRESSMODE | |\n * | 1 | WRAP_ADDRESSMODE | |\n * | 2 | MIRROR_ADDRESSMODE | |\n */\n get wrapV() {\n return this._cachedWrapV;\n }\n set wrapV(value) {\n this._cachedWrapV = value;\n }\n /**\n * | Value | Type | Description |\n * | ----- | ------------------ | ----------- |\n * | 0 | CLAMP_ADDRESSMODE | |\n * | 1 | WRAP_ADDRESSMODE | |\n * | 2 | MIRROR_ADDRESSMODE | |\n */\n get wrapR() {\n return this._cachedWrapR;\n }\n set wrapR(value) {\n this._cachedWrapR = value;\n }\n /**\n * With compliant hardware and browser (supporting anisotropic filtering)\n * this defines the level of anisotropic filtering in the texture.\n * The higher the better but the slower.\n */\n get anisotropicFilteringLevel() {\n return this._cachedAnisotropicFilteringLevel;\n }\n set anisotropicFilteringLevel(value) {\n this._cachedAnisotropicFilteringLevel = value;\n }\n /**\n * Gets or sets the comparison function (513, 514, etc). Set 0 to not use a comparison function\n */\n get comparisonFunction() {\n return this._comparisonFunction;\n }\n set comparisonFunction(value) {\n this._comparisonFunction = value;\n }\n /**\n * Indicates to use the mip maps (if available on the texture).\n * Thanks to this flag, you can instruct the sampler to not sample the mipmaps even if they exist (and if the sampling mode is set to a value that normally samples the mipmaps!)\n */\n get useMipMaps() {\n return this._useMipMaps;\n }\n set useMipMaps(value) {\n this._useMipMaps = value;\n }\n /**\n * Creates a Sampler instance\n */\n constructor() {\n /**\n * Gets the sampling mode of the texture\n */\n this.samplingMode = -1;\n this._useMipMaps = true;\n /** @internal */\n this._cachedWrapU = null;\n /** @internal */\n this._cachedWrapV = null;\n /** @internal */\n this._cachedWrapR = null;\n /** @internal */\n this._cachedAnisotropicFilteringLevel = null;\n /** @internal */\n this._comparisonFunction = 0;\n }\n /**\n * Sets all the parameters of the sampler\n * @param wrapU u address mode (default: TEXTURE_WRAP_ADDRESSMODE)\n * @param wrapV v address mode (default: TEXTURE_WRAP_ADDRESSMODE)\n * @param wrapR r address mode (default: TEXTURE_WRAP_ADDRESSMODE)\n * @param anisotropicFilteringLevel anisotropic level (default: 1)\n * @param samplingMode sampling mode (default: 2)\n * @param comparisonFunction comparison function (default: 0 - no comparison function)\n * @returns the current sampler instance\n */\n setParameters(wrapU = 1, wrapV = 1, wrapR = 1, anisotropicFilteringLevel = 1, samplingMode = 2, comparisonFunction = 0) {\n this._cachedWrapU = wrapU;\n this._cachedWrapV = wrapV;\n this._cachedWrapR = wrapR;\n this._cachedAnisotropicFilteringLevel = anisotropicFilteringLevel;\n this.samplingMode = samplingMode;\n this._comparisonFunction = comparisonFunction;\n return this;\n }\n /**\n * Compares this sampler with another one\n * @param other sampler to compare with\n * @returns true if the samplers have the same parametres, else false\n */\n compareSampler(other) {\n return this._cachedWrapU === other._cachedWrapU && this._cachedWrapV === other._cachedWrapV && this._cachedWrapR === other._cachedWrapR && this._cachedAnisotropicFilteringLevel === other._cachedAnisotropicFilteringLevel && this.samplingMode === other.samplingMode && this._comparisonFunction === other._comparisonFunction && this._useMipMaps === other._useMipMaps;\n }\n}","map":{"version":3,"names":["TextureSampler","wrapU","_cachedWrapU","value","wrapV","_cachedWrapV","wrapR","_cachedWrapR","anisotropicFilteringLevel","_cachedAnisotropicFilteringLevel","comparisonFunction","_comparisonFunction","useMipMaps","_useMipMaps","constructor","samplingMode","setParameters","compareSampler","other"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/@babylonjs/core/Materials/Textures/textureSampler.js"],"sourcesContent":["\n/**\n * Class used to store a texture sampler data\n */\nexport class TextureSampler {\n /**\n * | Value | Type | Description |\n * | ----- | ------------------ | ----------- |\n * | 0 | CLAMP_ADDRESSMODE | |\n * | 1 | WRAP_ADDRESSMODE | |\n * | 2 | MIRROR_ADDRESSMODE | |\n */\n get wrapU() {\n return this._cachedWrapU;\n }\n set wrapU(value) {\n this._cachedWrapU = value;\n }\n /**\n * | Value | Type | Description |\n * | ----- | ------------------ | ----------- |\n * | 0 | CLAMP_ADDRESSMODE | |\n * | 1 | WRAP_ADDRESSMODE | |\n * | 2 | MIRROR_ADDRESSMODE | |\n */\n get wrapV() {\n return this._cachedWrapV;\n }\n set wrapV(value) {\n this._cachedWrapV = value;\n }\n /**\n * | Value | Type | Description |\n * | ----- | ------------------ | ----------- |\n * | 0 | CLAMP_ADDRESSMODE | |\n * | 1 | WRAP_ADDRESSMODE | |\n * | 2 | MIRROR_ADDRESSMODE | |\n */\n get wrapR() {\n return this._cachedWrapR;\n }\n set wrapR(value) {\n this._cachedWrapR = value;\n }\n /**\n * With compliant hardware and browser (supporting anisotropic filtering)\n * this defines the level of anisotropic filtering in the texture.\n * The higher the better but the slower.\n */\n get anisotropicFilteringLevel() {\n return this._cachedAnisotropicFilteringLevel;\n }\n set anisotropicFilteringLevel(value) {\n this._cachedAnisotropicFilteringLevel = value;\n }\n /**\n * Gets or sets the comparison function (513, 514, etc). Set 0 to not use a comparison function\n */\n get comparisonFunction() {\n return this._comparisonFunction;\n }\n set comparisonFunction(value) {\n this._comparisonFunction = value;\n }\n /**\n * Indicates to use the mip maps (if available on the texture).\n * Thanks to this flag, you can instruct the sampler to not sample the mipmaps even if they exist (and if the sampling mode is set to a value that normally samples the mipmaps!)\n */\n get useMipMaps() {\n return this._useMipMaps;\n }\n set useMipMaps(value) {\n this._useMipMaps = value;\n }\n /**\n * Creates a Sampler instance\n */\n constructor() {\n /**\n * Gets the sampling mode of the texture\n */\n this.samplingMode = -1;\n this._useMipMaps = true;\n /** @internal */\n this._cachedWrapU = null;\n /** @internal */\n this._cachedWrapV = null;\n /** @internal */\n this._cachedWrapR = null;\n /** @internal */\n this._cachedAnisotropicFilteringLevel = null;\n /** @internal */\n this._comparisonFunction = 0;\n }\n /**\n * Sets all the parameters of the sampler\n * @param wrapU u address mode (default: TEXTURE_WRAP_ADDRESSMODE)\n * @param wrapV v address mode (default: TEXTURE_WRAP_ADDRESSMODE)\n * @param wrapR r address mode (default: TEXTURE_WRAP_ADDRESSMODE)\n * @param anisotropicFilteringLevel anisotropic level (default: 1)\n * @param samplingMode sampling mode (default: 2)\n * @param comparisonFunction comparison function (default: 0 - no comparison function)\n * @returns the current sampler instance\n */\n setParameters(wrapU = 1, wrapV = 1, wrapR = 1, anisotropicFilteringLevel = 1, samplingMode = 2, comparisonFunction = 0) {\n this._cachedWrapU = wrapU;\n this._cachedWrapV = wrapV;\n this._cachedWrapR = wrapR;\n this._cachedAnisotropicFilteringLevel = anisotropicFilteringLevel;\n this.samplingMode = samplingMode;\n this._comparisonFunction = comparisonFunction;\n return this;\n }\n /**\n * Compares this sampler with another one\n * @param other sampler to compare with\n * @returns true if the samplers have the same parametres, else false\n */\n compareSampler(other) {\n return (this._cachedWrapU === other._cachedWrapU &&\n this._cachedWrapV === other._cachedWrapV &&\n this._cachedWrapR === other._cachedWrapR &&\n this._cachedAnisotropicFilteringLevel === other._cachedAnisotropicFilteringLevel &&\n this.samplingMode === other.samplingMode &&\n this._comparisonFunction === other._comparisonFunction &&\n this._useMipMaps === other._useMipMaps);\n }\n}\n"],"mappings":"AACA;AACA;AACA;AACA,OAAO,MAAMA,cAAc,CAAC;EACxB;AACJ;AACA;AACA;AACA;AACA;AACA;EACI,IAAIC,KAAKA,CAAA,EAAG;IACR,OAAO,IAAI,CAACC,YAAY;EAC5B;EACA,IAAID,KAAKA,CAACE,KAAK,EAAE;IACb,IAAI,CAACD,YAAY,GAAGC,KAAK;EAC7B;EACA;AACJ;AACA;AACA;AACA;A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A;AACA;AACA;AACA;AACA;AACA;AACA;EACIK,aAAaA,CAACf,KAAK,GAAG,CAAC,EAAEG,KAAK,GAAG,CAAC,EAAEE,KAAK,GAAG,CAAC,EAAEE,yBAAyB,GAAG,CAAC,EAAEO,YAAY,GAAG,CAAC,EAAEL,kBAAkB,GAAG,CAAC,EAAE;IACpH,IAAI,CAACR,YAAY,GAAGD,KAAK;IACzB,IAAI,CAACI,YAAY,GAAGD,KAAK;IACzB,IAAI,CAACG,YAAY,GAAGD,KAAK;IACzB,IAAI,CAACG,gCAAgC,GAAGD,yBAAyB;IACjE,IAAI,CAACO,YAAY,GAAGA,YAAY;IAChC,IAAI,CAACJ,mBAAmB,GAAGD,kBAAkB;IAC7C,OAAO,IAAI;EACf;EACA;AACJ;AACA;AACA;AACA;EACIO,cAAcA,CAACC,KAAK,EAAE;IAClB,OAAQ,IAAI,CAAChB,YAAY,KAAKgB,KAAK,CAAChB,YAAY,IAC5C,IAAI,CAACG,YAAY,KAAKa,KAAK,CAACb,YAAY,IACxC,IAAI,CAACE,YAAY,KAAKW,KAAK,CAACX,YAAY,IACxC,IAAI,CAACE,gCAAgC,KAAKS,KAAK,CAACT,gCAAgC,IAChF,IAAI,CAACM,YAAY,KAAKG,KAAK,CAACH,YAAY,IACxC,IAAI,CAACJ,mBAAmB,KAAKO,KAAK,CAACP,mBAAmB,IACtD,IAAI,CAACE,WAAW,KAAKK,KAAK,CAACL,WAAW;EAC9C;AACJ","ignoreList":[]},"metadata":{},"sourceType":"module","externalDependencies":[]}