csyjk 1.2.2 → 2.2.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (322) hide show
  1. package/{dist/app.js → app.js} +0 -0
  2. package/{dist/index.html → index.html} +0 -0
  3. package/package.json +5 -40
  4. package/{dist/style.css → style.css} +0 -0
  5. package/.babelrc +0 -7
  6. package/.idea/modules.xml +0 -8
  7. package/.idea/xx.iml +0 -12
  8. package/public/gltf.js +0 -2241
  9. package/public/index.html +0 -10
  10. package/src/index.js +0 -3
  11. package/src/lib/gltf/assets/check.jpg +0 -0
  12. package/src/lib/gltf/assets/iconfont/iconfont.css +0 -358
  13. package/src/lib/gltf/assets/iconfont/iconfont.eot +0 -0
  14. package/src/lib/gltf/assets/iconfont/iconfont.js +0 -1
  15. package/src/lib/gltf/assets/iconfont/iconfont.json +0 -604
  16. package/src/lib/gltf/assets/iconfont/iconfont.svg +0 -189
  17. package/src/lib/gltf/assets/iconfont/iconfont.ttf +0 -0
  18. package/src/lib/gltf/assets/iconfont/iconfont.woff +0 -0
  19. package/src/lib/gltf/assets/iconfont/iconfont.woff2 +0 -0
  20. package/src/lib/gltf/assets/yjkkit-sdk/index.js +0 -0
  21. package/src/lib/gltf/assets/yjkkit-sdk/package.json +0 -15
  22. package/src/lib/gltf/assets/yjkkit-sdk/src/extras/ContextMenu/ContextMenu.js +0 -863
  23. package/src/lib/gltf/assets/yjkkit-sdk/src/extras/ContextMenu/index.js +0 -1
  24. package/src/lib/gltf/assets/yjkkit-sdk/src/extras/index.js +0 -1
  25. package/src/lib/gltf/assets/yjkkit-sdk/src/index.js +0 -3
  26. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/AngleMeasurementsPlugin/AngleMeasurement.js +0 -462
  27. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/AngleMeasurementsPlugin/AngleMeasurementsControl.js +0 -279
  28. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/AngleMeasurementsPlugin/AngleMeasurementsPlugin.js +0 -262
  29. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/AngleMeasurementsPlugin/index.js +0 -1
  30. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/AnnotationsPlugin/Annotation.js +0 -362
  31. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/AnnotationsPlugin/AnnotationsPlugin.js +0 -575
  32. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/AnnotationsPlugin/index.js +0 -1
  33. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/AxisGizmoPlugin/AxisGizmoPlugin.js +0 -333
  34. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/AxisGizmoPlugin/index.js +0 -1
  35. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/BCFViewpointsPlugin/BCFViewpointsPlugin.js +0 -777
  36. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/BCFViewpointsPlugin/index.js +0 -1
  37. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/DistanceMeasurementsPlugin/DistanceMeasurement.js +0 -525
  38. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/DistanceMeasurementsPlugin/DistanceMeasurementsControl.js +0 -242
  39. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/DistanceMeasurementsPlugin/DistanceMeasurementsPlugin.js +0 -297
  40. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/DistanceMeasurementsPlugin/index.js +0 -1
  41. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/FastNavPlugin/FastNavPlugin.js +0 -345
  42. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/FastNavPlugin/index.js +0 -1
  43. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/GLTFLoaderPlugin/GLTFDefaultDataSource.js +0 -122
  44. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/GLTFLoaderPlugin/GLTFLoaderPlugin.js +0 -462
  45. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/GLTFLoaderPlugin/GLTFPerformanceModelLoader.js +0 -508
  46. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/GLTFLoaderPlugin/GLTFSceneGraphLoader.js +0 -922
  47. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/GLTFLoaderPlugin/index.js +0 -2
  48. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/NavCubePlugin/CubeTextureCanvas.js +0 -273
  49. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/NavCubePlugin/NavCubePlugin.js +0 -687
  50. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/NavCubePlugin/index.js +0 -1
  51. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/OBJLoaderPlugin/OBJLoaderPlugin.js +0 -145
  52. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/OBJLoaderPlugin/OBJSceneGraphLoader.js +0 -777
  53. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/OBJLoaderPlugin/index.js +0 -1
  54. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/STLLoaderPlugin/STLDefaultDataSource.js +0 -33
  55. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/STLLoaderPlugin/STLLoaderPlugin.js +0 -273
  56. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/STLLoaderPlugin/STLSceneGraphLoader.js +0 -313
  57. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/STLLoaderPlugin/index.js +0 -2
  58. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/SectionPlanesPlugin/Control.js +0 -1328
  59. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/SectionPlanesPlugin/Overview.js +0 -249
  60. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/SectionPlanesPlugin/Plane.js +0 -169
  61. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/SectionPlanesPlugin/SectionPlanesPlugin.js +0 -403
  62. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/SectionPlanesPlugin/index.js +0 -1
  63. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/SkyboxesPlugin/SkyboxesPlugin.js +0 -134
  64. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/SkyboxesPlugin/index.js +0 -1
  65. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/StoreyViewsPlugin/IFCStoreyPlanObjectStates.js +0 -77
  66. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/StoreyViewsPlugin/Storey.js +0 -61
  67. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/StoreyViewsPlugin/StoreyMap.js +0 -57
  68. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/StoreyViewsPlugin/StoreyViewsPlugin.js +0 -822
  69. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/StoreyViewsPlugin/index.js +0 -1
  70. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/TreeViewPlugin/ModelTreeView.js +0 -888
  71. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/TreeViewPlugin/TreeViewNode.js +0 -88
  72. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/TreeViewPlugin/TreeViewPlugin.js +0 -624
  73. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/TreeViewPlugin/index.js +0 -1
  74. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/TreeViewPlugin/modelValidation.js +0 -87
  75. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/ViewCullPlugin/ViewCullPlugin.js +0 -295
  76. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/ViewCullPlugin/index.js +0 -1
  77. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XKTLoaderPlugin/XKTDefaultDataSource.js +0 -78
  78. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XKTLoaderPlugin/XKTLoaderPlugin.js +0 -847
  79. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XKTLoaderPlugin/index.js +0 -2
  80. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XKTLoaderPlugin/parsers/ParserV1.js +0 -167
  81. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XKTLoaderPlugin/parsers/ParserV2.js +0 -228
  82. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XKTLoaderPlugin/parsers/ParserV3.js +0 -220
  83. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XKTLoaderPlugin/parsers/ParserV4.js +0 -279
  84. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XKTLoaderPlugin/parsers/ParserV5.js +0 -244
  85. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XKTLoaderPlugin/parsers/ParserV6.js +0 -301
  86. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XKTLoaderPlugin/parsers/ParserV7.js +0 -426
  87. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XKTLoaderPlugin/parsers/ParserV8.js +0 -479
  88. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XKTLoaderPlugin/parsers/lib/pako.js +0 -6818
  89. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XML3DLoaderPlugin/XML3DLoaderPlugin.js +0 -238
  90. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XML3DLoaderPlugin/XML3DSceneGraphLoader.js +0 -1279
  91. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XML3DLoaderPlugin/index.js +0 -1
  92. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XML3DLoaderPlugin/zipjs/.jshintrc +0 -11
  93. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XML3DLoaderPlugin/zipjs/deflate.js +0 -2060
  94. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XML3DLoaderPlugin/zipjs/inflate.js +0 -2155
  95. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XML3DLoaderPlugin/zipjs/mime-types.js +0 -1002
  96. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XML3DLoaderPlugin/zipjs/pako/codecs.js +0 -64
  97. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XML3DLoaderPlugin/zipjs/z-worker.js +0 -153
  98. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XML3DLoaderPlugin/zipjs/zip-ext.js +0 -267
  99. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XML3DLoaderPlugin/zipjs/zip-fs.js +0 -553
  100. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XML3DLoaderPlugin/zipjs/zip.js +0 -991
  101. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/XML3DLoaderPlugin/zipjs/zlib-asm/codecs.js +0 -49
  102. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/index.js +0 -17
  103. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/lib/culling/ObjectCullStates.js +0 -205
  104. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/lib/html/Dot.js +0 -78
  105. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/lib/html/Label.js +0 -97
  106. package/src/lib/gltf/assets/yjkkit-sdk/src/plugins/lib/html/Wire.js +0 -95
  107. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/Plugin.js +0 -112
  108. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/Viewer.js +0 -372
  109. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/index.js +0 -3
  110. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/metadata/IFCObjectDefaultColors.js +0 -162
  111. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/metadata/IFCObjectDefaults.js +0 -39
  112. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/metadata/MetaModel.js +0 -145
  113. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/metadata/MetaObject.js +0 -215
  114. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/metadata/MetaScene.js +0 -311
  115. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/CameraControl.js +0 -1669
  116. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/cc.js +0 -0
  117. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/lib/CameraUpdater.js +0 -312
  118. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/lib/controllers/PanController.js +0 -112
  119. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/lib/controllers/PickController.js +0 -193
  120. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/lib/controllers/PivotController.js +0 -289
  121. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/lib/cu.js +0 -0
  122. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/lib/handlers/KeyboardAxisViewHandler.js +0 -122
  123. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/lib/handlers/KeyboardPanRotateDollyHandler.js +0 -186
  124. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/lib/handlers/MouseMiscHandler.js +0 -68
  125. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/lib/handlers/MousePanRotateDollyHandler.js +0 -439
  126. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/lib/handlers/MousePickHandler.js +0 -361
  127. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/lib/handlers/TouchPanRotateAndDollyHandler.js +0 -258
  128. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/lib/handlers/TouchPickHandler.js +0 -197
  129. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/CameraControl/lib/handlers/mouspan.js +0 -498
  130. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/Component.js +0 -908
  131. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/Entity.js +0 -475
  132. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/ImagePlane/ImagePlane.js +0 -570
  133. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/ImagePlane/index.js +0 -1
  134. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/PerformanceModel.js +0 -2623
  135. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/index.js +0 -1
  136. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/ENTITY_FLAGS.js +0 -21
  137. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/PerformanceMesh.js +0 -262
  138. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/PerformanceNode.js +0 -697
  139. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/RENDER_PASSES.js +0 -34
  140. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/ScratchMemory.js +0 -63
  141. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/compression.js +0 -183
  142. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/linesBatching/LinesBatchingBuffer.js +0 -33
  143. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/linesBatching/LinesBatchingLayer.js +0 -736
  144. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/linesBatching/LinesBatchingRenderers.js +0 -68
  145. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/linesBatching/renderers/LinesBatchingColorRenderer.js +0 -295
  146. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/linesBatching/renderers/LinesBatchingSilhouetteRenderer.js +0 -327
  147. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/linesInstancing/LinesInstancingLayer.js +0 -698
  148. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/linesInstancing/LinesInstancingRenderers.js +0 -68
  149. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/linesInstancing/renderers/LinesInstancingColorRenderer.js +0 -364
  150. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/linesInstancing/renderers/LinesInstancingSilhouetteRenderer.js +0 -356
  151. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsBatching/PointsBatchingBuffer.js +0 -33
  152. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsBatching/PointsBatchingLayer.js +0 -776
  153. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsBatching/PointsBatchingRenderers.js +0 -113
  154. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsBatching/renderers/PointsBatchingColorRenderer.js +0 -340
  155. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsBatching/renderers/PointsBatchingOcclusionRenderer.js +0 -312
  156. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsBatching/renderers/PointsBatchingPickDepthRenderer.js +0 -343
  157. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsBatching/renderers/PointsBatchingPickMeshRenderer.js +0 -331
  158. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsBatching/renderers/PointsBatchingShadowRenderer.js +0 -242
  159. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsBatching/renderers/PointsBatchingSilhouetteRenderer.js +0 -348
  160. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsInstancing/PointsInstancingLayer.js +0 -737
  161. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsInstancing/PointsInstancingRenderers.js +0 -143
  162. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsInstancing/renderers/PointsInstancingColorRenderer.js +0 -373
  163. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsInstancing/renderers/PointsInstancingDepthRenderer.js +0 -366
  164. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsInstancing/renderers/PointsInstancingOcclusionRenderer.js +0 -370
  165. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsInstancing/renderers/PointsInstancingPickDepthRenderer.js +0 -386
  166. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsInstancing/renderers/PointsInstancingPickMeshRenderer.js +0 -376
  167. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsInstancing/renderers/PointsInstancingShadowRenderer.js +0 -293
  168. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/pointsInstancing/renderers/PointsInstancingSilhouetteRenderer.js +0 -382
  169. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/TrianglesBatchingBuffer.js +0 -37
  170. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/TrianglesBatchingLayer.js +0 -1017
  171. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/TrianglesBatchingRenderers.js +0 -246
  172. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/renderers/TrianglesBatchingColorQualityRenderer.js +0 -809
  173. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/renderers/TrianglesBatchingColorRenderer.js +0 -504
  174. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/renderers/TrianglesBatchingDepthRenderer.js +0 -297
  175. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/renderers/TrianglesBatchingEdgesColorRenderer.js +0 -300
  176. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/renderers/TrianglesBatchingEdgesRenderer.js +0 -322
  177. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/renderers/TrianglesBatchingNormalsRenderer.js +0 -311
  178. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/renderers/TrianglesBatchingOcclusionRenderer.js +0 -291
  179. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/renderers/TrianglesBatchingPickDepthRenderer.js +0 -319
  180. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/renderers/TrianglesBatchingPickMeshRenderer.js +0 -305
  181. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/renderers/TrianglesBatchingPickNormalsRenderer.js +0 -300
  182. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/renderers/TrianglesBatchingShadowRenderer.js +0 -242
  183. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesBatching/renderers/TrianglesBatchingSilhouetteRenderer.js +0 -323
  184. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/TrianglesInstancingLayer.js +0 -969
  185. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/TrianglesInstancingRenderers.js +0 -246
  186. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/renderers/TrianglesInstancingColorQualityRenderer.js +0 -859
  187. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/renderers/TrianglesInstancingColorRenderer.js +0 -557
  188. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/renderers/TrianglesInstancingDepthRenderer.js +0 -341
  189. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/renderers/TrianglesInstancingEdgesColorRenderer.js +0 -338
  190. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/renderers/TrianglesInstancingEdgesRenderer.js +0 -356
  191. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/renderers/TrianglesInstancingNormalsRenderer.js +0 -354
  192. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/renderers/TrianglesInstancingOcclusionRenderer.js +0 -329
  193. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/renderers/TrianglesInstancingPickDepthRenderer.js +0 -358
  194. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/renderers/TrianglesInstancingPickMeshRenderer.js +0 -349
  195. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/renderers/TrianglesInstancingPickNormalsRenderer.js +0 -363
  196. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/renderers/TrianglesInstancingShadowRenderer.js +0 -284
  197. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/PerformanceModel/lib/layers/trianglesInstancing/renderers/TrianglesInstancingSilhouetteRenderer.js +0 -354
  198. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/camera/Camera.js +0 -880
  199. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/camera/CameraFlightAnimation.js +0 -669
  200. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/camera/CameraPath.js +0 -194
  201. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/camera/CameraPathAnimation.js +0 -326
  202. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/camera/CustomProjection.js +0 -149
  203. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/camera/Frustum.js +0 -316
  204. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/camera/Ortho.js +0 -286
  205. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/camera/Perspective.js +0 -302
  206. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/camera/index.js +0 -2
  207. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/canvas/Canvas.js +0 -464
  208. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/canvas/Spinner.js +0 -323
  209. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/core.js +0 -234
  210. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/Geometry.js +0 -33
  211. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/ReadableGeometry.js +0 -689
  212. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/VBOGeometry.js +0 -327
  213. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/builders/buildBoxGeometry.js +0 -238
  214. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/builders/buildBoxLinesGeometry.js +0 -106
  215. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/builders/buildCylinderGeometry.js +0 -271
  216. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/builders/buildGridGeometry.js +0 -102
  217. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/builders/buildPlaneGeometry.js +0 -168
  218. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/builders/buildSphereGeometry.js +0 -161
  219. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/builders/buildTorusGeometry.js +0 -172
  220. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/builders/buildVectorTextGeometry.js +0 -1721
  221. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/builders/index.js +0 -8
  222. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/index.js +0 -4
  223. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/loaders/index.js +0 -2
  224. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/loaders/load3DSGeometry.js +0 -103
  225. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/geometry/loaders/loadOBJGeometry.js +0 -130
  226. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/index.js +0 -18
  227. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/input/Input.js +0 -1475
  228. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/libs/canvas2image.js +0 -218
  229. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/libs/k3d.js +0 -1032
  230. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/lights/AmbientLight.js +0 -175
  231. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/lights/CubeTexture.js +0 -156
  232. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/lights/DirLight.js +0 -314
  233. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/lights/Light.js +0 -29
  234. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/lights/LightMap.js +0 -77
  235. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/lights/PointLight.js +0 -395
  236. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/lights/ReflectionMap.js +0 -79
  237. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/lights/Shadow.js +0 -138
  238. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/lights/index.js +0 -5
  239. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/marker/Marker.js +0 -382
  240. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/marker/index.js +0 -1
  241. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/materials/EdgeMaterial.js +0 -359
  242. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/materials/EmphasisMaterial.js +0 -577
  243. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/materials/Fresnel.js +0 -222
  244. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/materials/LambertMaterial.js +0 -378
  245. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/materials/LinesMaterial.js +0 -169
  246. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/materials/Material.js +0 -39
  247. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/materials/MetallicMaterial.js +0 -820
  248. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/materials/PhongMaterial.js +0 -860
  249. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/materials/PointsMaterial.js +0 -320
  250. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/materials/SpecularMaterial.js +0 -807
  251. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/materials/Texture.js +0 -522
  252. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/materials/index.js +0 -8
  253. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/math/Frustum.js +0 -118
  254. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/math/buildEdgeIndices.js +0 -162
  255. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/math/geometryCompressionUtils.js +0 -353
  256. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/math/index.js +0 -1
  257. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/math/math.js +0 -5302
  258. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/math/rtcCoords.js +0 -132
  259. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mementos/CameraMemento.js +0 -200
  260. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mementos/ModelMemento.js +0 -272
  261. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mementos/ObjectsMemento.js +0 -259
  262. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mementos/index.js +0 -3
  263. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/Mesh.js +0 -2165
  264. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/draw/DrawRenderer.js +0 -978
  265. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/draw/DrawShaderSource.js +0 -1566
  266. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/emphasis/EmphasisEdgesRenderer.js +0 -249
  267. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/emphasis/EmphasisEdgesShaderSource.js +0 -163
  268. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/emphasis/EmphasisFillRenderer.js +0 -276
  269. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/emphasis/EmphasisFillShaderSource.js +0 -269
  270. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/index.js +0 -1
  271. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/occlusion/OcclusionRenderer.js +0 -207
  272. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/occlusion/OcclusionShaderSource.js +0 -156
  273. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/pick/PickMeshRenderer.js +0 -210
  274. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/pick/PickMeshShaderSource.js +0 -146
  275. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/pick/PickTriangleRenderer.js +0 -186
  276. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/pick/PickTriangleShaderSource.js +0 -120
  277. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/shadow/ShadowRenderer.js +0 -214
  278. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/mesh/shadow/ShadowShaderSource.js +0 -96
  279. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/metriqs/Metriqs.js +0 -259
  280. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/nodes/Node.js +0 -1356
  281. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/nodes/index.js +0 -1
  282. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/paths/CubicBezierCurve.js +0 -194
  283. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/paths/Curve.js +0 -183
  284. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/paths/Path.js +0 -239
  285. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/paths/QuadraticBezierCurve.js +0 -161
  286. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/paths/SplineCurve.js +0 -133
  287. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/paths/index.js +0 -5
  288. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/postfx/SAO.js +0 -547
  289. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/scene/Scene.js +0 -2481
  290. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/sectionPlane/SectionPlane.js +0 -194
  291. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/sectionPlane/index.js +0 -1
  292. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/skybox/Skybox.js +0 -119
  293. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/skybox/index.js +0 -1
  294. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/stats.js +0 -45
  295. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/utils/Map.js +0 -45
  296. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/utils/Queue.js +0 -56
  297. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/utils/index.js +0 -2
  298. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/utils.js +0 -452
  299. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/viewport/Viewport.js +0 -212
  300. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/ArrayBuf.js +0 -121
  301. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/Attribute.js +0 -23
  302. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/Drawable.js +0 -270
  303. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/FrameContext.js +0 -259
  304. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/PickResult.js +0 -317
  305. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/Pickable.js +0 -69
  306. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/Program.js +0 -179
  307. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/RenderBuffer.js +0 -315
  308. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/RenderFlags.js +0 -203
  309. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/RenderState.js +0 -40
  310. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/Renderer.js +0 -1300
  311. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/Sampler.js +0 -18
  312. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/Shader.js +0 -49
  313. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/Texture2D.js +0 -217
  314. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/occlusion/OcclusionLayer.js +0 -214
  315. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/occlusion/OcclusionTester.js +0 -432
  316. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/sao/SAODepthLimitedBlurRenderer.js +0 -326
  317. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/sao/SAOOcclusionRenderer.js +0 -375
  318. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webgl/webglEnums.js +0 -61
  319. package/src/lib/gltf/assets/yjkkit-sdk/src/viewer/scene/webglInfo.js +0 -48
  320. package/src/lib/gltf/gltf.css +0 -392
  321. package/src/lib/gltf/gltf.js +0 -2241
  322. package/webpack.config.js +0 -70
@@ -1,820 +0,0 @@
1
- import {Material} from './Material.js';
2
- import {RenderState} from '../webgl/RenderState.js';
3
- import {math} from '../math/math.js';
4
-
5
- const modes = {"opaque": 0, "mask": 1, "blend": 2};
6
- const modeNames = ["opaque", "mask", "blend"];
7
-
8
- /**
9
- * @desc Configures the normal rendered appearance of {@link Mesh}es using the physically-accurate *metallic-roughness* shading model.
10
- *
11
- * * Useful for conductive materials, such as metal, but also appropriate for insulators.
12
- * * {@link SpecularMaterial} is best for insulators, such as wood, ceramics and plastic.
13
- * * {@link PhongMaterial} is appropriate for non-realistic objects.
14
- * * {@link LambertMaterial} is appropriate for high-detail models that need to render as efficiently as possible.
15
- *
16
- * ## Usage
17
- *
18
- * In the example below we'll create a {@link Mesh} with {@link MetallicMaterial} and {@link ReadableGeometry} loaded from OBJ.
19
- *
20
- * Note that in this example we're providing separate {@link Texture} for the {@link MetallicMaterial#metallic} and {@link MetallicMaterial#roughness}
21
- * channels, which allows us a little creative flexibility. Then, in the next example further down, we'll combine those channels
22
- * within the same {@link Texture} for efficiency.
23
- *
24
- * [[Run this example](http://yjkkit.github.io/yjkkit-sdk/examples/#materials_MetallicMaterial)]
25
- *
26
- * ````javascript
27
- * import {Viewer, Mesh, loadOBJGeometry, ReadableGeometry, MetallicMaterial, Texture} from "yjkkit-sdk.es.js";
28
- *
29
- * const viewer = new Viewer({
30
- * canvasId: "myCanvas"
31
- * });
32
- *
33
- * viewer.scene.camera.eye = [0.57, 1.37, 1.14];
34
- * viewer.scene.camera.look = [0.04, 0.58, 0.00];
35
- * viewer.scene.camera.up = [-0.22, 0.84, -0.48];
36
- *
37
- * loadOBJGeometry(viewer.scene, {
38
- * src: "models/obj/fireHydrant/FireHydrantMesh.obj"
39
- * })
40
- * .then(function (geometry) {
41
- *
42
- * // Success
43
- *
44
- * new Mesh(viewer.scene, {
45
- *
46
- * geometry: new ReadableGeometry(viewer.scene, geometry),
47
- *
48
- * material: new MetallicMaterial(viewer.scene, {
49
- *
50
- * baseColor: [1, 1, 1],
51
- * metallic: 1.0,
52
- * roughness: 1.0,
53
- *
54
- * baseColorMap: new Texture(viewer.scene, {
55
- * src: "models/obj/fireHydrant/fire_hydrant_Base_Color.png",
56
- * encoding: "sRGB"
57
- * }),
58
- * normalMap: new Texture(viewer.scene, {
59
- * src: "models/obj/fireHydrant/fire_hydrant_Normal_OpenGL.png"
60
- * }),
61
- * roughnessMap: new Texture(viewer.scene, {
62
- * src: "models/obj/fireHydrant/fire_hydrant_Roughness.png"
63
- * }),
64
- * metallicMap: new Texture(viewer.scene, {
65
- * src: "models/obj/fireHydrant/fire_hydrant_Metallic.png"
66
- * }),
67
- * occlusionMap: new Texture(viewer.scene, {
68
- * src: "models/obj/fireHydrant/fire_hydrant_Mixed_AO.png"
69
- * }),
70
- *
71
- * specularF0: 0.7
72
- * })
73
- * });
74
- * }, function () {
75
- * // Error
76
- * });
77
- * ````
78
- *
79
- * ## Background Theory
80
- *
81
- * For an introduction to physically-based rendering (PBR) concepts, try these articles:
82
- *
83
- * * Joe Wilson's [Basic Theory of Physically-Based Rendering](https://www.marmoset.co/posts/basic-theory-of-physically-based-rendering/)
84
- * * Jeff Russel's [Physically-based Rendering, and you can too!](https://www.marmoset.co/posts/physically-based-rendering-and-you-can-too/)
85
- * * Sebastien Legarde's [Adapting a physically-based shading model](http://seblagarde.wordpress.com/tag/physically-based-rendering/)
86
- *
87
- * ## MetallicMaterial Properties
88
- *
89
- * The following table summarizes MetallicMaterial properties:
90
- *
91
- * | Property | Type | Range | Default Value | Space | Description |
92
- * |:--------:|:----:|:-----:|:-------------:|:-----:|:-----------:|
93
- * | {@link MetallicMaterial#baseColor} | Array | [0, 1] for all components | [1,1,1,1] | linear | The RGB components of the base color of the material. |
94
- * | {@link MetallicMaterial#metallic} | Number | [0, 1] | 1 | linear | The metallic-ness the material (1 for metals, 0 for non-metals). |
95
- * | {@link MetallicMaterial#roughness} | Number | [0, 1] | 1 | linear | The roughness of the material surface. |
96
- * | {@link MetallicMaterial#specularF0} | Number | [0, 1] | 1 | linear | The specular Fresnel of the material surface. |
97
- * | {@link MetallicMaterial#emissive} | Array | [0, 1] for all components | [0,0,0] | linear | The RGB components of the emissive color of the material. |
98
- * | {@link MetallicMaterial#alpha} | Number | [0, 1] | 1 | linear | The transparency of the material surface (0 fully transparent, 1 fully opaque). |
99
- * | {@link MetallicMaterial#baseColorMap} | {@link Texture} | | null | sRGB | Texture RGB components multiplying by {@link MetallicMaterial#baseColor}. If the fourth component (A) is present, it multiplies by {@link MetallicMaterial#alpha}. |
100
- * | {@link MetallicMaterial#metallicMap} | {@link Texture} | | null | linear | Texture with first component multiplying by {@link MetallicMaterial#metallic}. |
101
- * | {@link MetallicMaterial#roughnessMap} | {@link Texture} | | null | linear | Texture with first component multiplying by {@link MetallicMaterial#roughness}. |
102
- * | {@link MetallicMaterial#metallicRoughnessMap} | {@link Texture} | | null | linear | Texture with first component multiplying by {@link MetallicMaterial#metallic} and second component multiplying by {@link MetallicMaterial#roughness}. |
103
- * | {@link MetallicMaterial#emissiveMap} | {@link Texture} | | null | linear | Texture with RGB components multiplying by {@link MetallicMaterial#emissive}. |
104
- * | {@link MetallicMaterial#alphaMap} | {@link Texture} | | null | linear | Texture with first component multiplying by {@link MetallicMaterial#alpha}. |
105
- * | {@link MetallicMaterial#occlusionMap} | {@link Texture} | | null | linear | Ambient occlusion texture multiplying by surface's reflected diffuse and specular light. |
106
- * | {@link MetallicMaterial#normalMap} | {@link Texture} | | null | linear | Tangent-space normal map. |
107
- * | {@link MetallicMaterial#alphaMode} | String | "opaque", "blend", "mask" | "blend" | | Alpha blend mode. |
108
- * | {@link MetallicMaterial#alphaCutoff} | Number | [0..1] | 0.5 | | Alpha cutoff value. |
109
- * | {@link MetallicMaterial#backfaces} | Boolean | | false | | Whether to render {@link ReadableGeometry} backfaces. |
110
- * | {@link MetallicMaterial#frontface} | String | "ccw", "cw" | "ccw" | | The winding order for {@link ReadableGeometry} frontfaces - "cw" for clockwise, or "ccw" for counter-clockwise. |
111
- *
112
- *
113
- * ## Combining Channels Within the Same Textures
114
- *
115
- * In the previous example we provided separate {@link Texture} for the {@link MetallicMaterial#metallic} and
116
- * {@link MetallicMaterial#roughness} channels, but we can combine those channels into the same {@link Texture} to
117
- * reduce download time, memory footprint and rendering time (and also for glTF compatibility).
118
- *
119
- * Here's the {@link Mesh} again, with our MetallicMaterial with those channels combined in the {@link MetallicMaterial#metallicRoughnessMap}
120
- * {@link Texture}, where the *R* component multiplies by {@link MetallicMaterial#metallic} and *G* multiplies
121
- * by {@link MetallicMaterial#roughness}.
122
- *
123
- * ````javascript
124
- * new Mesh(viewer.scene, {
125
- *
126
- * geometry: geometry,
127
- *
128
- * material: new MetallicMaterial(viewer.scene, {
129
- *
130
- * baseColor: [1, 1, 1],
131
- * metallic: 1.0,
132
- * roughness: 1.0,
133
- *
134
- * baseColorMap: new Texture(viewer.scene, {
135
- * src: "models/obj/fireHydrant/fire_hydrant_Base_Color.png",
136
- * encoding: "sRGB"
137
- * }),
138
- * normalMap: new Texture(viewer.scene, {
139
- * src: "models/obj/fireHydrant/fire_hydrant_Normal_OpenGL.png"
140
- * }),
141
- * metallicRoughnessMap: new Texture(viewer.scene, {
142
- * src: "models/obj/fireHydrant/fire_hydrant_MetallicRoughness.png"
143
- * }),
144
- * metallicRoughnessMap : new Texture(viewer.scene, { // <<----------- Added
145
- * src: "models/obj/fireHydrant/fire_hydrant_MetallicRoughness.png" // R component multiplies by metallic
146
- * }), // G component multiplies by roughness
147
- * occlusionMap: new Texture(viewer.scene, {
148
- * src: "models/obj/fireHydrant/fire_hydrant_Mixed_AO.png"
149
- * }),
150
- *
151
- * specularF0: 0.7
152
- * })
153
- * ````
154
- *
155
- * Although not shown in this example, we can also texture {@link MetallicMaterial#alpha} with the *A* component of
156
- * {@link MetallicMaterial#baseColorMap}'s {@link Texture}, if required.
157
- *
158
- * ## Alpha Blending
159
- *
160
- * Let's make our {@link Mesh} transparent.
161
- *
162
- * We'll update the {@link MetallicMaterial#alpha} and {@link MetallicMaterial#alphaMode}, causing it to blend 50%
163
- * with the background:
164
- *
165
- * ````javascript
166
- * hydrant.material.alpha = 0.5;
167
- * hydrant.material.alphaMode = "blend";
168
- * ````
169
- *
170
- * ## Alpha Masking
171
- *
172
- * Let's apply an alpha mask to our {@link Mesh}.
173
- *
174
- * We'll configure an {@link MetallicMaterial#alphaMap} to multiply by {@link MetallicMaterial#alpha},
175
- * with {@link MetallicMaterial#alphaMode} and {@link MetallicMaterial#alphaCutoff} to treat it as an alpha mask:
176
- *
177
- * ````javascript
178
- * new Mesh(viewer.scene, {
179
- *
180
- * geometry: geometry,
181
- *
182
- * material: new MetallicMaterial(viewer.scene, {
183
- *
184
- * baseColor: [1, 1, 1],
185
- * metallic: 1.0,
186
- * roughness: 1.0,
187
- * alpha: 1.0,
188
- * alphaMode : "mask", // <<---------------- Added
189
- * alphaCutoff : 0.2, // <<---------------- Added
190
- *
191
- * alphaMap : new Texture(viewer.scene{ // <<---------------- Added
192
- * src: "textures/alphaMap.jpg"
193
- * }),
194
- * baseColorMap: new Texture(viewer.scene, {
195
- * src: "models/obj/fireHydrant/fire_hydrant_Base_Color.png",
196
- * encoding: "sRGB"
197
- * }),
198
- * normalMap: new Texture(viewer.scene, {
199
- * src: "models/obj/fireHydrant/fire_hydrant_Normal_OpenGL.png"
200
- * }),
201
- * metallicRoughnessMap: new Texture(viewer.scene, {
202
- * src: "models/obj/fireHydrant/fire_hydrant_MetallicRoughness.png"
203
- * }),
204
- * metallicRoughnessMap : new Texture(viewer.scene, { // <<----------- Added
205
- * src: "models/obj/fireHydrant/fire_hydrant_MetallicRoughness.png" // R component multiplies by metallic
206
- * }), // G component multiplies by roughness
207
- * occlusionMap: new Texture(viewer.scene, {
208
- * src: "models/obj/fireHydrant/fire_hydrant_Mixed_AO.png"
209
- * }),
210
- *
211
- * specularF0: 0.7
212
- * })
213
- * ````
214
- */
215
- class MetallicMaterial extends Material {
216
-
217
- /**
218
- @private
219
- */
220
- get type() {
221
- return "MetallicMaterial";
222
- }
223
-
224
- /**
225
- * @constructor
226
- * @param {Component} owner Owner component. When destroyed, the owner will destroy this MetallicMaterial as well.
227
- * @param {*} [cfg] The MetallicMaterial configuration.
228
- * @param {String} [cfg.id] Optional ID, unique among all components in the parent {@link Scene}, generated automatically when omitted.
229
- * @param {Number[]} [cfg.baseColor=[1,1,1]] RGB diffuse color of this MetallicMaterial. Multiplies by the RGB components of {@link MetallicMaterial#baseColorMap}.
230
- * @param {Number} [cfg.metallic=1.0] Factor in the range ````[0..1]```` indicating how metallic this MetallicMaterial is. ````1```` is metal, ````0```` is non-metal. Multiplies by the *R* component of {@link MetallicMaterial#metallicMap} and the *A* component of {@link MetallicMaterial#metallicRoughnessMap}.
231
- * @param {Number} [cfg.roughness=1.0] Factor in the range ````[0..1]```` indicating the roughness of this MetallicMaterial. ````0```` is fully smooth, ````1```` is fully rough. Multiplies by the *R* component of {@link MetallicMaterial#roughnessMap}.
232
- * @param {Number} [cfg.specularF0=0.0] Factor in the range ````[0..1]```` indicating specular Fresnel.
233
- * @param {Number[]} [cfg.emissive=[0,0,0]] RGB emissive color of this MetallicMaterial. Multiplies by the RGB components of {@link MetallicMaterial#emissiveMap}.
234
- * @param {Number} [cfg.alpha=1.0] Factor in the range ````[0..1]```` indicating the alpha of this MetallicMaterial. Multiplies by the *R* component of {@link MetallicMaterial#alphaMap} and the *A* component, if present, of {@link MetallicMaterial#baseColorMap}. The value of {@link MetallicMaterial#alphaMode} indicates how alpha is interpreted when rendering.
235
- * @param {Texture} [cfg.baseColorMap=undefined] RGBA {@link Texture} containing the diffuse color of this MetallicMaterial, with optional *A* component for alpha. The RGB components multiply by the {@link MetallicMaterial#baseColor} property, while the *A* component, if present, multiplies by the {@link MetallicMaterial#alpha} property.
236
- * @param {Texture} [cfg.alphaMap=undefined] RGB {@link Texture} containing this MetallicMaterial's alpha in its *R* component. The *R* component multiplies by the {@link MetallicMaterial#alpha} property. Must be within the same {@link Scene} as this MetallicMaterial.
237
- * @param {Texture} [cfg.metallicMap=undefined] RGB {@link Texture} containing this MetallicMaterial's metallic factor in its *R* component. The *R* component multiplies by the {@link MetallicMaterial#metallic} property. Must be within the same {@link Scene} as this MetallicMaterial.
238
- * @param {Texture} [cfg.roughnessMap=undefined] RGB {@link Texture} containing this MetallicMaterial's roughness factor in its *R* component. The *R* component multiplies by the {@link MetallicMaterial#roughness} property. Must be within the same {@link Scene} as this MetallicMaterial.
239
- * @param {Texture} [cfg.metallicRoughnessMap=undefined] RGB {@link Texture} containing this MetallicMaterial's metalness in its *R* component and roughness in its *G* component. Its *R* component multiplies by the {@link MetallicMaterial#metallic} property, while its *G* component multiplies by the {@link MetallicMaterial#roughness} property. Must be within the same {@link Scene} as this MetallicMaterial.
240
- * @param {Texture} [cfg.emissiveMap=undefined] RGB {@link Texture} containing the emissive color of this MetallicMaterial. Multiplies by the {@link MetallicMaterial#emissive} property. Must be within the same {@link Scene} as this MetallicMaterial.
241
- * @param {Texture} [cfg.occlusionMap=undefined] RGB ambient occlusion {@link Texture}. Within shaders, multiplies by the specular and diffuse light reflected by surfaces. Must be within the same {@link Scene} as this MetallicMaterial.
242
- * @param {Texture} [cfg.normalMap=undefined] RGB tangent-space normal {@link Texture}. Must be within the same {@link Scene} as this MetallicMaterial.
243
- * @param {String} [cfg.alphaMode="opaque"] The alpha blend mode, which specifies how alpha is to be interpreted. Accepted values are "opaque", "blend" and "mask". See the {@link MetallicMaterial#alphaMode} property for more info.
244
- * @param {Number} [cfg.alphaCutoff=0.5] The alpha cutoff value. See the {@link MetallicMaterial#alphaCutoff} property for more info.
245
- * @param {Boolean} [cfg.backfaces=false] Whether to render {@link ReadableGeometry} backfaces.
246
- * @param {Boolean} [cfg.frontface="ccw"] The winding order for {@link ReadableGeometry} front faces - ````"cw"```` for clockwise, or ````"ccw"```` for counter-clockwise.
247
- * @param {Number} [cfg.lineWidth=1] Scalar that controls the width of lines for {@link ReadableGeometry} with {@link ReadableGeometry#primitive} set to "lines".
248
- * @param {Number} [cfg.pointSize=1] Scalar that controls the size of points for {@link ReadableGeometry} with {@link ReadableGeometry#primitive} set to "points".
249
- */
250
- constructor(owner, cfg = {}) {
251
-
252
- super(owner, cfg);
253
-
254
- this._state = new RenderState({
255
- type: "MetallicMaterial",
256
- baseColor: math.vec4([1.0, 1.0, 1.0]),
257
- emissive: math.vec4([0.0, 0.0, 0.0]),
258
- metallic: null,
259
- roughness: null,
260
- specularF0: null,
261
- alpha: null,
262
- alphaMode: null, // "opaque"
263
- alphaCutoff: null,
264
- lineWidth: null,
265
- pointSize: null,
266
- backfaces: null,
267
- frontface: null, // Boolean for speed; true == "ccw", false == "cw"
268
- hash: null
269
- });
270
-
271
- this.baseColor = cfg.baseColor;
272
- this.metallic = cfg.metallic;
273
- this.roughness = cfg.roughness;
274
- this.specularF0 = cfg.specularF0;
275
- this.emissive = cfg.emissive;
276
- this.alpha = cfg.alpha;
277
-
278
- if (cfg.baseColorMap) {
279
- this._baseColorMap = this._checkComponent("Texture", cfg.baseColorMap);
280
- }
281
- if (cfg.metallicMap) {
282
- this._metallicMap = this._checkComponent("Texture", cfg.metallicMap);
283
-
284
- }
285
- if (cfg.roughnessMap) {
286
- this._roughnessMap = this._checkComponent("Texture", cfg.roughnessMap);
287
- }
288
- if (cfg.metallicRoughnessMap) {
289
- this._metallicRoughnessMap = this._checkComponent("Texture", cfg.metallicRoughnessMap);
290
- }
291
- if (cfg.emissiveMap) {
292
- this._emissiveMap = this._checkComponent("Texture", cfg.emissiveMap);
293
- }
294
- if (cfg.occlusionMap) {
295
- this._occlusionMap = this._checkComponent("Texture", cfg.occlusionMap);
296
- }
297
- if (cfg.alphaMap) {
298
- this._alphaMap = this._checkComponent("Texture", cfg.alphaMap);
299
- }
300
- if (cfg.normalMap) {
301
- this._normalMap = this._checkComponent("Texture", cfg.normalMap);
302
- }
303
-
304
- this.alphaMode = cfg.alphaMode;
305
- this.alphaCutoff = cfg.alphaCutoff;
306
- this.backfaces = cfg.backfaces;
307
- this.frontface = cfg.frontface;
308
- this.lineWidth = cfg.lineWidth;
309
- this.pointSize = cfg.pointSize;
310
-
311
- this._makeHash();
312
- }
313
-
314
- _makeHash() {
315
- const state = this._state;
316
- const hash = ["/met"];
317
- if (this._baseColorMap) {
318
- hash.push("/bm");
319
- if (this._baseColorMap._state.hasMatrix) {
320
- hash.push("/mat");
321
- }
322
- hash.push("/" + this._baseColorMap._state.encoding);
323
- }
324
- if (this._metallicMap) {
325
- hash.push("/mm");
326
- if (this._metallicMap._state.hasMatrix) {
327
- hash.push("/mat");
328
- }
329
- }
330
- if (this._roughnessMap) {
331
- hash.push("/rm");
332
- if (this._roughnessMap._state.hasMatrix) {
333
- hash.push("/mat");
334
- }
335
- }
336
- if (this._metallicRoughnessMap) {
337
- hash.push("/mrm");
338
- if (this._metallicRoughnessMap._state.hasMatrix) {
339
- hash.push("/mat");
340
- }
341
- }
342
- if (this._emissiveMap) {
343
- hash.push("/em");
344
- if (this._emissiveMap._state.hasMatrix) {
345
- hash.push("/mat");
346
- }
347
- }
348
- if (this._occlusionMap) {
349
- hash.push("/ocm");
350
- if (this._occlusionMap._state.hasMatrix) {
351
- hash.push("/mat");
352
- }
353
- }
354
- if (this._alphaMap) {
355
- hash.push("/am");
356
- if (this._alphaMap._state.hasMatrix) {
357
- hash.push("/mat");
358
- }
359
- }
360
- if (this._normalMap) {
361
- hash.push("/nm");
362
- if (this._normalMap._state.hasMatrix) {
363
- hash.push("/mat");
364
- }
365
- }
366
- hash.push(";");
367
- state.hash = hash.join("");
368
- }
369
-
370
-
371
- /**
372
- * Sets the RGB diffuse color.
373
- *
374
- * Multiplies by the RGB components of {@link MetallicMaterial#baseColorMap}.
375
- *
376
- * Default value is ````[1.0, 1.0, 1.0]````.
377
- * @type {Number[]}
378
- */
379
- set baseColor(value) {
380
- let baseColor = this._state.baseColor;
381
- if (!baseColor) {
382
- baseColor = this._state.baseColor = new Float32Array(3);
383
- } else if (value && baseColor[0] === value[0] && baseColor[1] === value[1] && baseColor[2] === value[2]) {
384
- return;
385
- }
386
- if (value) {
387
- baseColor[0] = value[0];
388
- baseColor[1] = value[1];
389
- baseColor[2] = value[2];
390
- } else {
391
- baseColor[0] = 1;
392
- baseColor[1] = 1;
393
- baseColor[2] = 1;
394
- }
395
- this.glRedraw();
396
- }
397
-
398
- /**
399
- * Gets the RGB diffuse color.
400
- *
401
- * Multiplies by the RGB components of {@link MetallicMaterial#baseColorMap}.
402
- *
403
- * Default value is ````[1.0, 1.0, 1.0]````.
404
- * @type {Number[]}
405
- */
406
- get baseColor() {
407
- return this._state.baseColor;
408
- }
409
-
410
-
411
- /**
412
- * Gets the RGB {@link Texture} containing the diffuse color of this MetallicMaterial, with optional *A* component for alpha.
413
- *
414
- * The RGB components multiply by {@link MetallicMaterial#baseColor}, while the *A* component, if present, multiplies by {@link MetallicMaterial#alpha}.
415
- *
416
- * @type {Texture}
417
- */
418
- get baseColorMap() {
419
- return this._baseColorMap;
420
- }
421
-
422
- /**
423
- * Sets the metallic factor.
424
- *
425
- * This is in the range ````[0..1]```` and indicates how metallic this MetallicMaterial is.
426
- *
427
- * ````1```` is metal, ````0```` is non-metal.
428
- *
429
- * Multiplies by the *R* component of {@link MetallicMaterial#metallicMap} and the *A* component of {@link MetallicMaterial#metallicRoughnessMap}.
430
- *
431
- * Default value is ````1.0````.
432
- *
433
- * @type {Number}
434
- */
435
- set metallic(value) {
436
- value = (value !== undefined && value !== null) ? value : 1.0;
437
- if (this._state.metallic === value) {
438
- return;
439
- }
440
- this._state.metallic = value;
441
- this.glRedraw();
442
- }
443
-
444
- /**
445
- * Gets the metallic factor.
446
- *
447
- * @type {Number}
448
- */
449
- get metallic() {
450
- return this._state.metallic;
451
- }
452
-
453
- /**
454
- * Gets the RGB {@link Texture} containing this MetallicMaterial's metallic factor in its *R* component.
455
- *
456
- * The *R* component multiplies by {@link MetallicMaterial#metallic}.
457
- *
458
- * @type {Texture}
459
- */
460
- get metallicMap() {
461
- return this._attached.metallicMap;
462
- }
463
-
464
- /**
465
- * Sets the roughness factor.
466
- *
467
- * This factor is in the range ````[0..1]````, where ````0```` is fully smooth,````1```` is fully rough.
468
- *
469
- * Multiplies by the *R* component of {@link MetallicMaterial#roughnessMap}.
470
- *
471
- * Default value is ````1.0````.
472
- *
473
- * @type {Number}
474
- */
475
- set roughness(value) {
476
- value = (value !== undefined && value !== null) ? value : 1.0;
477
- if (this._state.roughness === value) {
478
- return;
479
- }
480
- this._state.roughness = value;
481
- this.glRedraw();
482
- }
483
-
484
- /**
485
- * Gets the roughness factor.
486
- *
487
- * @type {Number}
488
- */
489
- get roughness() {
490
- return this._state.roughness;
491
- }
492
-
493
- /**
494
- * Gets the RGB {@link Texture} containing this MetallicMaterial's roughness factor in its *R* component.
495
- *
496
- * The *R* component multiplies by {@link MetallicMaterial#roughness}.
497
- *
498
- * @type {Texture}
499
- */
500
- get roughnessMap() {
501
- return this._attached.roughnessMap;
502
- }
503
-
504
- /**
505
- * Gets the RGB {@link Texture} containing this MetallicMaterial's metalness in its *R* component and roughness in its *G* component.
506
- *
507
- * Its *B* component multiplies by the {@link MetallicMaterial#metallic} property, while its *G* component multiplies by the {@link MetallicMaterial#roughness} property.
508
- *
509
- * @type {Texture}
510
- */
511
- get metallicRoughnessMap() {
512
- return this._attached.metallicRoughnessMap;
513
- }
514
-
515
- /**
516
- * Sets the factor in the range [0..1] indicating specular Fresnel value.
517
- *
518
- * Default value is ````0.0````.
519
- *
520
- * @type {Number}
521
- */
522
- set specularF0(value) {
523
- value = (value !== undefined && value !== null) ? value : 0.0;
524
- if (this._state.specularF0 === value) {
525
- return;
526
- }
527
- this._state.specularF0 = value;
528
- this.glRedraw();
529
- }
530
-
531
- /**
532
- * Gets the factor in the range [0..1] indicating specular Fresnel value.
533
- *
534
- * @type {Number}
535
- */
536
- get specularF0() {
537
- return this._state.specularF0;
538
- }
539
-
540
- /**
541
- * Sets the RGB emissive color.
542
- *
543
- * Multiplies by {@link MetallicMaterial#emissiveMap}.
544
- *
545
- * Default value is ````[0.0, 0.0, 0.0]````.
546
- *
547
- * @type {Number[]}
548
- */
549
- set emissive(value) {
550
- let emissive = this._state.emissive;
551
- if (!emissive) {
552
- emissive = this._state.emissive = new Float32Array(3);
553
- } else if (value && emissive[0] === value[0] && emissive[1] === value[1] && emissive[2] === value[2]) {
554
- return;
555
- }
556
- if (value) {
557
- emissive[0] = value[0];
558
- emissive[1] = value[1];
559
- emissive[2] = value[2];
560
- } else {
561
- emissive[0] = 0;
562
- emissive[1] = 0;
563
- emissive[2] = 0;
564
- }
565
- this.glRedraw();
566
- }
567
-
568
- /**
569
- * Gets the RGB emissive color.
570
- *
571
- * @type {Number[]}
572
- */
573
- get emissive() {
574
- return this._state.emissive;
575
- }
576
-
577
- /**
578
- * Gets the RGB emissive map.
579
- *
580
- * Multiplies by {@link MetallicMaterial#emissive}.
581
- *
582
- * @type {Texture}
583
- */
584
- get emissiveMap() {
585
- return this._attached.emissiveMap;
586
- }
587
-
588
- /**
589
- * Gets the RGB ambient occlusion map.
590
- *
591
- * Multiplies by the specular and diffuse light reflected by surfaces.
592
- *
593
- * @type {Texture}
594
- */
595
- get occlusionMap() {
596
- return this._attached.occlusionMap;
597
- }
598
-
599
- /**
600
- * Sets factor in the range ````[0..1]```` that indicates the alpha value.
601
- *
602
- * Multiplies by the *R* component of {@link MetallicMaterial#alphaMap} and the *A* component, if present, of {@link MetallicMaterial#baseColorMap}.
603
- *
604
- * The value of {@link MetallicMaterial#alphaMode} indicates how alpha is interpreted when rendering.
605
- *
606
- * Default value is ````1.0````.
607
- *
608
- * @type {Number}
609
- */
610
- set alpha(value) {
611
- value = (value !== undefined && value !== null) ? value : 1.0;
612
- if (this._state.alpha === value) {
613
- return;
614
- }
615
- this._state.alpha = value;
616
- this.glRedraw();
617
- }
618
-
619
- /**
620
- * Gets factor in the range ````[0..1]```` that indicates the alpha value.
621
- *
622
- * @type {Number}
623
- */
624
- get alpha() {
625
- return this._state.alpha;
626
- }
627
-
628
- /**
629
- * Gets the RGB {@link Texture} containing this MetallicMaterial's alpha in its *R* component.
630
- *
631
- * The *R* component multiplies by the {@link MetallicMaterial#alpha} property.
632
- *
633
- * @type {Texture}
634
- */
635
- get alphaMap() {
636
- return this._attached.alphaMap;
637
- }
638
-
639
- /**
640
- * Gets the RGB tangent-space normal map {@link Texture}.
641
- *
642
- * @type {Texture}
643
- */
644
- get normalMap() {
645
- return this._attached.normalMap;
646
- }
647
-
648
- /**
649
- * Sets the alpha rendering mode.
650
- *
651
- * This specifies how alpha is interpreted. Alpha is the combined result of the {@link MetallicMaterial#alpha} and {@link MetallicMaterial#alphaMap} properties.
652
- *
653
- * Accepted values are:
654
- *
655
- * * "opaque" - The alpha value is ignored and the rendered output is fully opaque (default).
656
- * * "mask" - The rendered output is either fully opaque or fully transparent depending on the alpha and {@link MetallicMaterial#alphaCutoff}.
657
- * * "blend" - The alpha value is used to composite the source and destination areas. The rendered output is combined with the background using the normal painting operation (i.e. the Porter and Duff over operator).
658
- *
659
- * @type {String}
660
- */
661
- set alphaMode(alphaMode) {
662
- alphaMode = alphaMode || "opaque";
663
- let value = modes[alphaMode];
664
- if (value === undefined) {
665
- this.error("Unsupported value for 'alphaMode': " + alphaMode + " defaulting to 'opaque'");
666
- value = "opaque";
667
- }
668
- if (this._state.alphaMode === value) {
669
- return;
670
- }
671
- this._state.alphaMode = value;
672
- this.glRedraw();
673
- }
674
-
675
- /**
676
- * Gets the alpha rendering mode.
677
- *
678
- * @type {String}
679
- */
680
- get alphaMode() {
681
- return modeNames[this._state.alphaMode];
682
- }
683
-
684
- /**
685
- * Sets the alpha cutoff value.
686
- *
687
- * Specifies the cutoff threshold when {@link MetallicMaterial#alphaMode} equals "mask". If the alpha is greater than or equal to this value then it is rendered as fully opaque, otherwise, it is rendered as fully transparent. A value greater than 1.0 will render the entire
688
- * material as fully transparent. This value is ignored for other modes.
689
- *
690
- * Alpha is the combined result of the {@link MetallicMaterial#alpha} and {@link MetallicMaterial#alphaMap} properties.
691
- *
692
- * Default value is ````0.5````.
693
- *
694
- * @type {Number}
695
- */
696
- set alphaCutoff(alphaCutoff) {
697
- if (alphaCutoff === null || alphaCutoff === undefined) {
698
- alphaCutoff = 0.5;
699
- }
700
- if (this._state.alphaCutoff === alphaCutoff) {
701
- return;
702
- }
703
- this._state.alphaCutoff = alphaCutoff;
704
- }
705
-
706
- /**
707
- * Gets the alpha cutoff value.
708
- *
709
- * @type {Number}
710
- */
711
- get alphaCutoff() {
712
- return this._state.alphaCutoff;
713
- }
714
-
715
- /**
716
- * Sets whether backfaces are visible on attached {@link Mesh}es.
717
- *
718
- * The backfaces will belong to {@link ReadableGeometry} compoents that are also attached to the {@link Mesh}es.
719
- *
720
- * Default is ````false````.
721
- *
722
- * @type {Boolean}
723
- */
724
- set backfaces(value) {
725
- value = !!value;
726
- if (this._state.backfaces === value) {
727
- return;
728
- }
729
- this._state.backfaces = value;
730
- this.glRedraw();
731
- }
732
-
733
- /**
734
- * Gets whether backfaces are visible on attached {@link Mesh}es.
735
- *
736
- * @type {Boolean}
737
- */
738
- get backfaces() {
739
- return this._state.backfaces;
740
- }
741
-
742
- /**
743
- * Sets the winding direction of front faces of {@link Geometry} of attached {@link Mesh}es.
744
- *
745
- * Default value is ````"ccw"````.
746
- *
747
- * @type {String}
748
- */
749
- set frontface(value) {
750
- value = value !== "cw";
751
- if (this._state.frontface === value) {
752
- return;
753
- }
754
- this._state.frontface = value;
755
- this.glRedraw();
756
- }
757
-
758
- /**
759
- * Gets the winding direction of front faces of {@link Geometry} of attached {@link Mesh}es.
760
- *
761
- * @type {String}
762
- */
763
- get frontface() {
764
- return this._state.frontface ? "ccw" : "cw";
765
- }
766
-
767
- /**
768
- * Sets the MetallicMaterial's line width.
769
- *
770
- * This is not supported by WebGL implementations based on DirectX [2019].
771
- *
772
- * Default value is ````1.0````.
773
- *
774
- * @type {Number}
775
- */
776
- set lineWidth(value) {
777
- this._state.lineWidth = value || 1.0;
778
- this.glRedraw();
779
- }
780
-
781
- /**
782
- * Gets the MetallicMaterial's line width.
783
- *
784
- * @type {Number}
785
- */
786
- get lineWidth() {
787
- return this._state.lineWidth;
788
- }
789
-
790
- /**
791
- * Sets the MetallicMaterial's point size.
792
- *
793
- * Default value is ````1.0````.
794
- *
795
- * @type {Number}
796
- */
797
- set pointSize(value) {
798
- this._state.pointSize = value || 1.0;
799
- this.glRedraw();
800
- }
801
-
802
- /**
803
- * Gets the MetallicMaterial's point size.
804
- *
805
- * @type {Number}
806
- */
807
- get pointSize() {
808
- return this._state.pointSize;
809
- }
810
-
811
- /**
812
- * Destroys this MetallicMaterial.
813
- */
814
- destroy() {
815
- super.destroy();
816
- this._state.destroy();
817
- }
818
- }
819
-
820
- export {MetallicMaterial};