bbb4bc01a3d25026726d07a3e7873f5bb5836932f295582337670ba9cd482e68.json 8.1 KB

1
  1. {"ast":null,"code":"/** Defines the cross module constantsused by lights to avoid circular dependencies */\nexport class LightConstants {\n /**\n * Sort function to order lights for rendering.\n * @param a First Light object to compare to second.\n * @param b Second Light object to compare first.\n * @returns -1 to reduce's a's index relative to be, 0 for no change, 1 to increase a's index relative to b.\n */\n static CompareLightsPriority(a, b) {\n //shadow-casting lights have priority over non-shadow-casting lights\n //the renderPriority is a secondary sort criterion\n if (a.shadowEnabled !== b.shadowEnabled) {\n return (b.shadowEnabled ? 1 : 0) - (a.shadowEnabled ? 1 : 0);\n }\n return b.renderPriority - a.renderPriority;\n }\n}\n/**\n * Falloff Default: light is falling off following the material specification:\n * standard material is using standard falloff whereas pbr material can request special falloff per materials.\n */\nLightConstants.FALLOFF_DEFAULT = 0;\n/**\n * Falloff Physical: light is falling off following the inverse squared distance law.\n */\nLightConstants.FALLOFF_PHYSICAL = 1;\n/**\n * Falloff gltf: light is falling off as described in the gltf moving to PBR document\n * to enhance interoperability with other engines.\n */\nLightConstants.FALLOFF_GLTF = 2;\n/**\n * Falloff Standard: light is falling off like in the standard material\n * to enhance interoperability with other materials.\n */\nLightConstants.FALLOFF_STANDARD = 3;\n//lightmapMode Consts\n/**\n * If every light affecting the material is in this lightmapMode,\n * material.lightmapTexture adds or multiplies\n * (depends on material.useLightmapAsShadowmap)\n * after every other light calculations.\n */\nLightConstants.LIGHTMAP_DEFAULT = 0;\n/**\n * material.lightmapTexture as only diffuse lighting from this light\n * adds only specular lighting from this light\n * adds dynamic shadows\n */\nLightConstants.LIGHTMAP_SPECULAR = 1;\n/**\n * material.lightmapTexture as only lighting\n * no light calculation from this light\n * only adds dynamic shadows from this light\n */\nLightConstants.LIGHTMAP_SHADOWSONLY = 2;\n// Intensity Mode Consts\n/**\n * Each light type uses the default quantity according to its type:\n * point/spot lights use luminous intensity\n * directional lights use illuminance\n */\nLightConstants.INTENSITYMODE_AUTOMATIC = 0;\n/**\n * lumen (lm)\n */\nLightConstants.INTENSITYMODE_LUMINOUSPOWER = 1;\n/**\n * candela (lm/sr)\n */\nLightConstants.INTENSITYMODE_LUMINOUSINTENSITY = 2;\n/**\n * lux (lm/m^2)\n */\nLightConstants.INTENSITYMODE_ILLUMINANCE = 3;\n/**\n * nit (cd/m^2)\n */\nLightConstants.INTENSITYMODE_LUMINANCE = 4;\n// Light types ids const.\n/**\n * Light type const id of the point light.\n */\nLightConstants.LIGHTTYPEID_POINTLIGHT = 0;\n/**\n * Light type const id of the directional light.\n */\nLightConstants.LIGHTTYPEID_DIRECTIONALLIGHT = 1;\n/**\n * Light type const id of the spot light.\n */\nLightConstants.LIGHTTYPEID_SPOTLIGHT = 2;\n/**\n * Light type const id of the hemispheric light.\n */\nLightConstants.LIGHTTYPEID_HEMISPHERICLIGHT = 3;","map":{"version":3,"names":["LightConstants","CompareLightsPriority","a","b","shadowEnabled","renderPriority","FALLOFF_DEFAULT","FALLOFF_PHYSICAL","FALLOFF_GLTF","FALLOFF_STANDARD","LIGHTMAP_DEFAULT","LIGHTMAP_SPECULAR","LIGHTMAP_SHADOWSONLY","INTENSITYMODE_AUTOMATIC","INTENSITYMODE_LUMINOUSPOWER","INTENSITYMODE_LUMINOUSINTENSITY","INTENSITYMODE_ILLUMINANCE","INTENSITYMODE_LUMINANCE","LIGHTTYPEID_POINTLIGHT","LIGHTTYPEID_DIRECTIONALLIGHT","LIGHTTYPEID_SPOTLIGHT","LIGHTTYPEID_HEMISPHERICLIGHT"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/@babylonjs/core/Lights/lightConstants.js"],"sourcesContent":["/** Defines the cross module constantsused by lights to avoid circular dependencies */\nexport class LightConstants {\n /**\n * Sort function to order lights for rendering.\n * @param a First Light object to compare to second.\n * @param b Second Light object to compare first.\n * @returns -1 to reduce's a's index relative to be, 0 for no change, 1 to increase a's index relative to b.\n */\n static CompareLightsPriority(a, b) {\n //shadow-casting lights have priority over non-shadow-casting lights\n //the renderPriority is a secondary sort criterion\n if (a.shadowEnabled !== b.shadowEnabled) {\n return (b.shadowEnabled ? 1 : 0) - (a.shadowEnabled ? 1 : 0);\n }\n return b.renderPriority - a.renderPriority;\n }\n}\n/**\n * Falloff Default: light is falling off following the material specification:\n * standard material is using standard falloff whereas pbr material can request special falloff per materials.\n */\nLightConstants.FALLOFF_DEFAULT = 0;\n/**\n * Falloff Physical: light is falling off following the inverse squared distance law.\n */\nLightConstants.FALLOFF_PHYSICAL = 1;\n/**\n * Falloff gltf: light is falling off as described in the gltf moving to PBR document\n * to enhance interoperability with other engines.\n */\nLightConstants.FALLOFF_GLTF = 2;\n/**\n * Falloff Standard: light is falling off like in the standard material\n * to enhance interoperability with other materials.\n */\nLightConstants.FALLOFF_STANDARD = 3;\n//lightmapMode Consts\n/**\n * If every light affecting the material is in this lightmapMode,\n * material.lightmapTexture adds or multiplies\n * (depends on material.useLightmapAsShadowmap)\n * after every other light calculations.\n */\nLightConstants.LIGHTMAP_DEFAULT = 0;\n/**\n * material.lightmapTexture as only diffuse lighting from this light\n * adds only specular lighting from this light\n * adds dynamic shadows\n */\nLightConstants.LIGHTMAP_SPECULAR = 1;\n/**\n * material.lightmapTexture as only lighting\n * no light calculation from this light\n * only adds dynamic shadows from this light\n */\nLightConstants.LIGHTMAP_SHADOWSONLY = 2;\n// Intensity Mode Consts\n/**\n * Each light type uses the default quantity according to its type:\n * point/spot lights use luminous intensity\n * directional lights use illuminance\n */\nLightConstants.INTENSITYMODE_AUTOMATIC = 0;\n/**\n * lumen (lm)\n */\nLightConstants.INTENSITYMODE_LUMINOUSPOWER = 1;\n/**\n * candela (lm/sr)\n */\nLightConstants.INTENSITYMODE_LUMINOUSINTENSITY = 2;\n/**\n * lux (lm/m^2)\n */\nLightConstants.INTENSITYMODE_ILLUMINANCE = 3;\n/**\n * nit (cd/m^2)\n */\nLightConstants.INTENSITYMODE_LUMINANCE = 4;\n// Light types ids const.\n/**\n * Light type const id of the point light.\n */\nLightConstants.LIGHTTYPEID_POINTLIGHT = 0;\n/**\n * Light type const id of the directional light.\n */\nLightConstants.LIGHTTYPEID_DIRECTIONALLIGHT = 1;\n/**\n * Light type const id of the spot light.\n */\nLightConstants.LIGHTTYPEID_SPOTLIGHT = 2;\n/**\n * Light type const id of the hemispheric light.\n */\nLightConstants.LIGHTTYPEID_HEMISPHERICLIGHT = 3;\n"],"mappings":"AAAA;AACA,OAAO,MAAMA,cAAc,CAAC;EACxB;AACJ;AACA;AACA;AACA;AACA;EACI,OAAOC,qBAAqBA,CAACC,CAAC,EAAEC,CAAC,EAAE;IAC/B;IACA;IACA,IAAID,CAAC,CAACE,aAAa,KAAKD,CAAC,CAACC,aAAa,EAAE;MACrC,OAAO,CAACD,CAAC,CAACC,aAAa,GAAG,CAAC,GAAG,CAAC,KAAKF,CAAC,CAACE,aAAa,GAAG,CAAC,GAAG,CAAC,CAAC;IAChE;IACA,OAAOD,CAAC,CAACE,cAAc,GAAGH,CAAC,CAACG,cAAc;EAC9C;AACJ;AACA;AACA;AACA;AACA;AACAL,cAAc,CAACM,eAAe,GAAG,CAAC;AAClC;AACA;AACA;AACAN,cAAc,CAACO,gBAAgB,GAAG,CAAC;AACnC;AACA;AACA;AACA;AACAP,cAAc,CAACQ,YAAY,GAAG,CAAC;AAC/B;AACA;AACA;AACA;AACAR,cAAc,CAACS,gBAAgB,GAAG,CAAC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACAT,cAAc,CAACU,gBAAgB,GAAG,CAAC;AACnC;AACA;AACA;AACA;AACA;AACAV,cAAc,CAACW,iBAAiB,GAAG,CAAC;AACpC;AACA;AACA;AACA;AACA;AACAX,cAAc,CAACY,oBAAoB,GAAG,CAAC;AACvC;AACA;AACA;AACA;AACA;AACA;AACAZ,cAAc,CAACa,uBAAuB,GAAG,CAAC;AAC1C;AACA;AACA;AACAb,cAAc,CAACc,2BAA2B,GAAG,CAAC;AAC9C;AACA;AACA;AACAd,cAAc,CAACe,+BAA+B,GAAG,CAAC;AAClD;AACA;AACA;AACAf,cAAc,CAACgB,yBAAyB,GAAG,CAAC;AAC5C;AACA;AACA;AACAhB,cAAc,CAACiB,uBAAuB,GAAG,CAAC;AAC1C;AACA;AACA;AACA;AACAjB,cAAc,CAACkB,sBAAsB,GAAG,CAAC;AACzC;AACA;AACA;AACAlB,cAAc,CAACmB,4BAA4B,GAAG,CAAC;AAC/C;AACA;AACA;AACAnB,cAAc,CAACoB,qBAAqB,GAAG,CAAC;AACxC;AACA;AACA;AACApB,cAAc,CAACqB,4BAA4B,GAAG,CAAC","ignoreList":[]},"metadata":{},"sourceType":"module","externalDependencies":[]}