1 |
- {"ast":null,"code":"import { __decorate } from \"../../tslib.es6.js\";\nimport { serialize, serializeAsColor3, expandToProperty, serializeAsTexture } from \"../../Misc/decorators.js\";\nimport { Color3 } from \"../../Maths/math.color.js\";\nimport { PBRBaseMaterial } from \"./pbrBaseMaterial.js\";\n/**\n * The Physically based simple base material of BJS.\n *\n * This enables better naming and convention enforcements on top of the pbrMaterial.\n * It is used as the base class for both the specGloss and metalRough conventions.\n */\nexport class PBRBaseSimpleMaterial extends PBRBaseMaterial {\n /**\n * Gets the current double sided mode.\n */\n get doubleSided() {\n return this._twoSidedLighting;\n }\n /**\n * If sets to true and backfaceCulling is false, normals will be flipped on the backside.\n */\n set doubleSided(value) {\n if (this._twoSidedLighting === value) {\n return;\n }\n this._twoSidedLighting = value;\n this.backFaceCulling = !value;\n this._markAllSubMeshesAsTexturesDirty();\n }\n /**\n * Instantiates a new PBRMaterial instance.\n *\n * @param name The material name\n * @param scene The scene the material will be use in.\n */\n constructor(name, scene) {\n super(name, scene);\n /**\n * Number of Simultaneous lights allowed on the material.\n */\n this.maxSimultaneousLights = 4;\n /**\n * If sets to true, disables all the lights affecting the material.\n */\n this.disableLighting = false;\n /**\n * If sets to true, x component of normal map value will invert (x = 1.0 - x).\n */\n this.invertNormalMapX = false;\n /**\n * If sets to true, y component of normal map value will invert (y = 1.0 - y).\n */\n this.invertNormalMapY = false;\n /**\n * Emissivie color used to self-illuminate the model.\n */\n this.emissiveColor = new Color3(0, 0, 0);\n /**\n * Occlusion Channel Strength.\n */\n this.occlusionStrength = 1.0;\n /**\n * If true, the light map contains occlusion information instead of lighting info.\n */\n this.useLightmapAsShadowmap = false;\n this._useAlphaFromAlbedoTexture = true;\n this._useAmbientInGrayScale = true;\n }\n getClassName() {\n return \"PBRBaseSimpleMaterial\";\n }\n}\n__decorate([serialize(), expandToProperty(\"_markAllSubMeshesAsLightsDirty\")], PBRBaseSimpleMaterial.prototype, \"maxSimultaneousLights\", void 0);\n__decorate([serialize(), expandToProperty(\"_markAllSubMeshesAsLightsDirty\")], PBRBaseSimpleMaterial.prototype, \"disableLighting\", void 0);\n__decorate([serializeAsTexture(), expandToProperty(\"_markAllSubMeshesAsTexturesDirty\", \"_reflectionTexture\")], PBRBaseSimpleMaterial.prototype, \"environmentTexture\", void 0);\n__decorate([serialize(), expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")], PBRBaseSimpleMaterial.prototype, \"invertNormalMapX\", void 0);\n__decorate([serialize(), expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")], PBRBaseSimpleMaterial.prototype, \"invertNormalMapY\", void 0);\n__decorate([serializeAsTexture(), expandToProperty(\"_markAllSubMeshesAsTexturesDirty\", \"_bumpTexture\")], PBRBaseSimpleMaterial.prototype, \"normalTexture\", void 0);\n__decorate([serializeAsColor3(\"emissive\"), expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")], PBRBaseSimpleMaterial.prototype, \"emissiveColor\", void 0);\n__decorate([serializeAsTexture(), expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")], PBRBaseSimpleMaterial.prototype, \"emissiveTexture\", void 0);\n__decorate([serialize(), expandToProperty(\"_markAllSubMeshesAsTexturesDirty\", \"_ambientTextureStrength\")], PBRBaseSimpleMaterial.prototype, \"occlusionStrength\", void 0);\n__decorate([serializeAsTexture(), expandToProperty(\"_markAllSubMeshesAsTexturesDirty\", \"_ambientTexture\")], PBRBaseSimpleMaterial.prototype, \"occlusionTexture\", void 0);\n__decorate([serialize(), expandToProperty(\"_markAllSubMeshesAsTexturesDirty\", \"_alphaCutOff\")], PBRBaseSimpleMaterial.prototype, \"alphaCutOff\", void 0);\n__decorate([serialize()], PBRBaseSimpleMaterial.prototype, \"doubleSided\", null);\n__decorate([serializeAsTexture(), expandToProperty(\"_markAllSubMeshesAsTexturesDirty\", null)], PBRBaseSimpleMaterial.prototype, \"lightmapTexture\", void 0);\n__decorate([serialize(), expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")], PBRBaseSimpleMaterial.prototype, \"useLightmapAsShadowmap\", void 0);","map":{"version":3,"names":["__decorate","serialize","serializeAsColor3","expandToProperty","serializeAsTexture","Color3","PBRBaseMaterial","PBRBaseSimpleMaterial","doubleSided","_twoSidedLighting","value","backFaceCulling","_markAllSubMeshesAsTexturesDirty","constructor","name","scene","maxSimultaneousLights","disableLighting","invertNormalMapX","invertNormalMapY","emissiveColor","occlusionStrength","useLightmapAsShadowmap","_useAlphaFromAlbedoTexture","_useAmbientInGrayScale","getClassName","prototype"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/@babylonjs/core/Materials/PBR/pbrBaseSimpleMaterial.js"],"sourcesContent":["import { __decorate } from \"../../tslib.es6.js\";\nimport { serialize, serializeAsColor3, expandToProperty, serializeAsTexture } from \"../../Misc/decorators.js\";\nimport { Color3 } from \"../../Maths/math.color.js\";\nimport { PBRBaseMaterial } from \"./pbrBaseMaterial.js\";\n/**\n * The Physically based simple base material of BJS.\n *\n * This enables better naming and convention enforcements on top of the pbrMaterial.\n * It is used as the base class for both the specGloss and metalRough conventions.\n */\nexport class PBRBaseSimpleMaterial extends PBRBaseMaterial {\n /**\n * Gets the current double sided mode.\n */\n get doubleSided() {\n return this._twoSidedLighting;\n }\n /**\n * If sets to true and backfaceCulling is false, normals will be flipped on the backside.\n */\n set doubleSided(value) {\n if (this._twoSidedLighting === value) {\n return;\n }\n this._twoSidedLighting = value;\n this.backFaceCulling = !value;\n this._markAllSubMeshesAsTexturesDirty();\n }\n /**\n * Instantiates a new PBRMaterial instance.\n *\n * @param name The material name\n * @param scene The scene the material will be use in.\n */\n constructor(name, scene) {\n super(name, scene);\n /**\n * Number of Simultaneous lights allowed on the material.\n */\n this.maxSimultaneousLights = 4;\n /**\n * If sets to true, disables all the lights affecting the material.\n */\n this.disableLighting = false;\n /**\n * If sets to true, x component of normal map value will invert (x = 1.0 - x).\n */\n this.invertNormalMapX = false;\n /**\n * If sets to true, y component of normal map value will invert (y = 1.0 - y).\n */\n this.invertNormalMapY = false;\n /**\n * Emissivie color used to self-illuminate the model.\n */\n this.emissiveColor = new Color3(0, 0, 0);\n /**\n * Occlusion Channel Strength.\n */\n this.occlusionStrength = 1.0;\n /**\n * If true, the light map contains occlusion information instead of lighting info.\n */\n this.useLightmapAsShadowmap = false;\n this._useAlphaFromAlbedoTexture = true;\n this._useAmbientInGrayScale = true;\n }\n getClassName() {\n return \"PBRBaseSimpleMaterial\";\n }\n}\n__decorate([\n serialize(),\n expandToProperty(\"_markAllSubMeshesAsLightsDirty\")\n], PBRBaseSimpleMaterial.prototype, \"maxSimultaneousLights\", void 0);\n__decorate([\n serialize(),\n expandToProperty(\"_markAllSubMeshesAsLightsDirty\")\n], PBRBaseSimpleMaterial.prototype, \"disableLighting\", void 0);\n__decorate([\n serializeAsTexture(),\n expandToProperty(\"_markAllSubMeshesAsTexturesDirty\", \"_reflectionTexture\")\n], PBRBaseSimpleMaterial.prototype, \"environmentTexture\", void 0);\n__decorate([\n serialize(),\n expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\n], PBRBaseSimpleMaterial.prototype, \"invertNormalMapX\", void 0);\n__decorate([\n serialize(),\n expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\n], PBRBaseSimpleMaterial.prototype, \"invertNormalMapY\", void 0);\n__decorate([\n serializeAsTexture(),\n expandToProperty(\"_markAllSubMeshesAsTexturesDirty\", \"_bumpTexture\")\n], PBRBaseSimpleMaterial.prototype, \"normalTexture\", void 0);\n__decorate([\n serializeAsColor3(\"emissive\"),\n expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\n], PBRBaseSimpleMaterial.prototype, \"emissiveColor\", void 0);\n__decorate([\n serializeAsTexture(),\n expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\n], PBRBaseSimpleMaterial.prototype, \"emissiveTexture\", void 0);\n__decorate([\n serialize(),\n expandToProperty(\"_markAllSubMeshesAsTexturesDirty\", \"_ambientTextureStrength\")\n], PBRBaseSimpleMaterial.prototype, \"occlusionStrength\", void 0);\n__decorate([\n serializeAsTexture(),\n expandToProperty(\"_markAllSubMeshesAsTexturesDirty\", \"_ambientTexture\")\n], PBRBaseSimpleMaterial.prototype, \"occlusionTexture\", void 0);\n__decorate([\n serialize(),\n expandToProperty(\"_markAllSubMeshesAsTexturesDirty\", \"_alphaCutOff\")\n], PBRBaseSimpleMaterial.prototype, \"alphaCutOff\", void 0);\n__decorate([\n serialize()\n], PBRBaseSimpleMaterial.prototype, \"doubleSided\", null);\n__decorate([\n serializeAsTexture(),\n expandToProperty(\"_markAllSubMeshesAsTexturesDirty\", null)\n], PBRBaseSimpleMaterial.prototype, \"lightmapTexture\", void 0);\n__decorate([\n serialize(),\n expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\n], PBRBaseSimpleMaterial.prototype, \"useLightmapAsShadowmap\", void 0);\n"],"mappings":"AAAA,SAASA,UAAU,QAAQ,oBAAoB;AAC/C,SAASC,SAAS,EAAEC,iBAAiB,EAAEC,gBAAgB,EAAEC,kBAAkB,QAAQ,0BAA0B;AAC7G,SAASC,MAAM,QAAQ,2BAA2B;AAClD,SAASC,eAAe,QAAQ,sBAAsB;AACtD;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,qBAAqB,SAASD,eAAe,CAAC;EACvD;AACJ;AACA;EACI,IAAIE,WAAWA,CAAA,EAAG;IACd,OAAO,IAAI,CAACC,iBAAiB;EACjC;EACA;AACJ;AACA;EACI,IAAID,WAAWA,CAACE,KAAK,EAAE;IACnB,IAAI,IAAI,CAACD,iBAAiB,KAAKC,KAAK,EAAE;MAClC;IACJ;IACA,IAAI,CAACD,iBAAiB,GAAGC,KAAK;IAC9B,IAAI,CAACC,eAAe,GAAG,CAACD,KAAK;IAC7B,IAAI,CAACE,gCAAgC,CAAC,CAAC;EAC3C;EACA;AACJ;AACA;AACA;AACA;AACA;EACIC,WAAWA,CAACC,IAAI,EAAEC,KAAK,EAAE;IACrB,KAAK,CAACD,IAAI,EAAEC,KAAK,CAAC;IAClB;AACR;A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