opal-js_wrap-three 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (503) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +6 -0
  3. data/Gemfile.lock +4 -4
  4. data/lib/opal/js_wrap/three/version.rb +1 -1
  5. data/lib-opal/js_wrap/three/WebGL.js +102 -0
  6. data/lib-opal/js_wrap/three/animation/AnimationClipCreator.js +116 -0
  7. data/lib-opal/js_wrap/three/animation/CCDIKSolver.js +436 -0
  8. data/lib-opal/js_wrap/three/animation/MMDAnimationHelper.js +941 -0
  9. data/lib-opal/js_wrap/three/animation/MMDPhysics.js +1183 -0
  10. data/lib-opal/js_wrap/three/cameras/CinematicCamera.js +204 -0
  11. data/lib-opal/js_wrap/three/controls/ArcballControls.js +2649 -0
  12. data/lib-opal/js_wrap/three/controls/DragControls.js +234 -0
  13. data/lib-opal/js_wrap/three/controls/FirstPersonControls.js +301 -0
  14. data/lib-opal/js_wrap/three/controls/FlyControls.js +357 -0
  15. data/lib-opal/js_wrap/three/controls/OrbitControls.js +908 -0
  16. data/lib-opal/js_wrap/three/controls/PointerLockControls.js +173 -0
  17. data/lib-opal/js_wrap/three/controls/TrackballControls.js +666 -0
  18. data/lib-opal/js_wrap/three/controls/TransformControls.js +1210 -0
  19. data/lib-opal/js_wrap/three/controls/experimental/CameraControls.js +860 -0
  20. data/lib-opal/js_wrap/three/csm/CSM.js +346 -0
  21. data/lib-opal/js_wrap/three/csm/CSMFrustum.js +123 -0
  22. data/lib-opal/js_wrap/three/csm/CSMHelper.js +197 -0
  23. data/lib-opal/js_wrap/three/csm/CSMShader.js +29 -0
  24. data/lib-opal/js_wrap/three/curves/CurveExtras.js +544 -0
  25. data/lib-opal/js_wrap/three/curves/NURBSCurve.js +122 -0
  26. data/lib-opal/js_wrap/three/curves/NURBSSurface.js +78 -0
  27. data/lib-opal/js_wrap/three/curves/NURBSUtils.js +413 -0
  28. data/lib-opal/js_wrap/three/deprecated/Geometry.js +1373 -0
  29. data/lib-opal/js_wrap/three/effects/AnaglyphEffect.js +113 -0
  30. data/lib-opal/js_wrap/three/effects/AsciiEffect.js +267 -0
  31. data/lib-opal/js_wrap/three/effects/OutlineEffect.js +400 -0
  32. data/lib-opal/js_wrap/three/effects/ParallaxBarrierEffect.js +90 -0
  33. data/lib-opal/js_wrap/three/effects/PeppersGhostEffect.js +160 -0
  34. data/lib-opal/js_wrap/three/effects/StereoEffect.js +63 -0
  35. data/lib-opal/js_wrap/three/environments/DebugEnvironment.js +107 -0
  36. data/lib-opal/js_wrap/three/environments/RoomEnvironment.js +166 -0
  37. data/lib-opal/js_wrap/three/exporters/ColladaExporter.js +442 -0
  38. data/lib-opal/js_wrap/three/exporters/DRACOExporter.js +205 -0
  39. data/lib-opal/js_wrap/three/exporters/GLTFExporter.js +2042 -0
  40. data/lib-opal/js_wrap/three/exporters/MMDExporter.js +189 -0
  41. data/lib-opal/js_wrap/three/exporters/OBJExporter.js +241 -0
  42. data/lib-opal/js_wrap/three/exporters/PLYExporter.js +370 -0
  43. data/lib-opal/js_wrap/three/exporters/STLExporter.js +186 -0
  44. data/lib-opal/js_wrap/three/exporters/USDZExporter.js +402 -0
  45. data/lib-opal/js_wrap/three/geometries/BoxLineGeometry.js +106 -0
  46. data/lib-opal/js_wrap/three/geometries/ConvexGeometry.js +88 -0
  47. data/lib-opal/js_wrap/three/geometries/DecalGeometry.js +302 -0
  48. data/lib-opal/js_wrap/three/geometries/LightningStrike.js +817 -0
  49. data/lib-opal/js_wrap/three/geometries/ParametricGeometries.js +280 -0
  50. data/lib-opal/js_wrap/three/geometries/ParametricGeometry.js +146 -0
  51. data/lib-opal/js_wrap/three/geometries/RoundedBoxGeometry.js +183 -0
  52. data/lib-opal/js_wrap/three/geometries/TeapotGeometry.js +352 -0
  53. data/lib-opal/js_wrap/three/geometries/TextGeometry.js +76 -0
  54. data/lib-opal/js_wrap/three/helpers/LightProbeHelper.js +95 -0
  55. data/lib-opal/js_wrap/three/helpers/PositionalAudioHelper.js +138 -0
  56. data/lib-opal/js_wrap/three/helpers/RectAreaLightHelper.js +115 -0
  57. data/lib-opal/js_wrap/three/helpers/VertexNormalsHelper.js +131 -0
  58. data/lib-opal/js_wrap/three/helpers/VertexTangentsHelper.js +118 -0
  59. data/lib-opal/js_wrap/three/interactive/HTMLMesh.js +307 -0
  60. data/lib-opal/js_wrap/three/interactive/InteractiveGroup.js +138 -0
  61. data/lib-opal/js_wrap/three/interactive/SelectionBox.js +264 -0
  62. data/lib-opal/js_wrap/three/interactive/SelectionHelper.js +88 -0
  63. data/lib-opal/js_wrap/three/libs/OimoPhysics/OimoPhysics.js +46059 -0
  64. data/lib-opal/js_wrap/three/libs/OimoPhysics/index.js +92 -0
  65. data/lib-opal/js_wrap/three/libs/chevrotain.module.min.js +6947 -0
  66. data/lib-opal/js_wrap/three/libs/ecsy.module.js +1999 -0
  67. data/lib-opal/js_wrap/three/libs/fflate.module.js +3002 -0
  68. data/lib-opal/js_wrap/three/libs/flow.module.js +3033 -0
  69. data/lib-opal/js_wrap/three/libs/ktx-parse.module.js +392 -0
  70. data/lib-opal/js_wrap/three/libs/lil-gui.module.min.js +821 -0
  71. data/lib-opal/js_wrap/three/libs/meshopt_decoder.module.js +136 -0
  72. data/lib-opal/js_wrap/three/libs/mmdparser.module.js +11022 -0
  73. data/lib-opal/js_wrap/three/libs/motion-controllers.module.js +589 -0
  74. data/lib-opal/js_wrap/three/libs/opentype.module.min.js +6132 -0
  75. data/lib-opal/js_wrap/three/libs/potpack.module.js +171 -0
  76. data/lib-opal/js_wrap/three/libs/rhino3dm/rhino3dm.js +6781 -0
  77. data/lib-opal/js_wrap/three/libs/rhino3dm/rhino3dm.module.js +6783 -0
  78. data/lib-opal/js_wrap/three/libs/stats.module.js +139 -0
  79. data/lib-opal/js_wrap/three/libs/tween.module.min.js +349 -0
  80. data/lib-opal/js_wrap/three/lights/LightProbeGenerator.js +233 -0
  81. data/lib-opal/js_wrap/three/lights/RectAreaLightUniformsLib.js +75 -0
  82. data/lib-opal/js_wrap/three/lines/Line2.js +66 -0
  83. data/lib-opal/js_wrap/three/lines/LineGeometry.js +122 -0
  84. data/lib-opal/js_wrap/three/lines/LineMaterial.js +227 -0
  85. data/lib-opal/js_wrap/three/lines/LineSegments2.js +312 -0
  86. data/lib-opal/js_wrap/three/lines/LineSegmentsGeometry.js +238 -0
  87. data/lib-opal/js_wrap/three/lines/Wireframe.js +98 -0
  88. data/lib-opal/js_wrap/three/lines/WireframeGeometry2.js +65 -0
  89. data/lib-opal/js_wrap/three/loaders/3DMLoader.js +1230 -0
  90. data/lib-opal/js_wrap/three/loaders/3MFLoader.js +1123 -0
  91. data/lib-opal/js_wrap/three/loaders/AMFLoader.js +445 -0
  92. data/lib-opal/js_wrap/three/loaders/BVHLoader.js +365 -0
  93. data/lib-opal/js_wrap/three/loaders/BasisTextureLoader.js +692 -0
  94. data/lib-opal/js_wrap/three/loaders/ColladaLoader.js +3046 -0
  95. data/lib-opal/js_wrap/three/loaders/DDSLoader.js +264 -0
  96. data/lib-opal/js_wrap/three/loaders/DRACOLoader.js +531 -0
  97. data/lib-opal/js_wrap/three/loaders/EXRLoader.js +1834 -0
  98. data/lib-opal/js_wrap/three/loaders/FBXLoader.js +3125 -0
  99. data/lib-opal/js_wrap/three/loaders/FontLoader.js +201 -0
  100. data/lib-opal/js_wrap/three/loaders/GCodeLoader.js +248 -0
  101. data/lib-opal/js_wrap/three/loaders/GLTFLoader.js +3334 -0
  102. data/lib-opal/js_wrap/three/loaders/HDRCubeTextureLoader.js +144 -0
  103. data/lib-opal/js_wrap/three/loaders/IFCLoader.js +2395 -0
  104. data/lib-opal/js_wrap/three/loaders/KMZLoader.js +142 -0
  105. data/lib-opal/js_wrap/three/loaders/KTX2Loader.js +535 -0
  106. data/lib-opal/js_wrap/three/loaders/KTXLoader.js +202 -0
  107. data/lib-opal/js_wrap/three/loaders/LDrawLoader.js +1737 -0
  108. data/lib-opal/js_wrap/three/loaders/LUT3dlLoader.js +163 -0
  109. data/lib-opal/js_wrap/three/loaders/LUTCubeLoader.js +171 -0
  110. data/lib-opal/js_wrap/three/loaders/LWOLoader.js +831 -0
  111. data/lib-opal/js_wrap/three/loaders/LogLuvLoader.js +713 -0
  112. data/lib-opal/js_wrap/three/loaders/LottieLoader.js +103 -0
  113. data/lib-opal/js_wrap/three/loaders/MD2Loader.js +258 -0
  114. data/lib-opal/js_wrap/three/loaders/MDDLoader.js +116 -0
  115. data/lib-opal/js_wrap/three/loaders/MMDLoader.js +1687 -0
  116. data/lib-opal/js_wrap/three/loaders/MTLLoader.js +465 -0
  117. data/lib-opal/js_wrap/three/loaders/NRRDLoader.js +554 -0
  118. data/lib-opal/js_wrap/three/loaders/NodeMaterialLoader.js +248 -0
  119. data/lib-opal/js_wrap/three/loaders/OBJLoader.js +673 -0
  120. data/lib-opal/js_wrap/three/loaders/PCDLoader.js +322 -0
  121. data/lib-opal/js_wrap/three/loaders/PDBLoader.js +318 -0
  122. data/lib-opal/js_wrap/three/loaders/PLYLoader.js +489 -0
  123. data/lib-opal/js_wrap/three/loaders/PRWMLoader.js +247 -0
  124. data/lib-opal/js_wrap/three/loaders/PVRLoader.js +240 -0
  125. data/lib-opal/js_wrap/three/loaders/RGBELoader.js +462 -0
  126. data/lib-opal/js_wrap/three/loaders/RGBMLoader.js +1169 -0
  127. data/lib-opal/js_wrap/three/loaders/STLLoader.js +345 -0
  128. data/lib-opal/js_wrap/three/loaders/SVGLoader.js +2162 -0
  129. data/lib-opal/js_wrap/three/loaders/TDSLoader.js +982 -0
  130. data/lib-opal/js_wrap/three/loaders/TGALoader.js +444 -0
  131. data/lib-opal/js_wrap/three/loaders/TTFLoader.js +210 -0
  132. data/lib-opal/js_wrap/three/loaders/TiltLoader.js +391 -0
  133. data/lib-opal/js_wrap/three/loaders/VOXLoader.js +272 -0
  134. data/lib-opal/js_wrap/three/loaders/VRMLLoader.js +2685 -0
  135. data/lib-opal/js_wrap/three/loaders/VRMLoader.js +103 -0
  136. data/lib-opal/js_wrap/three/loaders/VTKLoader.js +894 -0
  137. data/lib-opal/js_wrap/three/loaders/XYZLoader.js +136 -0
  138. data/lib-opal/js_wrap/three/loaders/ifc/web-ifc-api.js +60504 -0
  139. data/lib-opal/js_wrap/three/loaders/lwo/IFFParser.js +931 -0
  140. data/lib-opal/js_wrap/three/loaders/lwo/LWO2Parser.js +450 -0
  141. data/lib-opal/js_wrap/three/loaders/lwo/LWO3Parser.js +406 -0
  142. data/lib-opal/js_wrap/three/math/Capsule.js +133 -0
  143. data/lib-opal/js_wrap/three/math/ColorConverter.js +104 -0
  144. data/lib-opal/js_wrap/three/math/ConvexHull.js +924 -0
  145. data/lib-opal/js_wrap/three/math/ImprovedNoise.js +86 -0
  146. data/lib-opal/js_wrap/three/math/Lut.js +170 -0
  147. data/lib-opal/js_wrap/three/math/MeshSurfaceSampler.js +187 -0
  148. data/lib-opal/js_wrap/three/math/OBB.js +345 -0
  149. data/lib-opal/js_wrap/three/math/Octree.js +409 -0
  150. data/lib-opal/js_wrap/three/math/SimplexNoise.js +425 -0
  151. data/lib-opal/js_wrap/three/misc/ConvexObjectBreaker.js +447 -0
  152. data/lib-opal/js_wrap/three/misc/GPUComputationRenderer.js +322 -0
  153. data/lib-opal/js_wrap/three/misc/Gyroscope.js +94 -0
  154. data/lib-opal/js_wrap/three/misc/MD2Character.js +225 -0
  155. data/lib-opal/js_wrap/three/misc/MD2CharacterComplex.js +424 -0
  156. data/lib-opal/js_wrap/three/misc/MorphAnimMesh.js +109 -0
  157. data/lib-opal/js_wrap/three/misc/MorphBlendMesh.js +283 -0
  158. data/lib-opal/js_wrap/three/misc/ProgressiveLightMap.js +324 -0
  159. data/lib-opal/js_wrap/three/misc/RollerCoaster.js +489 -0
  160. data/lib-opal/js_wrap/three/misc/TubePainter.js +158 -0
  161. data/lib-opal/js_wrap/three/misc/Volume.js +427 -0
  162. data/lib-opal/js_wrap/three/misc/VolumeSlice.js +210 -0
  163. data/lib-opal/js_wrap/three/modifiers/CurveModifier.js +291 -0
  164. data/lib-opal/js_wrap/three/modifiers/EdgeSplitModifier.js +308 -0
  165. data/lib-opal/js_wrap/three/modifiers/SimplifyModifier.js +435 -0
  166. data/lib-opal/js_wrap/three/modifiers/TessellateModifier.js +264 -0
  167. data/lib-opal/js_wrap/three/node-editor/NodeEditor.js +402 -0
  168. data/lib-opal/js_wrap/three/node-editor/accessors/NormalEditor.js +80 -0
  169. data/lib-opal/js_wrap/three/node-editor/accessors/PositionEditor.js +80 -0
  170. data/lib-opal/js_wrap/three/node-editor/accessors/UVEditor.js +71 -0
  171. data/lib-opal/js_wrap/three/node-editor/display/BlendEditor.js +78 -0
  172. data/lib-opal/js_wrap/three/node-editor/inputs/ColorEditor.js +111 -0
  173. data/lib-opal/js_wrap/three/node-editor/inputs/FloatEditor.js +69 -0
  174. data/lib-opal/js_wrap/three/node-editor/inputs/SliderEditor.js +97 -0
  175. data/lib-opal/js_wrap/three/node-editor/inputs/Vector2Editor.js +73 -0
  176. data/lib-opal/js_wrap/three/node-editor/inputs/Vector3Editor.js +75 -0
  177. data/lib-opal/js_wrap/three/node-editor/inputs/Vector4Editor.js +77 -0
  178. data/lib-opal/js_wrap/three/node-editor/materials/StandardMaterialEditor.js +121 -0
  179. data/lib-opal/js_wrap/three/node-editor/math/DotEditor.js +76 -0
  180. data/lib-opal/js_wrap/three/node-editor/math/InvertEditor.js +80 -0
  181. data/lib-opal/js_wrap/three/node-editor/math/LimiterEditor.js +85 -0
  182. data/lib-opal/js_wrap/three/node-editor/math/NormalizeEditor.js +69 -0
  183. data/lib-opal/js_wrap/three/node-editor/math/OperatorEditor.js +91 -0
  184. data/lib-opal/js_wrap/three/node-editor/math/PowerEditor.js +73 -0
  185. data/lib-opal/js_wrap/three/node-editor/math/TrigonometryEditor.js +83 -0
  186. data/lib-opal/js_wrap/three/node-editor/procedural/CheckerEditor.js +69 -0
  187. data/lib-opal/js_wrap/three/node-editor/utils/OscillatorEditor.js +87 -0
  188. data/lib-opal/js_wrap/three/node-editor/utils/TimerEditor.js +89 -0
  189. data/lib-opal/js_wrap/three/nodes/Nodes.js +481 -0
  190. data/lib-opal/js_wrap/three/nodes/accessors/CameraNode.js +222 -0
  191. data/lib-opal/js_wrap/three/nodes/accessors/ColorsNode.js +99 -0
  192. data/lib-opal/js_wrap/three/nodes/accessors/LightNode.js +100 -0
  193. data/lib-opal/js_wrap/three/nodes/accessors/NormalNode.js +152 -0
  194. data/lib-opal/js_wrap/three/nodes/accessors/PositionNode.js +163 -0
  195. data/lib-opal/js_wrap/three/nodes/accessors/ReflectNode.js +161 -0
  196. data/lib-opal/js_wrap/three/nodes/accessors/ResolutionNode.js +99 -0
  197. data/lib-opal/js_wrap/three/nodes/accessors/ScreenUVNode.js +101 -0
  198. data/lib-opal/js_wrap/three/nodes/accessors/UVNode.js +105 -0
  199. data/lib-opal/js_wrap/three/nodes/core/AttributeNode.js +106 -0
  200. data/lib-opal/js_wrap/three/nodes/core/ConstNode.js +149 -0
  201. data/lib-opal/js_wrap/three/nodes/core/ExpressionNode.js +57 -0
  202. data/lib-opal/js_wrap/three/nodes/core/FunctionCallNode.js +138 -0
  203. data/lib-opal/js_wrap/three/nodes/core/FunctionNode.js +259 -0
  204. data/lib-opal/js_wrap/three/nodes/core/InputNode.js +124 -0
  205. data/lib-opal/js_wrap/three/nodes/core/Node.js +193 -0
  206. data/lib-opal/js_wrap/three/nodes/core/NodeBuilder.js +782 -0
  207. data/lib-opal/js_wrap/three/nodes/core/NodeFrame.js +69 -0
  208. data/lib-opal/js_wrap/three/nodes/core/NodeLib.js +56 -0
  209. data/lib-opal/js_wrap/three/nodes/core/NodeUniform.js +53 -0
  210. data/lib-opal/js_wrap/three/nodes/core/NodeUtils.js +60 -0
  211. data/lib-opal/js_wrap/three/nodes/core/StructNode.js +131 -0
  212. data/lib-opal/js_wrap/three/nodes/core/TempNode.js +160 -0
  213. data/lib-opal/js_wrap/three/nodes/core/VarNode.js +105 -0
  214. data/lib-opal/js_wrap/three/nodes/effects/BlurNode.js +160 -0
  215. data/lib-opal/js_wrap/three/nodes/effects/ColorAdjustmentNode.js +139 -0
  216. data/lib-opal/js_wrap/three/nodes/effects/LuminanceNode.js +106 -0
  217. data/lib-opal/js_wrap/three/nodes/inputs/BoolNode.js +95 -0
  218. data/lib-opal/js_wrap/three/nodes/inputs/ColorNode.js +99 -0
  219. data/lib-opal/js_wrap/three/nodes/inputs/CubeTextureNode.js +136 -0
  220. data/lib-opal/js_wrap/three/nodes/inputs/FloatNode.js +95 -0
  221. data/lib-opal/js_wrap/three/nodes/inputs/IntNode.js +95 -0
  222. data/lib-opal/js_wrap/three/nodes/inputs/Matrix3Node.js +102 -0
  223. data/lib-opal/js_wrap/three/nodes/inputs/Matrix4Node.js +102 -0
  224. data/lib-opal/js_wrap/three/nodes/inputs/PropertyNode.js +85 -0
  225. data/lib-opal/js_wrap/three/nodes/inputs/RTTNode.js +164 -0
  226. data/lib-opal/js_wrap/three/nodes/inputs/ReflectorNode.js +111 -0
  227. data/lib-opal/js_wrap/three/nodes/inputs/ScreenNode.js +69 -0
  228. data/lib-opal/js_wrap/three/nodes/inputs/TextureNode.js +140 -0
  229. data/lib-opal/js_wrap/three/nodes/inputs/Vector2Node.js +98 -0
  230. data/lib-opal/js_wrap/three/nodes/inputs/Vector3Node.js +99 -0
  231. data/lib-opal/js_wrap/three/nodes/inputs/Vector4Node.js +100 -0
  232. data/lib-opal/js_wrap/three/nodes/materials/BasicNodeMaterial.js +63 -0
  233. data/lib-opal/js_wrap/three/nodes/materials/MeshStandardNodeMaterial.js +63 -0
  234. data/lib-opal/js_wrap/three/nodes/materials/NodeMaterial.js +202 -0
  235. data/lib-opal/js_wrap/three/nodes/materials/PhongNodeMaterial.js +63 -0
  236. data/lib-opal/js_wrap/three/nodes/materials/SpriteNodeMaterial.js +63 -0
  237. data/lib-opal/js_wrap/three/nodes/materials/StandardNodeMaterial.js +63 -0
  238. data/lib-opal/js_wrap/three/nodes/materials/nodes/BasicNode.js +146 -0
  239. data/lib-opal/js_wrap/three/nodes/materials/nodes/MeshStandardNode.js +133 -0
  240. data/lib-opal/js_wrap/three/nodes/materials/nodes/PhongNode.js +273 -0
  241. data/lib-opal/js_wrap/three/nodes/materials/nodes/RawNode.js +101 -0
  242. data/lib-opal/js_wrap/three/nodes/materials/nodes/SpriteNode.js +176 -0
  243. data/lib-opal/js_wrap/three/nodes/materials/nodes/StandardNode.js +397 -0
  244. data/lib-opal/js_wrap/three/nodes/math/CondNode.js +151 -0
  245. data/lib-opal/js_wrap/three/nodes/math/MathNode.js +266 -0
  246. data/lib-opal/js_wrap/three/nodes/math/OperatorNode.js +120 -0
  247. data/lib-opal/js_wrap/three/nodes/misc/BumpMapNode.js +139 -0
  248. data/lib-opal/js_wrap/three/nodes/misc/NormalMapNode.js +122 -0
  249. data/lib-opal/js_wrap/three/nodes/misc/TextureCubeNode.js +107 -0
  250. data/lib-opal/js_wrap/three/nodes/misc/TextureCubeUVNode.js +191 -0
  251. data/lib-opal/js_wrap/three/nodes/postprocessing/NodePass.js +117 -0
  252. data/lib-opal/js_wrap/three/nodes/postprocessing/NodePostProcessing.js +128 -0
  253. data/lib-opal/js_wrap/three/nodes/procedural/CheckerNode.js +104 -0
  254. data/lib-opal/js_wrap/three/nodes/procedural/Fractal3DNode.js +121 -0
  255. data/lib-opal/js_wrap/three/nodes/procedural/Noise2DNode.js +115 -0
  256. data/lib-opal/js_wrap/three/nodes/procedural/Noise3DNode.js +112 -0
  257. data/lib-opal/js_wrap/three/nodes/utils/BypassNode.js +115 -0
  258. data/lib-opal/js_wrap/three/nodes/utils/ColorSpaceNode.js +214 -0
  259. data/lib-opal/js_wrap/three/nodes/utils/JoinNode.js +138 -0
  260. data/lib-opal/js_wrap/three/nodes/utils/MaxMIPLevelNode.js +88 -0
  261. data/lib-opal/js_wrap/three/nodes/utils/RemapNode.js +117 -0
  262. data/lib-opal/js_wrap/three/nodes/utils/SpecularMIPLevelNode.js +121 -0
  263. data/lib-opal/js_wrap/three/nodes/utils/SubSlotNode.js +112 -0
  264. data/lib-opal/js_wrap/three/nodes/utils/SwitchNode.js +129 -0
  265. data/lib-opal/js_wrap/three/nodes/utils/TimerNode.js +126 -0
  266. data/lib-opal/js_wrap/three/nodes/utils/UVTransformNode.js +104 -0
  267. data/lib-opal/js_wrap/three/nodes/utils/VelocityNode.js +181 -0
  268. data/lib-opal/js_wrap/three/objects/Lensflare.js +285 -0
  269. data/lib-opal/js_wrap/three/objects/LightningStorm.js +238 -0
  270. data/lib-opal/js_wrap/three/objects/MarchingCubes.js +667 -0
  271. data/lib-opal/js_wrap/three/objects/Reflector.js +205 -0
  272. data/lib-opal/js_wrap/three/objects/ReflectorForSSRPass.js +288 -0
  273. data/lib-opal/js_wrap/three/objects/ReflectorRTT.js +63 -0
  274. data/lib-opal/js_wrap/three/objects/Refractor.js +243 -0
  275. data/lib-opal/js_wrap/three/objects/ShadowMesh.js +100 -0
  276. data/lib-opal/js_wrap/three/objects/Sky.js +107 -0
  277. data/lib-opal/js_wrap/three/objects/Water.js +246 -0
  278. data/lib-opal/js_wrap/three/objects/Water2.js +238 -0
  279. data/lib-opal/js_wrap/three/offscreen/jank.js +51 -0
  280. data/lib-opal/js_wrap/three/offscreen/offscreen.js +24 -0
  281. data/lib-opal/js_wrap/three/offscreen/scene.js +99 -0
  282. data/lib-opal/js_wrap/three/physics/AmmoPhysics.js +266 -0
  283. data/lib-opal/js_wrap/three/physics/OimoPhysics.js +214 -0
  284. data/lib-opal/js_wrap/three/postprocessing/AdaptiveToneMappingPass.js +307 -0
  285. data/lib-opal/js_wrap/three/postprocessing/AfterimagePass.js +116 -0
  286. data/lib-opal/js_wrap/three/postprocessing/BloomPass.js +132 -0
  287. data/lib-opal/js_wrap/three/postprocessing/BokehPass.js +143 -0
  288. data/lib-opal/js_wrap/three/postprocessing/ClearPass.js +85 -0
  289. data/lib-opal/js_wrap/three/postprocessing/CubeTexturePass.js +104 -0
  290. data/lib-opal/js_wrap/three/postprocessing/DotScreenPass.js +90 -0
  291. data/lib-opal/js_wrap/three/postprocessing/EffectComposer.js +272 -0
  292. data/lib-opal/js_wrap/three/postprocessing/FilmPass.js +91 -0
  293. data/lib-opal/js_wrap/three/postprocessing/GlitchPass.js +140 -0
  294. data/lib-opal/js_wrap/three/postprocessing/HalftonePass.js +108 -0
  295. data/lib-opal/js_wrap/three/postprocessing/LUTPass.js +132 -0
  296. data/lib-opal/js_wrap/three/postprocessing/MaskPass.js +142 -0
  297. data/lib-opal/js_wrap/three/postprocessing/OutlinePass.js +480 -0
  298. data/lib-opal/js_wrap/three/postprocessing/Pass.js +101 -0
  299. data/lib-opal/js_wrap/three/postprocessing/RenderPass.js +109 -0
  300. data/lib-opal/js_wrap/three/postprocessing/SAOPass.js +384 -0
  301. data/lib-opal/js_wrap/three/postprocessing/SMAAPass.js +199 -0
  302. data/lib-opal/js_wrap/three/postprocessing/SSAARenderPass.js +186 -0
  303. data/lib-opal/js_wrap/three/postprocessing/SSAOPass.js +388 -0
  304. data/lib-opal/js_wrap/three/postprocessing/SSRPass.js +537 -0
  305. data/lib-opal/js_wrap/three/postprocessing/SSRrPass.js +481 -0
  306. data/lib-opal/js_wrap/three/postprocessing/SavePass.js +96 -0
  307. data/lib-opal/js_wrap/three/postprocessing/ShaderPass.js +98 -0
  308. data/lib-opal/js_wrap/three/postprocessing/TAARenderPass.js +159 -0
  309. data/lib-opal/js_wrap/three/postprocessing/TexturePass.js +91 -0
  310. data/lib-opal/js_wrap/three/postprocessing/UnrealBloomPass.js +335 -0
  311. data/lib-opal/js_wrap/three/renderers/CSS2DRenderer.js +213 -0
  312. data/lib-opal/js_wrap/three/renderers/CSS3DRenderer.js +277 -0
  313. data/lib-opal/js_wrap/three/renderers/Projector.js +733 -0
  314. data/lib-opal/js_wrap/three/renderers/SVGRenderer.js +470 -0
  315. data/lib-opal/js_wrap/three/renderers/nodes/Nodes.js +531 -0
  316. data/lib-opal/js_wrap/three/renderers/nodes/ShaderNode.js +386 -0
  317. data/lib-opal/js_wrap/three/renderers/nodes/accessors/CameraNode.js +114 -0
  318. data/lib-opal/js_wrap/three/renderers/nodes/accessors/MaterialNode.js +140 -0
  319. data/lib-opal/js_wrap/three/renderers/nodes/accessors/MaterialReferenceNode.js +79 -0
  320. data/lib-opal/js_wrap/three/renderers/nodes/accessors/ModelNode.js +62 -0
  321. data/lib-opal/js_wrap/three/renderers/nodes/accessors/ModelViewProjectionNode.js +80 -0
  322. data/lib-opal/js_wrap/three/renderers/nodes/accessors/NormalNode.js +113 -0
  323. data/lib-opal/js_wrap/three/renderers/nodes/accessors/Object3DNode.js +136 -0
  324. data/lib-opal/js_wrap/three/renderers/nodes/accessors/PointUVNode.js +70 -0
  325. data/lib-opal/js_wrap/three/renderers/nodes/accessors/PositionNode.js +117 -0
  326. data/lib-opal/js_wrap/three/renderers/nodes/accessors/ReferenceNode.js +124 -0
  327. data/lib-opal/js_wrap/three/renderers/nodes/accessors/SkinningNode.js +129 -0
  328. data/lib-opal/js_wrap/three/renderers/nodes/accessors/UVNode.js +77 -0
  329. data/lib-opal/js_wrap/three/renderers/nodes/core/ArrayInputNode.js +74 -0
  330. data/lib-opal/js_wrap/three/renderers/nodes/core/AttributeNode.js +97 -0
  331. data/lib-opal/js_wrap/three/renderers/nodes/core/BypassNode.js +84 -0
  332. data/lib-opal/js_wrap/three/renderers/nodes/core/CodeNode.js +131 -0
  333. data/lib-opal/js_wrap/three/renderers/nodes/core/ContextNode.js +84 -0
  334. data/lib-opal/js_wrap/three/renderers/nodes/core/ExpressionNode.js +81 -0
  335. data/lib-opal/js_wrap/three/renderers/nodes/core/FunctionCallNode.js +123 -0
  336. data/lib-opal/js_wrap/three/renderers/nodes/core/FunctionNode.js +126 -0
  337. data/lib-opal/js_wrap/three/renderers/nodes/core/InputNode.js +103 -0
  338. data/lib-opal/js_wrap/three/renderers/nodes/core/Node.js +120 -0
  339. data/lib-opal/js_wrap/three/renderers/nodes/core/NodeAttribute.js +37 -0
  340. data/lib-opal/js_wrap/three/renderers/nodes/core/NodeBuilder.js +650 -0
  341. data/lib-opal/js_wrap/three/renderers/nodes/core/NodeCode.js +42 -0
  342. data/lib-opal/js_wrap/three/renderers/nodes/core/NodeFrame.js +70 -0
  343. data/lib-opal/js_wrap/three/renderers/nodes/core/NodeFunction.js +55 -0
  344. data/lib-opal/js_wrap/three/renderers/nodes/core/NodeFunctionInput.js +44 -0
  345. data/lib-opal/js_wrap/three/renderers/nodes/core/NodeKeywords.js +117 -0
  346. data/lib-opal/js_wrap/three/renderers/nodes/core/NodeParser.js +46 -0
  347. data/lib-opal/js_wrap/three/renderers/nodes/core/NodeUniform.js +55 -0
  348. data/lib-opal/js_wrap/three/renderers/nodes/core/NodeVar.js +37 -0
  349. data/lib-opal/js_wrap/three/renderers/nodes/core/NodeVary.js +37 -0
  350. data/lib-opal/js_wrap/three/renderers/nodes/core/PropertyNode.js +90 -0
  351. data/lib-opal/js_wrap/three/renderers/nodes/core/TempNode.js +89 -0
  352. data/lib-opal/js_wrap/three/renderers/nodes/core/VarNode.js +101 -0
  353. data/lib-opal/js_wrap/three/renderers/nodes/core/VaryNode.js +101 -0
  354. data/lib-opal/js_wrap/three/renderers/nodes/core/constants.js +42 -0
  355. data/lib-opal/js_wrap/three/renderers/nodes/display/ColorSpaceNode.js +165 -0
  356. data/lib-opal/js_wrap/three/renderers/nodes/display/NormalMapNode.js +120 -0
  357. data/lib-opal/js_wrap/three/renderers/nodes/functions/BSDFs.js +133 -0
  358. data/lib-opal/js_wrap/three/renderers/nodes/inputs/BufferNode.js +78 -0
  359. data/lib-opal/js_wrap/three/renderers/nodes/inputs/ColorNode.js +67 -0
  360. data/lib-opal/js_wrap/three/renderers/nodes/inputs/FloatNode.js +67 -0
  361. data/lib-opal/js_wrap/three/renderers/nodes/inputs/IntNode.js +67 -0
  362. data/lib-opal/js_wrap/three/renderers/nodes/inputs/Matrix3Node.js +67 -0
  363. data/lib-opal/js_wrap/three/renderers/nodes/inputs/Matrix4Node.js +67 -0
  364. data/lib-opal/js_wrap/three/renderers/nodes/inputs/TextureNode.js +120 -0
  365. data/lib-opal/js_wrap/three/renderers/nodes/inputs/Vector2Node.js +67 -0
  366. data/lib-opal/js_wrap/three/renderers/nodes/inputs/Vector3Node.js +67 -0
  367. data/lib-opal/js_wrap/three/renderers/nodes/inputs/Vector4Node.js +67 -0
  368. data/lib-opal/js_wrap/three/renderers/nodes/lights/LightContextNode.js +103 -0
  369. data/lib-opal/js_wrap/three/renderers/nodes/lights/LightNode.js +115 -0
  370. data/lib-opal/js_wrap/three/renderers/nodes/lights/LightsNode.js +117 -0
  371. data/lib-opal/js_wrap/three/renderers/nodes/materials/LineBasicNodeMaterial.js +82 -0
  372. data/lib-opal/js_wrap/three/renderers/nodes/materials/Materials.js +49 -0
  373. data/lib-opal/js_wrap/three/renderers/nodes/materials/MeshBasicNodeMaterial.js +82 -0
  374. data/lib-opal/js_wrap/three/renderers/nodes/materials/MeshStandardNodeMaterial.js +96 -0
  375. data/lib-opal/js_wrap/three/renderers/nodes/materials/PointsNodeMaterial.js +84 -0
  376. data/lib-opal/js_wrap/three/renderers/nodes/math/CondNode.js +98 -0
  377. data/lib-opal/js_wrap/three/renderers/nodes/math/MathNode.js +255 -0
  378. data/lib-opal/js_wrap/three/renderers/nodes/math/OperatorNode.js +163 -0
  379. data/lib-opal/js_wrap/three/renderers/nodes/parsers/GLSLNodeFunction.js +158 -0
  380. data/lib-opal/js_wrap/three/renderers/nodes/parsers/GLSLNodeParser.js +68 -0
  381. data/lib-opal/js_wrap/three/renderers/nodes/parsers/WGSLNodeFunction.js +126 -0
  382. data/lib-opal/js_wrap/three/renderers/nodes/parsers/WGSLNodeParser.js +68 -0
  383. data/lib-opal/js_wrap/three/renderers/nodes/procedural/CheckerNode.js +84 -0
  384. data/lib-opal/js_wrap/three/renderers/nodes/utils/ArrayElementNode.js +79 -0
  385. data/lib-opal/js_wrap/three/renderers/nodes/utils/ConvertNode.js +82 -0
  386. data/lib-opal/js_wrap/three/renderers/nodes/utils/JoinNode.js +88 -0
  387. data/lib-opal/js_wrap/three/renderers/nodes/utils/OscNode.js +105 -0
  388. data/lib-opal/js_wrap/three/renderers/nodes/utils/SplitNode.js +96 -0
  389. data/lib-opal/js_wrap/three/renderers/nodes/utils/SpriteSheetUVNode.js +98 -0
  390. data/lib-opal/js_wrap/three/renderers/nodes/utils/TimerNode.js +93 -0
  391. data/lib-opal/js_wrap/three/renderers/webgl/nodes/SlotNode.js +72 -0
  392. data/lib-opal/js_wrap/three/renderers/webgl/nodes/WebGLNodeBuilder.js +463 -0
  393. data/lib-opal/js_wrap/three/renderers/webgl/nodes/WebGLNodes.js +62 -0
  394. data/lib-opal/js_wrap/three/renderers/webgl/nodes/WebGLPhysicalContextNode.js +95 -0
  395. data/lib-opal/js_wrap/three/renderers/webgpu/WebGPU.js +62 -0
  396. data/lib-opal/js_wrap/three/renderers/webgpu/WebGPUAttributes.js +118 -0
  397. data/lib-opal/js_wrap/three/renderers/webgpu/WebGPUBackground.js +109 -0
  398. data/lib-opal/js_wrap/three/renderers/webgpu/WebGPUBinding.js +52 -0
  399. data/lib-opal/js_wrap/three/renderers/webgpu/WebGPUBindings.js +254 -0
  400. data/lib-opal/js_wrap/three/renderers/webgpu/WebGPUBufferUtils.js +39 -0
  401. data/lib-opal/js_wrap/three/renderers/webgpu/WebGPUComputePipelines.js +82 -0
  402. data/lib-opal/js_wrap/three/renderers/webgpu/WebGPUGeometries.js +84 -0
  403. data/lib-opal/js_wrap/three/renderers/webgpu/WebGPUInfo.js +86 -0
  404. data/lib-opal/js_wrap/three/renderers/webgpu/WebGPUObjects.js +64 -0
  405. data/lib-opal/js_wrap/three/renderers/webgpu/WebGPUProgrammableStage.js +46 -0
  406. data/lib-opal/js_wrap/three/renderers/webgpu/WebGPUProperties.js +63 -0
  407. data/lib-opal/js_wrap/three/renderers/webgpu/WebGPURenderLists.js +180 -0
  408. data/lib-opal/js_wrap/three/renderers/webgpu/WebGPURenderPipeline.js +662 -0
  409. data/lib-opal/js_wrap/three/renderers/webgpu/WebGPURenderPipelines.js +275 -0
  410. data/lib-opal/js_wrap/three/renderers/webgpu/WebGPURenderer.js +883 -0
  411. data/lib-opal/js_wrap/three/renderers/webgpu/WebGPUSampledTexture.js +139 -0
  412. data/lib-opal/js_wrap/three/renderers/webgpu/WebGPUSampler.js +76 -0
  413. data/lib-opal/js_wrap/three/renderers/webgpu/WebGPUStorageBuffer.js +69 -0
  414. data/lib-opal/js_wrap/three/renderers/webgpu/WebGPUTextureRenderer.js +64 -0
  415. data/lib-opal/js_wrap/three/renderers/webgpu/WebGPUTextureUtils.js +125 -0
  416. data/lib-opal/js_wrap/three/renderers/webgpu/WebGPUTextures.js +681 -0
  417. data/lib-opal/js_wrap/three/renderers/webgpu/WebGPUUniform.js +237 -0
  418. data/lib-opal/js_wrap/three/renderers/webgpu/WebGPUUniformBuffer.js +90 -0
  419. data/lib-opal/js_wrap/three/renderers/webgpu/WebGPUUniformsGroup.js +294 -0
  420. data/lib-opal/js_wrap/three/renderers/webgpu/constants.js +263 -0
  421. data/lib-opal/js_wrap/three/renderers/webgpu/nodes/WebGPUNodeBuilder.js +619 -0
  422. data/lib-opal/js_wrap/three/renderers/webgpu/nodes/WebGPUNodeSampledTexture.js +67 -0
  423. data/lib-opal/js_wrap/three/renderers/webgpu/nodes/WebGPUNodeSampler.js +71 -0
  424. data/lib-opal/js_wrap/three/renderers/webgpu/nodes/WebGPUNodeUniform.js +229 -0
  425. data/lib-opal/js_wrap/three/renderers/webgpu/nodes/WebGPUNodeUniformsGroup.js +68 -0
  426. data/lib-opal/js_wrap/three/renderers/webgpu/nodes/WebGPUNodes.js +106 -0
  427. data/lib-opal/js_wrap/three/shaders/ACESFilmicToneMappingShader.js +45 -0
  428. data/lib-opal/js_wrap/three/shaders/AfterimageShader.js +46 -0
  429. data/lib-opal/js_wrap/three/shaders/BasicShader.js +34 -0
  430. data/lib-opal/js_wrap/three/shaders/BleachBypassShader.js +43 -0
  431. data/lib-opal/js_wrap/three/shaders/BlendShader.js +47 -0
  432. data/lib-opal/js_wrap/three/shaders/BokehShader.js +65 -0
  433. data/lib-opal/js_wrap/three/shaders/BokehShader2.js +125 -0
  434. data/lib-opal/js_wrap/three/shaders/BrightnessContrastShader.js +47 -0
  435. data/lib-opal/js_wrap/three/shaders/ColorCorrectionShader.js +47 -0
  436. data/lib-opal/js_wrap/three/shaders/ColorifyShader.js +41 -0
  437. data/lib-opal/js_wrap/three/shaders/ConvolutionShader.js +75 -0
  438. data/lib-opal/js_wrap/three/shaders/CopyShader.js +41 -0
  439. data/lib-opal/js_wrap/three/shaders/DOFMipMapShader.js +49 -0
  440. data/lib-opal/js_wrap/three/shaders/DepthLimitedBlurShader.js +95 -0
  441. data/lib-opal/js_wrap/three/shaders/DigitalGlitch.js +79 -0
  442. data/lib-opal/js_wrap/three/shaders/DotScreenShader.js +52 -0
  443. data/lib-opal/js_wrap/three/shaders/FXAAShader.js +78 -0
  444. data/lib-opal/js_wrap/three/shaders/FilmShader.js +69 -0
  445. data/lib-opal/js_wrap/three/shaders/FocusShader.js +52 -0
  446. data/lib-opal/js_wrap/three/shaders/FreiChenShader.js +44 -0
  447. data/lib-opal/js_wrap/three/shaders/GammaCorrectionShader.js +39 -0
  448. data/lib-opal/js_wrap/three/shaders/GodRaysShader.js +140 -0
  449. data/lib-opal/js_wrap/three/shaders/HalftoneShader.js +77 -0
  450. data/lib-opal/js_wrap/three/shaders/HorizontalBlurShader.js +47 -0
  451. data/lib-opal/js_wrap/three/shaders/HorizontalTiltShiftShader.js +49 -0
  452. data/lib-opal/js_wrap/three/shaders/HueSaturationShader.js +47 -0
  453. data/lib-opal/js_wrap/three/shaders/KaleidoShader.js +50 -0
  454. data/lib-opal/js_wrap/three/shaders/LuminosityHighPassShader.js +52 -0
  455. data/lib-opal/js_wrap/three/shaders/LuminosityShader.js +39 -0
  456. data/lib-opal/js_wrap/three/shaders/MMDToonShader.js +48 -0
  457. data/lib-opal/js_wrap/three/shaders/MirrorShader.js +44 -0
  458. data/lib-opal/js_wrap/three/shaders/NormalMapShader.js +48 -0
  459. data/lib-opal/js_wrap/three/shaders/PixelShader.js +44 -0
  460. data/lib-opal/js_wrap/three/shaders/RGBShiftShader.js +50 -0
  461. data/lib-opal/js_wrap/three/shaders/SAOShader.js +85 -0
  462. data/lib-opal/js_wrap/three/shaders/SMAAShader.js +95 -0
  463. data/lib-opal/js_wrap/three/shaders/SSAOShader.js +113 -0
  464. data/lib-opal/js_wrap/three/shaders/SSRShader.js +126 -0
  465. data/lib-opal/js_wrap/three/shaders/SSRrShader.js +106 -0
  466. data/lib-opal/js_wrap/three/shaders/SepiaShader.js +43 -0
  467. data/lib-opal/js_wrap/three/shaders/SobelOperatorShader.js +44 -0
  468. data/lib-opal/js_wrap/three/shaders/SubsurfaceScatteringShader.js +64 -0
  469. data/lib-opal/js_wrap/three/shaders/TechnicolorShader.js +41 -0
  470. data/lib-opal/js_wrap/three/shaders/ToneMapShader.js +53 -0
  471. data/lib-opal/js_wrap/three/shaders/ToonShader.js +148 -0
  472. data/lib-opal/js_wrap/three/shaders/TriangleBlurShader.js +47 -0
  473. data/lib-opal/js_wrap/three/shaders/UnpackDepthRGBAShader.js +42 -0
  474. data/lib-opal/js_wrap/three/shaders/VerticalBlurShader.js +47 -0
  475. data/lib-opal/js_wrap/three/shaders/VerticalTiltShiftShader.js +49 -0
  476. data/lib-opal/js_wrap/three/shaders/VignetteShader.js +46 -0
  477. data/lib-opal/js_wrap/three/shaders/VolumeShader.js +55 -0
  478. data/lib-opal/js_wrap/three/shaders/WaterRefractionShader.js +46 -0
  479. data/lib-opal/js_wrap/three/textures/FlakesTexture.js +61 -0
  480. data/lib-opal/js_wrap/three/utils/BufferGeometryUtils.js +683 -0
  481. data/lib-opal/js_wrap/three/utils/CameraUtils.js +97 -0
  482. data/lib-opal/js_wrap/three/utils/GPUStatsPanel.js +154 -0
  483. data/lib-opal/js_wrap/three/utils/GeometryCompressionUtils.js +468 -0
  484. data/lib-opal/js_wrap/three/utils/GeometryUtils.js +192 -0
  485. data/lib-opal/js_wrap/three/utils/PackedPhongMaterial.js +77 -0
  486. data/lib-opal/js_wrap/three/utils/RoughnessMipmapper.js +169 -0
  487. data/lib-opal/js_wrap/three/utils/SceneUtils.js +62 -0
  488. data/lib-opal/js_wrap/three/utils/ShadowMapViewer.js +182 -0
  489. data/lib-opal/js_wrap/three/utils/SkeletonUtils.js +400 -0
  490. data/lib-opal/js_wrap/three/utils/UVsDebug.js +132 -0
  491. data/lib-opal/js_wrap/three/utils/WorkerPool.js +130 -0
  492. data/lib-opal/js_wrap/three/webxr/ARButton.js +203 -0
  493. data/lib-opal/js_wrap/three/webxr/OculusHandModel.js +131 -0
  494. data/lib-opal/js_wrap/three/webxr/OculusHandPointerModel.js +328 -0
  495. data/lib-opal/js_wrap/three/webxr/Text2D.js +54 -0
  496. data/lib-opal/js_wrap/three/webxr/VRButton.js +181 -0
  497. data/lib-opal/js_wrap/three/webxr/XRControllerModelFactory.js +266 -0
  498. data/lib-opal/js_wrap/three/webxr/XREstimatedLight.js +221 -0
  499. data/lib-opal/js_wrap/three/webxr/XRHandMeshModel.js +93 -0
  500. data/lib-opal/js_wrap/three/webxr/XRHandModelFactory.js +127 -0
  501. data/lib-opal/js_wrap/three/webxr/XRHandPrimitiveModel.js +85 -0
  502. data/opal-js_wrap-three.gemspec +4 -4
  503. metadata +502 -5
@@ -0,0 +1,662 @@
1
+ (function (global, factory) {
2
+ if (typeof define === "function" && define.amd) {
3
+ define(["exports", "./constants.js", "three"], factory);
4
+ } else if (typeof exports !== "undefined") {
5
+ factory(exports, require("./constants.js"), require("three"));
6
+ } else {
7
+ var mod = {
8
+ exports: {}
9
+ };
10
+ factory(mod.exports, global.constants, global.three);
11
+ global.WebGPURenderPipeline = mod.exports;
12
+ }
13
+ })(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports, _constants, _three) {
14
+ "use strict";
15
+
16
+ Object.defineProperty(_exports, "__esModule", {
17
+ value: true
18
+ });
19
+ _exports.default = void 0;
20
+
21
+ function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
22
+
23
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
24
+
25
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
26
+
27
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
28
+
29
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
30
+
31
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
32
+
33
+ var WebGPURenderPipeline = /*#__PURE__*/function () {
34
+ function WebGPURenderPipeline(device, renderer, sampleCount) {
35
+ _classCallCheck(this, WebGPURenderPipeline);
36
+
37
+ this.cacheKey = null;
38
+ this.shaderAttributes = null;
39
+ this.stageVertex = null;
40
+ this.stageFragment = null;
41
+ this.usedTimes = 0;
42
+ this._device = device;
43
+ this._renderer = renderer;
44
+ this._sampleCount = sampleCount;
45
+ }
46
+
47
+ _createClass(WebGPURenderPipeline, [{
48
+ key: "init",
49
+ value: function init(cacheKey, stageVertex, stageFragment, object, nodeBuilder) {
50
+ var material = object.material;
51
+ var geometry = object.geometry; // determine shader attributes
52
+
53
+ var shaderAttributes = this._getShaderAttributes(nodeBuilder, geometry); // vertex buffers
54
+
55
+
56
+ var vertexBuffers = [];
57
+
58
+ var _iterator = _createForOfIteratorHelper(shaderAttributes),
59
+ _step;
60
+
61
+ try {
62
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
63
+ var attribute = _step.value;
64
+ var name = attribute.name;
65
+ var geometryAttribute = geometry.getAttribute(name);
66
+ var stepMode = geometryAttribute !== undefined && geometryAttribute.isInstancedBufferAttribute ? _constants.GPUInputStepMode.Instance : _constants.GPUInputStepMode.Vertex;
67
+ vertexBuffers.push({
68
+ arrayStride: attribute.arrayStride,
69
+ attributes: [{
70
+ shaderLocation: attribute.slot,
71
+ offset: 0,
72
+ format: attribute.format
73
+ }],
74
+ stepMode: stepMode
75
+ });
76
+ }
77
+ } catch (err) {
78
+ _iterator.e(err);
79
+ } finally {
80
+ _iterator.f();
81
+ }
82
+
83
+ this.cacheKey = cacheKey;
84
+ this.shaderAttributes = shaderAttributes;
85
+ this.stageVertex = stageVertex;
86
+ this.stageFragment = stageFragment; // blending
87
+
88
+ var alphaBlend = {};
89
+ var colorBlend = {};
90
+
91
+ if (material.transparent === true && material.blending !== _three.NoBlending) {
92
+ alphaBlend = this._getAlphaBlend(material);
93
+ colorBlend = this._getColorBlend(material);
94
+ } // stencil
95
+
96
+
97
+ var stencilFront = {};
98
+
99
+ if (material.stencilWrite === true) {
100
+ stencilFront = {
101
+ compare: this._getStencilCompare(material),
102
+ failOp: this._getStencilOperation(material.stencilFail),
103
+ depthFailOp: this._getStencilOperation(material.stencilZFail),
104
+ passOp: this._getStencilOperation(material.stencilZPass)
105
+ };
106
+ } //
107
+
108
+
109
+ var primitiveState = this._getPrimitiveState(object, material);
110
+
111
+ var colorWriteMask = this._getColorWriteMask(material);
112
+
113
+ var depthCompare = this._getDepthCompare(material);
114
+
115
+ var colorFormat = this._renderer.getCurrentColorFormat();
116
+
117
+ var depthStencilFormat = this._renderer.getCurrentDepthStencilFormat();
118
+
119
+ this.pipeline = this._device.createRenderPipeline({
120
+ vertex: Object.assign({}, stageVertex.stage, {
121
+ buffers: vertexBuffers
122
+ }),
123
+ fragment: Object.assign({}, stageFragment.stage, {
124
+ targets: [{
125
+ format: colorFormat,
126
+ blend: {
127
+ alpha: alphaBlend,
128
+ color: colorBlend
129
+ },
130
+ writeMask: colorWriteMask
131
+ }]
132
+ }),
133
+ primitive: primitiveState,
134
+ depthStencil: {
135
+ format: depthStencilFormat,
136
+ depthWriteEnabled: material.depthWrite,
137
+ depthCompare: depthCompare,
138
+ stencilFront: stencilFront,
139
+ stencilBack: {},
140
+ // three.js does not provide an API to configure the back function (gl.stencilFuncSeparate() was never used)
141
+ stencilReadMask: material.stencilFuncMask,
142
+ stencilWriteMask: material.stencilWriteMask
143
+ },
144
+ multisample: {
145
+ count: this._sampleCount
146
+ }
147
+ });
148
+ }
149
+ }, {
150
+ key: "_getArrayStride",
151
+ value: function _getArrayStride(type, bytesPerElement) {
152
+ // @TODO: This code is GLSL specific. We need to update when we switch to WGSL.
153
+ if (type === 'float' || type === 'int' || type === 'uint') return bytesPerElement;
154
+ if (type === 'vec2' || type === 'ivec2' || type === 'uvec2') return bytesPerElement * 2;
155
+ if (type === 'vec3' || type === 'ivec3' || type === 'uvec3') return bytesPerElement * 3;
156
+ if (type === 'vec4' || type === 'ivec4' || type === 'uvec4') return bytesPerElement * 4;
157
+ console.error('THREE.WebGPURenderer: Shader variable type not supported yet.', type);
158
+ }
159
+ }, {
160
+ key: "_getAlphaBlend",
161
+ value: function _getAlphaBlend(material) {
162
+ var blending = material.blending;
163
+ var premultipliedAlpha = material.premultipliedAlpha;
164
+ var alphaBlend = undefined;
165
+
166
+ switch (blending) {
167
+ case _three.NormalBlending:
168
+ if (premultipliedAlpha === false) {
169
+ alphaBlend = {
170
+ srcFactor: _constants.GPUBlendFactor.One,
171
+ dstFactor: _constants.GPUBlendFactor.OneMinusSrcAlpha,
172
+ operation: _constants.GPUBlendOperation.Add
173
+ };
174
+ }
175
+
176
+ break;
177
+
178
+ case _three.AdditiveBlending:
179
+ // no alphaBlend settings
180
+ break;
181
+
182
+ case _three.SubtractiveBlending:
183
+ if (premultipliedAlpha === true) {
184
+ alphaBlend = {
185
+ srcFactor: _constants.GPUBlendFactor.OneMinusSrcColor,
186
+ dstFactor: _constants.GPUBlendFactor.OneMinusSrcAlpha,
187
+ operation: _constants.GPUBlendOperation.Add
188
+ };
189
+ }
190
+
191
+ break;
192
+
193
+ case _three.MultiplyBlending:
194
+ if (premultipliedAlpha === true) {
195
+ alphaBlend = {
196
+ srcFactor: _constants.GPUBlendFactor.Zero,
197
+ dstFactor: _constants.GPUBlendFactor.SrcAlpha,
198
+ operation: _constants.GPUBlendOperation.Add
199
+ };
200
+ }
201
+
202
+ break;
203
+
204
+ case _three.CustomBlending:
205
+ var blendSrcAlpha = material.blendSrcAlpha;
206
+ var blendDstAlpha = material.blendDstAlpha;
207
+ var blendEquationAlpha = material.blendEquationAlpha;
208
+
209
+ if (blendSrcAlpha !== null && blendDstAlpha !== null && blendEquationAlpha !== null) {
210
+ alphaBlend = {
211
+ srcFactor: this._getBlendFactor(blendSrcAlpha),
212
+ dstFactor: this._getBlendFactor(blendDstAlpha),
213
+ operation: this._getBlendOperation(blendEquationAlpha)
214
+ };
215
+ }
216
+
217
+ break;
218
+
219
+ default:
220
+ console.error('THREE.WebGPURenderer: Blending not supported.', blending);
221
+ }
222
+
223
+ return alphaBlend;
224
+ }
225
+ }, {
226
+ key: "_getBlendFactor",
227
+ value: function _getBlendFactor(blend) {
228
+ var blendFactor;
229
+
230
+ switch (blend) {
231
+ case _three.ZeroFactor:
232
+ blendFactor = _constants.GPUBlendFactor.Zero;
233
+ break;
234
+
235
+ case _three.OneFactor:
236
+ blendFactor = _constants.GPUBlendFactor.One;
237
+ break;
238
+
239
+ case _three.SrcColorFactor:
240
+ blendFactor = _constants.GPUBlendFactor.SrcColor;
241
+ break;
242
+
243
+ case _three.OneMinusSrcColorFactor:
244
+ blendFactor = _constants.GPUBlendFactor.OneMinusSrcColor;
245
+ break;
246
+
247
+ case _three.SrcAlphaFactor:
248
+ blendFactor = _constants.GPUBlendFactor.SrcAlpha;
249
+ break;
250
+
251
+ case _three.OneMinusSrcAlphaFactor:
252
+ blendFactor = _constants.GPUBlendFactor.OneMinusSrcAlpha;
253
+ break;
254
+
255
+ case _three.DstColorFactor:
256
+ blendFactor = _constants.GPUBlendFactor.DstColor;
257
+ break;
258
+
259
+ case _three.OneMinusDstColorFactor:
260
+ blendFactor = _constants.GPUBlendFactor.OneMinusDstColor;
261
+ break;
262
+
263
+ case _three.DstAlphaFactor:
264
+ blendFactor = _constants.GPUBlendFactor.DstAlpha;
265
+ break;
266
+
267
+ case _three.OneMinusDstAlphaFactor:
268
+ blendFactor = _constants.GPUBlendFactor.OneMinusDstAlpha;
269
+ break;
270
+
271
+ case _three.SrcAlphaSaturateFactor:
272
+ blendFactor = _constants.GPUBlendFactor.SrcAlphaSaturated;
273
+ break;
274
+
275
+ case _constants.BlendColorFactor:
276
+ blendFactor = _constants.GPUBlendFactor.BlendColor;
277
+ break;
278
+
279
+ case _constants.OneMinusBlendColorFactor:
280
+ blendFactor = _constants.GPUBlendFactor.OneMinusBlendColor;
281
+ break;
282
+
283
+ default:
284
+ console.error('THREE.WebGPURenderer: Blend factor not supported.', blend);
285
+ }
286
+
287
+ return blendFactor;
288
+ }
289
+ }, {
290
+ key: "_getBlendOperation",
291
+ value: function _getBlendOperation(blendEquation) {
292
+ var blendOperation;
293
+
294
+ switch (blendEquation) {
295
+ case _three.AddEquation:
296
+ blendOperation = _constants.GPUBlendOperation.Add;
297
+ break;
298
+
299
+ case _three.SubtractEquation:
300
+ blendOperation = _constants.GPUBlendOperation.Subtract;
301
+ break;
302
+
303
+ case _three.ReverseSubtractEquation:
304
+ blendOperation = _constants.GPUBlendOperation.ReverseSubtract;
305
+ break;
306
+
307
+ case _three.MinEquation:
308
+ blendOperation = _constants.GPUBlendOperation.Min;
309
+ break;
310
+
311
+ case _three.MaxEquation:
312
+ blendOperation = _constants.GPUBlendOperation.Max;
313
+ break;
314
+
315
+ default:
316
+ console.error('THREE.WebGPURenderer: Blend equation not supported.', blendEquation);
317
+ }
318
+
319
+ return blendOperation;
320
+ }
321
+ }, {
322
+ key: "_getColorBlend",
323
+ value: function _getColorBlend(material) {
324
+ var blending = material.blending;
325
+ var premultipliedAlpha = material.premultipliedAlpha;
326
+ var colorBlend = {
327
+ srcFactor: null,
328
+ dstFactor: null,
329
+ operation: null
330
+ };
331
+
332
+ switch (blending) {
333
+ case _three.NormalBlending:
334
+ colorBlend.srcFactor = premultipliedAlpha === true ? _constants.GPUBlendFactor.One : _constants.GPUBlendFactor.SrcAlpha;
335
+ colorBlend.dstFactor = _constants.GPUBlendFactor.OneMinusSrcAlpha;
336
+ colorBlend.operation = _constants.GPUBlendOperation.Add;
337
+ break;
338
+
339
+ case _three.AdditiveBlending:
340
+ colorBlend.srcFactor = premultipliedAlpha === true ? _constants.GPUBlendFactor.One : _constants.GPUBlendFactor.SrcAlpha;
341
+ colorBlend.operation = _constants.GPUBlendOperation.Add;
342
+ break;
343
+
344
+ case _three.SubtractiveBlending:
345
+ colorBlend.srcFactor = _constants.GPUBlendFactor.Zero;
346
+ colorBlend.dstFactor = premultipliedAlpha === true ? _constants.GPUBlendFactor.Zero : _constants.GPUBlendFactor.OneMinusSrcColor;
347
+ colorBlend.operation = _constants.GPUBlendOperation.Add;
348
+ break;
349
+
350
+ case _three.MultiplyBlending:
351
+ colorBlend.srcFactor = _constants.GPUBlendFactor.Zero;
352
+ colorBlend.dstFactor = _constants.GPUBlendFactor.SrcColor;
353
+ colorBlend.operation = _constants.GPUBlendOperation.Add;
354
+ break;
355
+
356
+ case _three.CustomBlending:
357
+ colorBlend.srcFactor = this._getBlendFactor(material.blendSrc);
358
+ colorBlend.dstFactor = this._getBlendFactor(material.blendDst);
359
+ colorBlend.operation = this._getBlendOperation(material.blendEquation);
360
+ break;
361
+
362
+ default:
363
+ console.error('THREE.WebGPURenderer: Blending not supported.', blending);
364
+ }
365
+
366
+ return colorBlend;
367
+ }
368
+ }, {
369
+ key: "_getColorWriteMask",
370
+ value: function _getColorWriteMask(material) {
371
+ return material.colorWrite === true ? _constants.GPUColorWriteFlags.All : _constants.GPUColorWriteFlags.None;
372
+ }
373
+ }, {
374
+ key: "_getDepthCompare",
375
+ value: function _getDepthCompare(material) {
376
+ var depthCompare;
377
+
378
+ if (material.depthTest === false) {
379
+ depthCompare = _constants.GPUCompareFunction.Always;
380
+ } else {
381
+ var depthFunc = material.depthFunc;
382
+
383
+ switch (depthFunc) {
384
+ case _three.NeverDepth:
385
+ depthCompare = _constants.GPUCompareFunction.Never;
386
+ break;
387
+
388
+ case _three.AlwaysDepth:
389
+ depthCompare = _constants.GPUCompareFunction.Always;
390
+ break;
391
+
392
+ case _three.LessDepth:
393
+ depthCompare = _constants.GPUCompareFunction.Less;
394
+ break;
395
+
396
+ case _three.LessEqualDepth:
397
+ depthCompare = _constants.GPUCompareFunction.LessEqual;
398
+ break;
399
+
400
+ case _three.EqualDepth:
401
+ depthCompare = _constants.GPUCompareFunction.Equal;
402
+ break;
403
+
404
+ case _three.GreaterEqualDepth:
405
+ depthCompare = _constants.GPUCompareFunction.GreaterEqual;
406
+ break;
407
+
408
+ case _three.GreaterDepth:
409
+ depthCompare = _constants.GPUCompareFunction.Greater;
410
+ break;
411
+
412
+ case _three.NotEqualDepth:
413
+ depthCompare = _constants.GPUCompareFunction.NotEqual;
414
+ break;
415
+
416
+ default:
417
+ console.error('THREE.WebGPURenderer: Invalid depth function.', depthFunc);
418
+ }
419
+ }
420
+
421
+ return depthCompare;
422
+ }
423
+ }, {
424
+ key: "_getPrimitiveState",
425
+ value: function _getPrimitiveState(object, material) {
426
+ var descriptor = {};
427
+ descriptor.topology = this._getPrimitiveTopology(object);
428
+
429
+ if (object.isLine === true && object.isLineSegments !== true) {
430
+ var geometry = object.geometry;
431
+ var count = geometry.index ? geometry.index.count : geometry.attributes.position.count;
432
+ descriptor.stripIndexFormat = count > 65535 ? _constants.GPUIndexFormat.Uint32 : _constants.GPUIndexFormat.Uint16; // define data type for primitive restart value
433
+ }
434
+
435
+ switch (material.side) {
436
+ case _three.FrontSide:
437
+ descriptor.frontFace = _constants.GPUFrontFace.CCW;
438
+ descriptor.cullMode = _constants.GPUCullMode.Back;
439
+ break;
440
+
441
+ case _three.BackSide:
442
+ descriptor.frontFace = _constants.GPUFrontFace.CW;
443
+ descriptor.cullMode = _constants.GPUCullMode.Back;
444
+ break;
445
+
446
+ case _three.DoubleSide:
447
+ descriptor.frontFace = _constants.GPUFrontFace.CCW;
448
+ descriptor.cullMode = _constants.GPUCullMode.None;
449
+ break;
450
+
451
+ default:
452
+ console.error('THREE.WebGPURenderer: Unknown Material.side value.', material.side);
453
+ break;
454
+ }
455
+
456
+ return descriptor;
457
+ }
458
+ }, {
459
+ key: "_getPrimitiveTopology",
460
+ value: function _getPrimitiveTopology(object) {
461
+ if (object.isMesh) return _constants.GPUPrimitiveTopology.TriangleList;else if (object.isPoints) return _constants.GPUPrimitiveTopology.PointList;else if (object.isLineSegments) return _constants.GPUPrimitiveTopology.LineList;else if (object.isLine) return _constants.GPUPrimitiveTopology.LineStrip;
462
+ }
463
+ }, {
464
+ key: "_getStencilCompare",
465
+ value: function _getStencilCompare(material) {
466
+ var stencilCompare;
467
+ var stencilFunc = material.stencilFunc;
468
+
469
+ switch (stencilFunc) {
470
+ case _three.NeverStencilFunc:
471
+ stencilCompare = _constants.GPUCompareFunction.Never;
472
+ break;
473
+
474
+ case _three.AlwaysStencilFunc:
475
+ stencilCompare = _constants.GPUCompareFunction.Always;
476
+ break;
477
+
478
+ case _three.LessStencilFunc:
479
+ stencilCompare = _constants.GPUCompareFunction.Less;
480
+ break;
481
+
482
+ case _three.LessEqualStencilFunc:
483
+ stencilCompare = _constants.GPUCompareFunction.LessEqual;
484
+ break;
485
+
486
+ case _three.EqualStencilFunc:
487
+ stencilCompare = _constants.GPUCompareFunction.Equal;
488
+ break;
489
+
490
+ case _three.GreaterEqualStencilFunc:
491
+ stencilCompare = _constants.GPUCompareFunction.GreaterEqual;
492
+ break;
493
+
494
+ case _three.GreaterStencilFunc:
495
+ stencilCompare = _constants.GPUCompareFunction.Greater;
496
+ break;
497
+
498
+ case _three.NotEqualStencilFunc:
499
+ stencilCompare = _constants.GPUCompareFunction.NotEqual;
500
+ break;
501
+
502
+ default:
503
+ console.error('THREE.WebGPURenderer: Invalid stencil function.', stencilFunc);
504
+ }
505
+
506
+ return stencilCompare;
507
+ }
508
+ }, {
509
+ key: "_getStencilOperation",
510
+ value: function _getStencilOperation(op) {
511
+ var stencilOperation;
512
+
513
+ switch (op) {
514
+ case _three.KeepStencilOp:
515
+ stencilOperation = _constants.GPUStencilOperation.Keep;
516
+ break;
517
+
518
+ case _three.ZeroStencilOp:
519
+ stencilOperation = _constants.GPUStencilOperation.Zero;
520
+ break;
521
+
522
+ case _three.ReplaceStencilOp:
523
+ stencilOperation = _constants.GPUStencilOperation.Replace;
524
+ break;
525
+
526
+ case _three.InvertStencilOp:
527
+ stencilOperation = _constants.GPUStencilOperation.Invert;
528
+ break;
529
+
530
+ case _three.IncrementStencilOp:
531
+ stencilOperation = _constants.GPUStencilOperation.IncrementClamp;
532
+ break;
533
+
534
+ case _three.DecrementStencilOp:
535
+ stencilOperation = _constants.GPUStencilOperation.DecrementClamp;
536
+ break;
537
+
538
+ case _three.IncrementWrapStencilOp:
539
+ stencilOperation = _constants.GPUStencilOperation.IncrementWrap;
540
+ break;
541
+
542
+ case _three.DecrementWrapStencilOp:
543
+ stencilOperation = _constants.GPUStencilOperation.DecrementWrap;
544
+ break;
545
+
546
+ default:
547
+ console.error('THREE.WebGPURenderer: Invalid stencil operation.', stencilOperation);
548
+ }
549
+
550
+ return stencilOperation;
551
+ }
552
+ }, {
553
+ key: "_getVertexFormat",
554
+ value: function _getVertexFormat(type, bytesPerElement) {
555
+ // float
556
+ if (type === 'float') return _constants.GPUVertexFormat.Float32;
557
+
558
+ if (type === 'vec2') {
559
+ if (bytesPerElement === 2) {
560
+ return _constants.GPUVertexFormat.Float16x2;
561
+ } else {
562
+ return _constants.GPUVertexFormat.Float32x2;
563
+ }
564
+ }
565
+
566
+ if (type === 'vec3') return _constants.GPUVertexFormat.Float32x3;
567
+
568
+ if (type === 'vec4') {
569
+ if (bytesPerElement === 2) {
570
+ return _constants.GPUVertexFormat.Float16x4;
571
+ } else {
572
+ return _constants.GPUVertexFormat.Float32x4;
573
+ }
574
+ } // int
575
+
576
+
577
+ if (type === 'int') return _constants.GPUVertexFormat.Sint32;
578
+
579
+ if (type === 'ivec2') {
580
+ if (bytesPerElement === 1) {
581
+ return _constants.GPUVertexFormat.Sint8x2;
582
+ } else if (bytesPerElement === 2) {
583
+ return _constants.GPUVertexFormat.Sint16x2;
584
+ } else {
585
+ return _constants.GPUVertexFormat.Sint32x2;
586
+ }
587
+ }
588
+
589
+ if (type === 'ivec3') return _constants.GPUVertexFormat.Sint32x3;
590
+
591
+ if (type === 'ivec4') {
592
+ if (bytesPerElement === 1) {
593
+ return _constants.GPUVertexFormat.Sint8x4;
594
+ } else if (bytesPerElement === 2) {
595
+ return _constants.GPUVertexFormat.Sint16x4;
596
+ } else {
597
+ return _constants.GPUVertexFormat.Sint32x4;
598
+ }
599
+ } // uint
600
+
601
+
602
+ if (type === 'uint') return _constants.GPUVertexFormat.Uint32;
603
+
604
+ if (type === 'uvec2') {
605
+ if (bytesPerElement === 1) {
606
+ return _constants.GPUVertexFormat.Uint8x2;
607
+ } else if (bytesPerElement === 2) {
608
+ return _constants.GPUVertexFormat.Uint16x2;
609
+ } else {
610
+ return _constants.GPUVertexFormat.Uint32x2;
611
+ }
612
+ }
613
+
614
+ if (type === 'uvec3') return _constants.GPUVertexFormat.Uint32x3;
615
+
616
+ if (type === 'uvec4') {
617
+ if (bytesPerElement === 1) {
618
+ return _constants.GPUVertexFormat.Uint8x4;
619
+ } else if (bytesPerElement === 2) {
620
+ return _constants.GPUVertexFormat.Uint16x4;
621
+ } else {
622
+ return _constants.GPUVertexFormat.Uint32x4;
623
+ }
624
+ }
625
+
626
+ console.error('THREE.WebGPURenderer: Shader variable type not supported yet.', type);
627
+ }
628
+ }, {
629
+ key: "_getShaderAttributes",
630
+ value: function _getShaderAttributes(nodeBuilder, geometry) {
631
+ var nodeAttributes = nodeBuilder.attributes;
632
+ var attributes = [];
633
+
634
+ for (var slot = 0; slot < nodeAttributes.length; slot++) {
635
+ var nodeAttribute = nodeAttributes[slot];
636
+ var name = nodeAttribute.name;
637
+ var type = nodeAttribute.type;
638
+ var geometryAttribute = geometry.getAttribute(name);
639
+ var bytesPerElement = geometryAttribute !== undefined ? geometryAttribute.array.BYTES_PER_ELEMENT : 4;
640
+
641
+ var arrayStride = this._getArrayStride(type, bytesPerElement);
642
+
643
+ var format = this._getVertexFormat(type, bytesPerElement);
644
+
645
+ attributes.push({
646
+ name: name,
647
+ arrayStride: arrayStride,
648
+ format: format,
649
+ slot: slot
650
+ });
651
+ }
652
+
653
+ return attributes;
654
+ }
655
+ }]);
656
+
657
+ return WebGPURenderPipeline;
658
+ }();
659
+
660
+ var _default = WebGPURenderPipeline;
661
+ _exports.default = _default;
662
+ });