@needle-tools/engine 4.11.0-next.91b9cf1 → 4.11.0-next.c7baa24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -1
- package/README.md +3 -1
- package/components.needle.json +1 -1
- package/dist/{gltf-progressive-B63NpN_i.js → gltf-progressive-BvlZQAkt.js} +4 -4
- package/dist/{gltf-progressive-D4Z_Khp3.min.js → gltf-progressive-CftVUJy3.min.js} +1 -1
- package/dist/{gltf-progressive-CHeORqEv.umd.cjs → gltf-progressive-GwdQV1Qx.umd.cjs} +1 -1
- package/dist/{needle-engine.bundle-DtfAXDjU.umd.cjs → needle-engine.bundle-DBDKvYj5.umd.cjs} +144 -144
- package/dist/{needle-engine.bundle-B8HfDBoL.min.js → needle-engine.bundle-qNZSuWhD.min.js} +149 -149
- package/dist/{needle-engine.bundle-D4dsuq2U.js → needle-engine.bundle-tE15q9uM.js} +6784 -6715
- package/dist/needle-engine.d.ts +6 -0
- package/dist/needle-engine.js +4 -4
- package/dist/needle-engine.min.js +1 -1
- package/dist/needle-engine.umd.cjs +1 -1
- package/dist/{postprocessing-DQ2pynXW.js → postprocessing-CJC0Npcd.js} +2 -2
- package/dist/{postprocessing-BsnRNRRS.umd.cjs → postprocessing-DrM4PWU3.umd.cjs} +1 -1
- package/dist/{postprocessing-BHMVuZQ1.min.js → postprocessing-l7zsdO_Q.min.js} +1 -1
- package/dist/{three-qw28ZtTy.min.js → three-BDW9I486.min.js} +13 -13
- package/dist/{three-CJSAehtG.js → three-MHVqtJYj.js} +1 -0
- package/dist/{three-examples-Doq0rvFU.js → three-examples-C5Ht-QFN.js} +1 -1
- package/dist/{three-examples-Deqc1bNw.umd.cjs → three-examples-CgwGHSgz.umd.cjs} +1 -1
- package/dist/{three-examples-BivkhnvN.min.js → three-examples-fvEPSC8L.min.js} +1 -1
- package/dist/{three-B-jwTHao.umd.cjs → three-iFaDq9U3.umd.cjs} +13 -13
- package/dist/{three-mesh-ui-CktOi6oI.js → three-mesh-ui-BjWTTk1R.js} +1 -1
- package/dist/{three-mesh-ui-CsHwj9cJ.umd.cjs → three-mesh-ui-Bm32sS2a.umd.cjs} +1 -1
- package/dist/{three-mesh-ui-DhYXcXZe.min.js → three-mesh-ui-CLdkp21K.min.js} +1 -1
- package/dist/{vendor-BcsPRUmt.umd.cjs → vendor-CAWj5cBK.umd.cjs} +2 -2
- package/dist/{vendor-CyfN5nor.js → vendor-DJBpoQcM.js} +608 -599
- package/dist/{vendor-DyavoogU.min.js → vendor-DWGd3dEf.min.js} +20 -20
- package/lib/engine/engine_physics.js +25 -2
- package/lib/engine/engine_physics.js.map +1 -1
- package/lib/engine/js-extensions/Object3D.d.ts +6 -0
- package/lib/engine/js-extensions/Object3D.js +15 -0
- package/lib/engine/js-extensions/Object3D.js.map +1 -1
- package/lib/engine/physics/workers/mesh-bvh/GenerateMeshBVHWorker.js +2 -1
- package/lib/engine/physics/workers/mesh-bvh/GenerateMeshBVHWorker.js.map +1 -1
- package/lib/engine-components/Collider.d.ts +26 -0
- package/lib/engine-components/Collider.js +26 -0
- package/lib/engine-components/Collider.js.map +1 -1
- package/lib/engine-components/ContactShadows.d.ts +11 -2
- package/lib/engine-components/ContactShadows.js +11 -2
- package/lib/engine-components/ContactShadows.js.map +1 -1
- package/lib/engine-components/DropListener.d.ts +3 -0
- package/lib/engine-components/DropListener.js +44 -21
- package/lib/engine-components/DropListener.js.map +1 -1
- package/lib/engine-components/Duplicatable.d.ts +2 -2
- package/lib/engine-components/Duplicatable.js +2 -2
- package/lib/engine-components/EventList.d.ts +18 -1
- package/lib/engine-components/EventList.js +18 -1
- package/lib/engine-components/EventList.js.map +1 -1
- package/lib/engine-components/GroundProjection.d.ts +3 -0
- package/lib/engine-components/GroundProjection.js +3 -0
- package/lib/engine-components/GroundProjection.js.map +1 -1
- package/lib/engine-components/Interactable.d.ts +4 -0
- package/lib/engine-components/Interactable.js +4 -0
- package/lib/engine-components/Interactable.js.map +1 -1
- package/lib/engine-components/OrbitControls.d.ts +4 -2
- package/lib/engine-components/OrbitControls.js +31 -3
- package/lib/engine-components/OrbitControls.js.map +1 -1
- package/lib/engine-components/RigidBody.d.ts +5 -0
- package/lib/engine-components/RigidBody.js +5 -0
- package/lib/engine-components/RigidBody.js.map +1 -1
- package/lib/engine-components/SeeThrough.js +20 -0
- package/lib/engine-components/SeeThrough.js.map +1 -1
- package/lib/engine-components/export/usdz/ThreeUSDZExporter.d.ts +4 -2
- package/lib/engine-components/export/usdz/ThreeUSDZExporter.js +69 -14
- package/lib/engine-components/export/usdz/ThreeUSDZExporter.js.map +1 -1
- package/lib/engine-components/ui/Text.js +6 -1
- package/lib/engine-components/ui/Text.js.map +1 -1
- package/lib/engine-components/utils/LookAt.d.ts +3 -0
- package/lib/engine-components/utils/LookAt.js +3 -0
- package/lib/engine-components/utils/LookAt.js.map +1 -1
- package/lib/engine-components/utils/OpenURL.d.ts +2 -1
- package/lib/engine-components/utils/OpenURL.js +2 -1
- package/lib/engine-components/utils/OpenURL.js.map +1 -1
- package/lib/engine-components/web/ScrollFollow.js +1 -2
- package/lib/engine-components/web/ScrollFollow.js.map +1 -1
- package/lib/engine-components/webxr/WebARCameraBackground.d.ts +2 -0
- package/lib/engine-components/webxr/WebARCameraBackground.js +2 -0
- package/lib/engine-components/webxr/WebARCameraBackground.js.map +1 -1
- package/lib/engine-components/webxr/WebARSessionRoot.d.ts +1 -1
- package/lib/engine-components/webxr/WebARSessionRoot.js +1 -1
- package/lib/engine-components/webxr/WebXR.d.ts +2 -0
- package/lib/engine-components/webxr/WebXR.js +2 -0
- package/lib/engine-components/webxr/WebXR.js.map +1 -1
- package/lib/engine-components/webxr/WebXRImageTracking.d.ts +29 -0
- package/lib/engine-components/webxr/WebXRImageTracking.js +29 -0
- package/lib/engine-components/webxr/WebXRImageTracking.js.map +1 -1
- package/package.json +2 -2
- package/plugins/common/needle-engine.js +41 -0
- package/plugins/common/worker.js +129 -0
- package/plugins/vite/asap.js +5 -23
- package/plugins/vite/dependencies.js +21 -11
- package/plugins/vite/index.js +7 -0
- package/plugins/vite/needle-app.js +194 -0
- package/src/engine/engine_physics.ts +27 -2
- package/src/engine/js-extensions/Object3D.ts +24 -0
- package/src/engine/physics/workers/mesh-bvh/GenerateMeshBVHWorker.js +3 -1
- package/src/engine-components/Collider.ts +27 -1
- package/src/engine-components/ContactShadows.ts +12 -4
- package/src/engine-components/DropListener.ts +45 -24
- package/src/engine-components/Duplicatable.ts +2 -2
- package/src/engine-components/EventList.ts +18 -1
- package/src/engine-components/GroundProjection.ts +4 -1
- package/src/engine-components/Interactable.ts +4 -1
- package/src/engine-components/OrbitControls.ts +27 -3
- package/src/engine-components/RigidBody.ts +6 -1
- package/src/engine-components/SeeThrough.ts +42 -2
- package/src/engine-components/export/usdz/ThreeUSDZExporter.ts +117 -17
- package/src/engine-components/ui/Text.ts +11 -2
- package/src/engine-components/utils/LookAt.ts +3 -0
- package/src/engine-components/utils/OpenURL.ts +3 -2
- package/src/engine-components/web/ScrollFollow.ts +1 -1
- package/src/engine-components/webxr/WebARCameraBackground.ts +2 -0
- package/src/engine-components/webxr/WebARSessionRoot.ts +1 -1
- package/src/engine-components/webxr/WebXR.ts +2 -0
- package/src/engine-components/webxr/WebXRImageTracking.ts +30 -3
|
@@ -31897,6 +31897,7 @@ export {
|
|
|
31897
31897
|
pO as BasicNodeLibrary,
|
|
31898
31898
|
my as BatchedMesh,
|
|
31899
31899
|
Ff as Bone,
|
|
31900
|
+
Qr as BooleanKeyframeTrack,
|
|
31900
31901
|
Zn as Box3,
|
|
31901
31902
|
sP as Box3Helper,
|
|
31902
31903
|
Is as BoxGeometry,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Mesh as q, SphereGeometry as ui, Vector3 as P, MeshBasicMaterial as Qt, Node as fa, PerspectiveCamera as gs, NodeFrame as Ia, NodeBuilder as ma, GLSLNodeParser as Ea, ShaderLib as wt, UniformsUtils as gi, UniformsLib as Un, normalView as ba, defaultShaderStages as Yn, ShaderChunk as Ca, Material as en, TrianglesDrawMode as Ba, TriangleFanDrawMode as qs, TriangleStripDrawMode as Do, Matrix4 as ue, Loader as kt, LoaderUtils as tn, FileLoader as It, MeshPhysicalMaterial as Tt, Vector2 as Le, Color as Se, LinearSRGBColorSpace as Xe, SRGBColorSpace as ge, SpotLight as Ro, PointLight as zs, DirectionalLight as _o, InstancedMesh as wa, Quaternion as Te, InstancedBufferAttribute as ya, Object3D as xt, TextureLoader as di, ImageBitmapLoader as Qa, BufferAttribute as st, InterleavedBuffer as xa, LinearMipmapLinearFilter as jn, NearestMipmapLinearFilter as Mo, LinearMipmapNearestFilter as Fo, NearestMipmapNearestFilter as pi, LinearFilter as rt, NearestFilter as cs, RepeatWrapping as on, MirroredRepeatWrapping as ko, ClampToEdgeWrapping as ls, PointsMaterial as _n, LineBasicMaterial as Ft, MeshStandardMaterial as fi, DoubleSide as Ii, PropertyBinding as Lt, BufferGeometry as ut, SkinnedMesh as Lo, LineSegments as hs, Line as pt, LineLoop as Sa, Points as is, Group as nn, MathUtils as Qe, OrthographicCamera as No, Skeleton as Uo, AnimationClip as Go, Bone as Ys, InterpolateDiscrete as Po, InterpolateLinear as mi, InterleavedBufferAttribute as $t, Texture as Ks, VectorKeyframeTrack as Js, NumberKeyframeTrack as Vs, QuaternionKeyframeTrack as Ws, ColorManagement as Ve, FrontSide as Oo, Interpolant as Ta, Box3 as ds, Sphere as Ei, RGBA_S3TC_DXT1_Format as Xs, RGB_PVRTC_4BPPV1_Format as va, RGB_ETC2_Format as Ho, RGB_ETC1_Format as Da, RGBA_S3TC_DXT5_Format as Zs, RGBA_PVRTC_4BPPV1_Format as Ra, RGBA_ETC2_EAC_Format as jo, RGBA_BPTC_Format as $s, RGB_BPTC_UNSIGNED_Format as _a, RGBA_ASTC_4x4_Format as os, RGBAFormat as zt, FloatType as mt, HalfFloatType as We, UnsignedByteType as dt, CompressedCubeTexture as Ma, CompressedArrayTexture as Fa, CompressedTexture as Gn, NoColorSpace as us, RGBA_S3TC_DXT3_Format as Mi, RGB_S3TC_DXT1_Format as Fi, RGBA_ASTC_6x6_Format as ki, RGBFormat as ei, RedFormat as gn, RGFormat as Mn, UnsignedInt101111Type as qo, UnsignedInt5999Type as zo, DataTexture as ka, Data3DTexture as La, ExtrudeGeometry as Na, ShapePath as Ua, Raycaster as bi, CylinderGeometry as Ye, BoxGeometry as je, Float32BufferAttribute as Fe, OctahedronGeometry as Kn, TorusGeometry as bn, Euler as qt, Controls as Yo, PlaneGeometry as Ci, DataTextureLoader as Ko, DataUtils as dn, Vector4 as Nt, Curve as Ga, MeshPhongMaterial as Pn, MeshLambertMaterial as Pa, EquirectangularReflectionMapping as Oa, AmbientLight as Ha, Uint16BufferAttribute as ja, Matrix3 as Jo, ShapeUtils as qa, DefaultLoadingManager as za, Ray as Ya, Plane as Ka, MOUSE as fn, TOUCH as pn, Spherical as Li, ShaderMaterial as Vo, Uniform$1 as Ja, Scene as ti, WebGLRenderer as Va, CanvasTexture as Wo, REVISION as Wa, Source as Xa, InstancedBufferGeometry as Za, InstancedInterleavedBuffer as ni, WireframeGeometry as $a, Line3 as eA } from "./three-
|
|
1
|
+
import { Mesh as q, SphereGeometry as ui, Vector3 as P, MeshBasicMaterial as Qt, Node as fa, PerspectiveCamera as gs, NodeFrame as Ia, NodeBuilder as ma, GLSLNodeParser as Ea, ShaderLib as wt, UniformsUtils as gi, UniformsLib as Un, normalView as ba, defaultShaderStages as Yn, ShaderChunk as Ca, Material as en, TrianglesDrawMode as Ba, TriangleFanDrawMode as qs, TriangleStripDrawMode as Do, Matrix4 as ue, Loader as kt, LoaderUtils as tn, FileLoader as It, MeshPhysicalMaterial as Tt, Vector2 as Le, Color as Se, LinearSRGBColorSpace as Xe, SRGBColorSpace as ge, SpotLight as Ro, PointLight as zs, DirectionalLight as _o, InstancedMesh as wa, Quaternion as Te, InstancedBufferAttribute as ya, Object3D as xt, TextureLoader as di, ImageBitmapLoader as Qa, BufferAttribute as st, InterleavedBuffer as xa, LinearMipmapLinearFilter as jn, NearestMipmapLinearFilter as Mo, LinearMipmapNearestFilter as Fo, NearestMipmapNearestFilter as pi, LinearFilter as rt, NearestFilter as cs, RepeatWrapping as on, MirroredRepeatWrapping as ko, ClampToEdgeWrapping as ls, PointsMaterial as _n, LineBasicMaterial as Ft, MeshStandardMaterial as fi, DoubleSide as Ii, PropertyBinding as Lt, BufferGeometry as ut, SkinnedMesh as Lo, LineSegments as hs, Line as pt, LineLoop as Sa, Points as is, Group as nn, MathUtils as Qe, OrthographicCamera as No, Skeleton as Uo, AnimationClip as Go, Bone as Ys, InterpolateDiscrete as Po, InterpolateLinear as mi, InterleavedBufferAttribute as $t, Texture as Ks, VectorKeyframeTrack as Js, NumberKeyframeTrack as Vs, QuaternionKeyframeTrack as Ws, ColorManagement as Ve, FrontSide as Oo, Interpolant as Ta, Box3 as ds, Sphere as Ei, RGBA_S3TC_DXT1_Format as Xs, RGB_PVRTC_4BPPV1_Format as va, RGB_ETC2_Format as Ho, RGB_ETC1_Format as Da, RGBA_S3TC_DXT5_Format as Zs, RGBA_PVRTC_4BPPV1_Format as Ra, RGBA_ETC2_EAC_Format as jo, RGBA_BPTC_Format as $s, RGB_BPTC_UNSIGNED_Format as _a, RGBA_ASTC_4x4_Format as os, RGBAFormat as zt, FloatType as mt, HalfFloatType as We, UnsignedByteType as dt, CompressedCubeTexture as Ma, CompressedArrayTexture as Fa, CompressedTexture as Gn, NoColorSpace as us, RGBA_S3TC_DXT3_Format as Mi, RGB_S3TC_DXT1_Format as Fi, RGBA_ASTC_6x6_Format as ki, RGBFormat as ei, RedFormat as gn, RGFormat as Mn, UnsignedInt101111Type as qo, UnsignedInt5999Type as zo, DataTexture as ka, Data3DTexture as La, ExtrudeGeometry as Na, ShapePath as Ua, Raycaster as bi, CylinderGeometry as Ye, BoxGeometry as je, Float32BufferAttribute as Fe, OctahedronGeometry as Kn, TorusGeometry as bn, Euler as qt, Controls as Yo, PlaneGeometry as Ci, DataTextureLoader as Ko, DataUtils as dn, Vector4 as Nt, Curve as Ga, MeshPhongMaterial as Pn, MeshLambertMaterial as Pa, EquirectangularReflectionMapping as Oa, AmbientLight as Ha, Uint16BufferAttribute as ja, Matrix3 as Jo, ShapeUtils as qa, DefaultLoadingManager as za, Ray as Ya, Plane as Ka, MOUSE as fn, TOUCH as pn, Spherical as Li, ShaderMaterial as Vo, Uniform$1 as Ja, Scene as ti, WebGLRenderer as Va, CanvasTexture as Wo, REVISION as Wa, Source as Xa, InstancedBufferGeometry as Za, InstancedInterleavedBuffer as ni, WireframeGeometry as $a, Line3 as eA } from "./three-MHVqtJYj.js";
|
|
2
2
|
class ph extends q {
|
|
3
3
|
constructor(e, t, s, n = 128) {
|
|
4
4
|
if (t <= 0 || s <= 0 || n <= 0)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const r=require("./three-
|
|
1
|
+
"use strict";const r=require("./three-iFaDq9U3.umd.cjs");class Qo extends r.Mesh{constructor(e,t,s,n=128){if(t<=0||s<=0||n<=0)throw new Error("GroundedSkybox height, radius, and resolution must be positive.");const i=new r.SphereGeometry(s,2*n,n);i.scale(1,1,-1);const o=i.getAttribute("position"),a=new r.Vector3;for(let A=0;A<o.count;++A)if(a.fromBufferAttribute(o,A),a.y<0){const l=-t*3/2,h=a.y<l?-t/a.y:1-a.y*a.y/(3*l*l);a.multiplyScalar(h),a.toArray(o.array,3*A)}o.needsUpdate=!0,super(i,new r.MeshBasicMaterial({map:e,depthWrite:!1}))}}class be extends r.Node{constructor(e){super(e.nodeType),this.node=null,this.source=null,this.target=null,this.inclusionType="replace",Object.assign(this,e)}generate(e){return this.node.build(e,this.getNodeType(e))}}const Ue=new r.NodeFrame;Ue.camera=new r.PerspectiveCamera;const us={LineBasicNodeMaterial:r.ShaderLib.basic,MeshBasicNodeMaterial:r.ShaderLib.basic,PointsNodeMaterial:r.ShaderLib.points,MeshStandardNodeMaterial:r.ShaderLib.standard,MeshPhysicalNodeMaterial:r.ShaderLib.physical,MeshPhongNodeMaterial:r.ShaderLib.phong},xo={atan2:"atan"},So={low:"lowp",medium:"mediump",high:"highp"};function ut(c){return`#include <${c}>`}function Ft(c){return`${c}Shader`}class To extends r.NodeBuilder{constructor(e,t,s,n=null){super(e,t,new r.GLSLNodeParser,null,n),this.shader=s,this.slots={vertex:[],fragment:[]},this._parseShaderLib(),this._parseInclude("fragment","lights_physical_fragment","clearcoat_normal_fragment_begin","transmission_fragment"),this._parseObject(),this._sortSlotsToFlow(),this.useComparisonMethod=!0}getMethod(e){return xo[e]||e}addSlot(e,t){this.slots[e].push(t)}_parseShaderLib(){const e=this.material;let t=e.type;if(e.isMeshPhysicalNodeMaterial?t="MeshPhysicalNodeMaterial":e.isMeshStandardNodeMaterial?t="MeshStandardNodeMaterial":e.isMeshPhongNodeMaterial?t="MeshPhongNodeMaterial":e.isMeshBasicNodeMaterial?t="MeshBasicNodeMaterial":e.isPointsNodeMaterial?t="PointsNodeMaterial":e.isLineBasicNodeMaterial&&(t="LineBasicNodeMaterial"),us[t]!==void 0){const s=us[t],n=this.shader;n.vertexShader=s.vertexShader,n.fragmentShader=s.fragmentShader,n.uniforms=r.UniformsUtils.merge([s.uniforms,r.UniformsLib.lights])}}_parseObject(){const{material:e,renderer:t}=this;this.addSlot("fragment",new be({node:r.normalView,nodeType:"vec3",source:"void main() {",target:"vec3 TransformedNormalView = %RESULT%;",inclusionType:"append"})),t.toneMappingNode&&t.toneMappingNode.isNode===!0&&this.addSlot("fragment",new be({node:e.colorNode,nodeType:"vec4",source:ut("tonemapping_fragment"),target:""})),e.colorNode&&e.colorNode.isNode&&this.addSlot("fragment",new be({node:e.colorNode,nodeType:"vec4",source:"vec4 diffuseColor = vec4( diffuse, opacity );",target:"vec4 diffuseColor = %RESULT%; diffuseColor.a *= opacity;"})),e.opacityNode&&e.opacityNode.isNode&&this.addSlot("fragment",new be({node:e.opacityNode,nodeType:"float",source:ut("alphatest_fragment"),target:"diffuseColor.a = %RESULT%;",inclusionType:"append"})),e.normalNode&&e.normalNode.isNode&&this.addSlot("fragment",new be({node:e.normalNode,nodeType:"vec3",source:ut("normal_fragment_begin"),target:"normal = %RESULT%;",inclusionType:"append"})),e.emissiveNode&&e.emissiveNode.isNode&&this.addSlot("fragment",new be({node:e.emissiveNode,nodeType:"vec3",source:ut("emissivemap_fragment"),target:"totalEmissiveRadiance = %RESULT%;",inclusionType:"append"})),e.isMeshStandardNodeMaterial&&(e.metalnessNode&&e.metalnessNode.isNode&&this.addSlot("fragment",new be({node:e.metalnessNode,nodeType:"float",source:ut("metalnessmap_fragment"),target:"metalnessFactor = %RESULT%;",inclusionType:"append"})),e.roughnessNode&&e.roughnessNode.isNode&&this.addSlot("fragment",new be({node:e.roughnessNode,nodeType:"float",source:ut("roughnessmap_fragment"),target:"roughnessFactor = %RESULT%;",inclusionType:"append"})),e.isMeshPhysicalNodeMaterial&&(e.clearcoatNode&&e.clearcoatNode.isNode?(this.addSlot("fragment",new be({node:e.clearcoatNode,nodeType:"float",source:"material.clearcoat = clearcoat;",target:"material.clearcoat = %RESULT%;"})),e.clearcoatRoughnessNode&&e.clearcoatRoughnessNode.isNode&&this.addSlot("fragment",new be({node:e.clearcoatRoughnessNode,nodeType:"float",source:"material.clearcoatRoughness = clearcoatRoughness;",target:"material.clearcoatRoughness = %RESULT%;"})),e.clearcoatNormalNode&&e.clearcoatNormalNode.isNode&&this.addSlot("fragment",new be({node:e.clearcoatNormalNode,nodeType:"vec3",source:"vec3 clearcoatNormal = nonPerturbedNormal;",target:"vec3 clearcoatNormal = %RESULT%;"})),e.defines.USE_CLEARCOAT=""):delete e.defines.USE_CLEARCOAT,e.sheenNode&&e.sheenNode.isNode?(this.addSlot("fragment",new be({node:e.sheenNode,nodeType:"vec3",source:"material.sheenColor = sheenColor;",target:"material.sheenColor = %RESULT%;"})),e.sheenRoughnessNode&&e.sheenRoughnessNode.isNode&&this.addSlot("fragment",new be({node:e.sheenRoughnessNode,nodeType:"float",source:"material.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );",target:"material.sheenRoughness = clamp( %RESULT%, 0.07, 1.0 );"})),e.defines.USE_SHEEN=""):delete e.defines.USE_SHEEN,e.iridescenceNode&&e.iridescenceNode.isNode?(this.addSlot("fragment",new be({node:e.iridescenceNode,nodeType:"float",source:"material.iridescence = iridescence;",target:"material.iridescence = %RESULT%;"})),e.iridescenceIORNode&&e.iridescenceIORNode.isNode&&this.addSlot("fragment",new be({node:e.iridescenceIORNode,nodeType:"float",source:"material.iridescenceIOR = iridescenceIOR;",target:"material.iridescenceIOR = %RESULT%;"})),e.iridescenceThicknessNode&&e.iridescenceThicknessNode.isNode&&this.addSlot("fragment",new be({node:e.iridescenceThicknessNode,nodeType:"float",source:"material.iridescenceThickness = iridescenceThicknessMaximum;",target:"material.iridescenceThickness = %RESULT%;"})),e.defines.USE_IRIDESCENCE=""):delete e.defines.USE_IRIDESCENCE,e.iorNode&&e.iorNode.isNode&&this.addSlot("fragment",new be({node:e.iorNode,nodeType:"float",source:"material.ior = ior;",target:"material.ior = %RESULT%;"})),e.specularColorNode&&e.specularColorNode.isNode&&this.addSlot("fragment",new be({node:e.specularColorNode,nodeType:"vec3",source:"vec3 specularColorFactor = specularColor;",target:"vec3 specularColorFactor = %RESULT%;"})),e.specularIntensityNode&&e.specularIntensityNode.isNode&&this.addSlot("fragment",new be({node:e.specularIntensityNode,nodeType:"float",source:"float specularIntensityFactor = specularIntensity;",target:"float specularIntensityFactor = %RESULT%;"})),e.transmissionNode&&e.transmissionNode.isNode?(this.addSlot("fragment",new be({node:e.transmissionNode,nodeType:"float",source:"material.transmission = transmission;",target:"material.transmission = %RESULT%;"})),e.thicknessNode&&e.thicknessNode.isNode&&this.addSlot("fragment",new be({node:e.thicknessNode,nodeType:"float",source:"material.thickness = thickness;",target:"material.thickness = %RESULT%;"})),e.attenuationDistanceNode&&e.attenuationDistanceNode.isNode&&this.addSlot("fragment",new be({node:e.attenuationDistanceNode,nodeType:"float",source:"material.attenuationDistance = attenuationDistance;",target:"material.attenuationDistance = %RESULT%;"})),e.attenuationColorNode&&e.attenuationColorNode.isNode&&this.addSlot("fragment",new be({node:e.attenuationColorNode,nodeType:"vec3",source:"material.attenuationColor = attenuationColor;",target:"material.attenuationColor = %RESULT%;"})),e.transmission=1,e.defines.USE_TRANSMISSION=""):(e.transmission=0,delete e.defines.USE_TRANSMISSION))),e.positionNode&&e.positionNode.isNode&&this.addSlot("vertex",new be({node:e.positionNode,nodeType:"vec3",source:ut("begin_vertex"),target:"transformed = %RESULT%;",inclusionType:"append"})),e.sizeNode&&e.sizeNode.isNode&&this.addSlot("vertex",new be({node:e.sizeNode,nodeType:"float",source:"gl_PointSize = size;",target:"gl_PointSize = %RESULT%;"}))}generateTexture(e,t,s){return e.isTextureCube?`textureCube( ${t}, ${s} )`:`texture2D( ${t}, ${s} )`}generateTextureLevel(e,t,s,n){return`textureLod( ${t}, ${s}, ${n} )`}buildFunctionCode(e){const t=e.layout,s=this.flowShaderNode(e),n=[];for(const o of t.inputs)n.push(this.getType(o.type)+" "+o.name);return`${this.getType(t.type)} ${t.name}( ${n.join(", ")} ) {
|
|
2
2
|
|
|
3
3
|
${s.vars}
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Mesh as O,SphereGeometry as hi,Vector3 as N,MeshBasicMaterial as It,Node as Zo,PerspectiveCamera as Os,NodeFrame as $o,NodeBuilder as er,GLSLNodeParser as tr,ShaderLib as Et,UniformsUtils as gi,UniformsLib as us,normalView as sr,defaultShaderStages as Hs,ShaderChunk as ir,Material as Kt,TrianglesDrawMode as nr,TriangleFanDrawMode as di,TriangleStripDrawMode as xn,Matrix4 as ce,Loader as Tt,LoaderUtils as Jt,FileLoader as dt,MeshPhysicalMaterial as Ct,Vector2 as Le,Color as we,LinearSRGBColorSpace as We,SRGBColorSpace as le,SpotLight as Sn,PointLight as pi,DirectionalLight as Tn,InstancedMesh as ar,Quaternion as ye,InstancedBufferAttribute as or,Object3D as Bt,TextureLoader as ui,ImageBitmapLoader as rr,BufferAttribute as nt,InterleavedBuffer as Ar,LinearMipmapLinearFilter as fs,NearestMipmapLinearFilter as Dn,LinearMipmapNearestFilter as Rn,NearestMipmapNearestFilter as fi,LinearFilter as at,NearestFilter as js,RepeatWrapping as Vt,MirroredRepeatWrapping as Mn,ClampToEdgeWrapping as qs,PointsMaterial as ms,LineBasicMaterial as Dt,MeshStandardMaterial as mi,DoubleSide as bi,PropertyBinding as Rt,BufferGeometry as ct,SkinnedMesh as kn,LineSegments as zs,Line as pt,LineLoop as cr,Points as Ys,Group as Wt,MathUtils as Ce,OrthographicCamera as _n,Skeleton as Fn,AnimationClip as Ln,Bone as Ii,InterpolateDiscrete as Nn,InterpolateLinear as Ei,InterleavedBufferAttribute as Xt,Texture as Ci,VectorKeyframeTrack as Bi,NumberKeyframeTrack as wi,QuaternionKeyframeTrack as yi,ColorManagement as Xe,FrontSide as Un,Interpolant as lr,Box3 as Ks,Sphere as Qi,RGBA_S3TC_DXT1_Format as vi,RGB_PVRTC_4BPPV1_Format as hr,RGB_ETC2_Format as Gn,RGB_ETC1_Format as gr,RGBA_S3TC_DXT5_Format as xi,RGBA_PVRTC_4BPPV1_Format as dr,RGBA_ETC2_EAC_Format as Pn,RGBA_BPTC_Format as Si,RGB_BPTC_UNSIGNED_Format as pr,RGBA_ASTC_4x4_Format as Js,RGBAFormat as Gt,FloatType as ut,HalfFloatType as Ze,UnsignedByteType as ft,CompressedCubeTexture as ur,CompressedArrayTexture as fr,CompressedTexture as bs,NoColorSpace as Vs,RGBA_S3TC_DXT3_Format as On,RGB_S3TC_DXT1_Format as Hn,RGBA_ASTC_6x6_Format as jn,RGBFormat as Ti,RedFormat as as,RGFormat as Is,UnsignedInt101111Type as qn,UnsignedInt5999Type as zn,DataTexture as mr,Data3DTexture as br,ExtrudeGeometry as Ir,ShapePath as Er,Raycaster as Di,CylinderGeometry as $e,BoxGeometry as Ke,Float32BufferAttribute as Me,OctahedronGeometry as Ws,TorusGeometry as Es,Euler as Pt,Controls as Yn,PlaneGeometry as Ri,DataTextureLoader as Kn,DataUtils as os,Vector4 as Mt,Curve as Cr,MeshPhongMaterial as Cs,MeshLambertMaterial as Br,EquirectangularReflectionMapping as wr,AmbientLight as yr,Uint16BufferAttribute as Qr,Matrix3 as Jn,ShapeUtils as vr,DefaultLoadingManager as xr,Ray as Sr,Plane as Tr,MOUSE as rs,TOUCH as As,Spherical as Vn,ShaderMaterial as Wn,Uniform$1 as Dr,Scene as Mi,WebGLRenderer as Rr,CanvasTexture as Xn,REVISION as Mr,Source as kr,InstancedBufferGeometry as _r,InstancedInterleavedBuffer as ki,WireframeGeometry as Fr,Line3 as Lr}from"./three-qw28ZtTy.min.js";class Nr extends O{constructor(e,t,i,s=128){if(t<=0||i<=0||s<=0)throw new Error("GroundedSkybox height, radius, and resolution must be positive.");const n=new hi(i,2*s,s);n.scale(1,1,-1);const a=n.getAttribute("position"),r=new N;for(let A=0;A<a.count;++A)if(r.fromBufferAttribute(a,A),r.y<0){const c=-t*3/2,l=r.y<c?-t/r.y:1-r.y*r.y/(3*c*c);r.multiplyScalar(l),r.toArray(a.array,3*A)}a.needsUpdate=!0,super(n,new It({map:e,depthWrite:!1}))}}class be extends Zo{constructor(e){super(e.nodeType),this.node=null,this.source=null,this.target=null,this.inclusionType="replace",Object.assign(this,e)}generate(e){return this.node.build(e,this.getNodeType(e))}}const et=new $o;et.camera=new Os;const Zn={LineBasicNodeMaterial:Et.basic,MeshBasicNodeMaterial:Et.basic,PointsNodeMaterial:Et.points,MeshStandardNodeMaterial:Et.standard,MeshPhysicalNodeMaterial:Et.physical,MeshPhongNodeMaterial:Et.phong},Ur={atan2:"atan"},Gr={low:"lowp",medium:"mediump",high:"highp"};function Ot(o){return`#include <${o}>`}function Bs(o){return`${o}Shader`}class Pr extends er{constructor(e,t,i,s=null){super(e,t,new tr,null,s),this.shader=i,this.slots={vertex:[],fragment:[]},this._parseShaderLib(),this._parseInclude("fragment","lights_physical_fragment","clearcoat_normal_fragment_begin","transmission_fragment"),this._parseObject(),this._sortSlotsToFlow(),this.useComparisonMethod=!0}getMethod(e){return Ur[e]||e}addSlot(e,t){this.slots[e].push(t)}_parseShaderLib(){const e=this.material;let t=e.type;if(e.isMeshPhysicalNodeMaterial?t="MeshPhysicalNodeMaterial":e.isMeshStandardNodeMaterial?t="MeshStandardNodeMaterial":e.isMeshPhongNodeMaterial?t="MeshPhongNodeMaterial":e.isMeshBasicNodeMaterial?t="MeshBasicNodeMaterial":e.isPointsNodeMaterial?t="PointsNodeMaterial":e.isLineBasicNodeMaterial&&(t="LineBasicNodeMaterial"),Zn[t]!==void 0){const i=Zn[t],s=this.shader;s.vertexShader=i.vertexShader,s.fragmentShader=i.fragmentShader,s.uniforms=gi.merge([i.uniforms,us.lights])}}_parseObject(){const{material:e,renderer:t}=this;this.addSlot("fragment",new be({node:sr,nodeType:"vec3",source:"void main() {",target:"vec3 TransformedNormalView = %RESULT%;",inclusionType:"append"})),t.toneMappingNode&&t.toneMappingNode.isNode===!0&&this.addSlot("fragment",new be({node:e.colorNode,nodeType:"vec4",source:Ot("tonemapping_fragment"),target:""})),e.colorNode&&e.colorNode.isNode&&this.addSlot("fragment",new be({node:e.colorNode,nodeType:"vec4",source:"vec4 diffuseColor = vec4( diffuse, opacity );",target:"vec4 diffuseColor = %RESULT%; diffuseColor.a *= opacity;"})),e.opacityNode&&e.opacityNode.isNode&&this.addSlot("fragment",new be({node:e.opacityNode,nodeType:"float",source:Ot("alphatest_fragment"),target:"diffuseColor.a = %RESULT%;",inclusionType:"append"})),e.normalNode&&e.normalNode.isNode&&this.addSlot("fragment",new be({node:e.normalNode,nodeType:"vec3",source:Ot("normal_fragment_begin"),target:"normal = %RESULT%;",inclusionType:"append"})),e.emissiveNode&&e.emissiveNode.isNode&&this.addSlot("fragment",new be({node:e.emissiveNode,nodeType:"vec3",source:Ot("emissivemap_fragment"),target:"totalEmissiveRadiance = %RESULT%;",inclusionType:"append"})),e.isMeshStandardNodeMaterial&&(e.metalnessNode&&e.metalnessNode.isNode&&this.addSlot("fragment",new be({node:e.metalnessNode,nodeType:"float",source:Ot("metalnessmap_fragment"),target:"metalnessFactor = %RESULT%;",inclusionType:"append"})),e.roughnessNode&&e.roughnessNode.isNode&&this.addSlot("fragment",new be({node:e.roughnessNode,nodeType:"float",source:Ot("roughnessmap_fragment"),target:"roughnessFactor = %RESULT%;",inclusionType:"append"})),e.isMeshPhysicalNodeMaterial&&(e.clearcoatNode&&e.clearcoatNode.isNode?(this.addSlot("fragment",new be({node:e.clearcoatNode,nodeType:"float",source:"material.clearcoat = clearcoat;",target:"material.clearcoat = %RESULT%;"})),e.clearcoatRoughnessNode&&e.clearcoatRoughnessNode.isNode&&this.addSlot("fragment",new be({node:e.clearcoatRoughnessNode,nodeType:"float",source:"material.clearcoatRoughness = clearcoatRoughness;",target:"material.clearcoatRoughness = %RESULT%;"})),e.clearcoatNormalNode&&e.clearcoatNormalNode.isNode&&this.addSlot("fragment",new be({node:e.clearcoatNormalNode,nodeType:"vec3",source:"vec3 clearcoatNormal = nonPerturbedNormal;",target:"vec3 clearcoatNormal = %RESULT%;"})),e.defines.USE_CLEARCOAT=""):delete e.defines.USE_CLEARCOAT,e.sheenNode&&e.sheenNode.isNode?(this.addSlot("fragment",new be({node:e.sheenNode,nodeType:"vec3",source:"material.sheenColor = sheenColor;",target:"material.sheenColor = %RESULT%;"})),e.sheenRoughnessNode&&e.sheenRoughnessNode.isNode&&this.addSlot("fragment",new be({node:e.sheenRoughnessNode,nodeType:"float",source:"material.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );",target:"material.sheenRoughness = clamp( %RESULT%, 0.07, 1.0 );"})),e.defines.USE_SHEEN=""):delete e.defines.USE_SHEEN,e.iridescenceNode&&e.iridescenceNode.isNode?(this.addSlot("fragment",new be({node:e.iridescenceNode,nodeType:"float",source:"material.iridescence = iridescence;",target:"material.iridescence = %RESULT%;"})),e.iridescenceIORNode&&e.iridescenceIORNode.isNode&&this.addSlot("fragment",new be({node:e.iridescenceIORNode,nodeType:"float",source:"material.iridescenceIOR = iridescenceIOR;",target:"material.iridescenceIOR = %RESULT%;"})),e.iridescenceThicknessNode&&e.iridescenceThicknessNode.isNode&&this.addSlot("fragment",new be({node:e.iridescenceThicknessNode,nodeType:"float",source:"material.iridescenceThickness = iridescenceThicknessMaximum;",target:"material.iridescenceThickness = %RESULT%;"})),e.defines.USE_IRIDESCENCE=""):delete e.defines.USE_IRIDESCENCE,e.iorNode&&e.iorNode.isNode&&this.addSlot("fragment",new be({node:e.iorNode,nodeType:"float",source:"material.ior = ior;",target:"material.ior = %RESULT%;"})),e.specularColorNode&&e.specularColorNode.isNode&&this.addSlot("fragment",new be({node:e.specularColorNode,nodeType:"vec3",source:"vec3 specularColorFactor = specularColor;",target:"vec3 specularColorFactor = %RESULT%;"})),e.specularIntensityNode&&e.specularIntensityNode.isNode&&this.addSlot("fragment",new be({node:e.specularIntensityNode,nodeType:"float",source:"float specularIntensityFactor = specularIntensity;",target:"float specularIntensityFactor = %RESULT%;"})),e.transmissionNode&&e.transmissionNode.isNode?(this.addSlot("fragment",new be({node:e.transmissionNode,nodeType:"float",source:"material.transmission = transmission;",target:"material.transmission = %RESULT%;"})),e.thicknessNode&&e.thicknessNode.isNode&&this.addSlot("fragment",new be({node:e.thicknessNode,nodeType:"float",source:"material.thickness = thickness;",target:"material.thickness = %RESULT%;"})),e.attenuationDistanceNode&&e.attenuationDistanceNode.isNode&&this.addSlot("fragment",new be({node:e.attenuationDistanceNode,nodeType:"float",source:"material.attenuationDistance = attenuationDistance;",target:"material.attenuationDistance = %RESULT%;"})),e.attenuationColorNode&&e.attenuationColorNode.isNode&&this.addSlot("fragment",new be({node:e.attenuationColorNode,nodeType:"vec3",source:"material.attenuationColor = attenuationColor;",target:"material.attenuationColor = %RESULT%;"})),e.transmission=1,e.defines.USE_TRANSMISSION=""):(e.transmission=0,delete e.defines.USE_TRANSMISSION))),e.positionNode&&e.positionNode.isNode&&this.addSlot("vertex",new be({node:e.positionNode,nodeType:"vec3",source:Ot("begin_vertex"),target:"transformed = %RESULT%;",inclusionType:"append"})),e.sizeNode&&e.sizeNode.isNode&&this.addSlot("vertex",new be({node:e.sizeNode,nodeType:"float",source:"gl_PointSize = size;",target:"gl_PointSize = %RESULT%;"}))}generateTexture(e,t,i){return e.isTextureCube?`textureCube( ${t}, ${i} )`:`texture2D( ${t}, ${i} )`}generateTextureLevel(e,t,i,s){return`textureLod( ${t}, ${i}, ${s} )`}buildFunctionCode(e){const t=e.layout,i=this.flowShaderNode(e),s=[];for(const n of t.inputs)s.push(this.getType(n.type)+" "+n.name);return`${this.getType(t.type)} ${t.name}( ${s.join(", ")} ) {
|
|
1
|
+
import{Mesh as O,SphereGeometry as hi,Vector3 as N,MeshBasicMaterial as It,Node as Zo,PerspectiveCamera as Os,NodeFrame as $o,NodeBuilder as er,GLSLNodeParser as tr,ShaderLib as Et,UniformsUtils as gi,UniformsLib as us,normalView as sr,defaultShaderStages as Hs,ShaderChunk as ir,Material as Kt,TrianglesDrawMode as nr,TriangleFanDrawMode as di,TriangleStripDrawMode as xn,Matrix4 as ce,Loader as Tt,LoaderUtils as Jt,FileLoader as dt,MeshPhysicalMaterial as Ct,Vector2 as Le,Color as we,LinearSRGBColorSpace as We,SRGBColorSpace as le,SpotLight as Sn,PointLight as pi,DirectionalLight as Tn,InstancedMesh as ar,Quaternion as ye,InstancedBufferAttribute as or,Object3D as Bt,TextureLoader as ui,ImageBitmapLoader as rr,BufferAttribute as nt,InterleavedBuffer as Ar,LinearMipmapLinearFilter as fs,NearestMipmapLinearFilter as Dn,LinearMipmapNearestFilter as Rn,NearestMipmapNearestFilter as fi,LinearFilter as at,NearestFilter as js,RepeatWrapping as Vt,MirroredRepeatWrapping as Mn,ClampToEdgeWrapping as qs,PointsMaterial as ms,LineBasicMaterial as Dt,MeshStandardMaterial as mi,DoubleSide as bi,PropertyBinding as Rt,BufferGeometry as ct,SkinnedMesh as kn,LineSegments as zs,Line as pt,LineLoop as cr,Points as Ys,Group as Wt,MathUtils as Ce,OrthographicCamera as _n,Skeleton as Fn,AnimationClip as Ln,Bone as Ii,InterpolateDiscrete as Nn,InterpolateLinear as Ei,InterleavedBufferAttribute as Xt,Texture as Ci,VectorKeyframeTrack as Bi,NumberKeyframeTrack as wi,QuaternionKeyframeTrack as yi,ColorManagement as Xe,FrontSide as Un,Interpolant as lr,Box3 as Ks,Sphere as Qi,RGBA_S3TC_DXT1_Format as vi,RGB_PVRTC_4BPPV1_Format as hr,RGB_ETC2_Format as Gn,RGB_ETC1_Format as gr,RGBA_S3TC_DXT5_Format as xi,RGBA_PVRTC_4BPPV1_Format as dr,RGBA_ETC2_EAC_Format as Pn,RGBA_BPTC_Format as Si,RGB_BPTC_UNSIGNED_Format as pr,RGBA_ASTC_4x4_Format as Js,RGBAFormat as Gt,FloatType as ut,HalfFloatType as Ze,UnsignedByteType as ft,CompressedCubeTexture as ur,CompressedArrayTexture as fr,CompressedTexture as bs,NoColorSpace as Vs,RGBA_S3TC_DXT3_Format as On,RGB_S3TC_DXT1_Format as Hn,RGBA_ASTC_6x6_Format as jn,RGBFormat as Ti,RedFormat as as,RGFormat as Is,UnsignedInt101111Type as qn,UnsignedInt5999Type as zn,DataTexture as mr,Data3DTexture as br,ExtrudeGeometry as Ir,ShapePath as Er,Raycaster as Di,CylinderGeometry as $e,BoxGeometry as Ke,Float32BufferAttribute as Me,OctahedronGeometry as Ws,TorusGeometry as Es,Euler as Pt,Controls as Yn,PlaneGeometry as Ri,DataTextureLoader as Kn,DataUtils as os,Vector4 as Mt,Curve as Cr,MeshPhongMaterial as Cs,MeshLambertMaterial as Br,EquirectangularReflectionMapping as wr,AmbientLight as yr,Uint16BufferAttribute as Qr,Matrix3 as Jn,ShapeUtils as vr,DefaultLoadingManager as xr,Ray as Sr,Plane as Tr,MOUSE as rs,TOUCH as As,Spherical as Vn,ShaderMaterial as Wn,Uniform$1 as Dr,Scene as Mi,WebGLRenderer as Rr,CanvasTexture as Xn,REVISION as Mr,Source as kr,InstancedBufferGeometry as _r,InstancedInterleavedBuffer as ki,WireframeGeometry as Fr,Line3 as Lr}from"./three-BDW9I486.min.js";class Nr extends O{constructor(e,t,i,s=128){if(t<=0||i<=0||s<=0)throw new Error("GroundedSkybox height, radius, and resolution must be positive.");const n=new hi(i,2*s,s);n.scale(1,1,-1);const a=n.getAttribute("position"),r=new N;for(let A=0;A<a.count;++A)if(r.fromBufferAttribute(a,A),r.y<0){const c=-t*3/2,l=r.y<c?-t/r.y:1-r.y*r.y/(3*c*c);r.multiplyScalar(l),r.toArray(a.array,3*A)}a.needsUpdate=!0,super(n,new It({map:e,depthWrite:!1}))}}class be extends Zo{constructor(e){super(e.nodeType),this.node=null,this.source=null,this.target=null,this.inclusionType="replace",Object.assign(this,e)}generate(e){return this.node.build(e,this.getNodeType(e))}}const et=new $o;et.camera=new Os;const Zn={LineBasicNodeMaterial:Et.basic,MeshBasicNodeMaterial:Et.basic,PointsNodeMaterial:Et.points,MeshStandardNodeMaterial:Et.standard,MeshPhysicalNodeMaterial:Et.physical,MeshPhongNodeMaterial:Et.phong},Ur={atan2:"atan"},Gr={low:"lowp",medium:"mediump",high:"highp"};function Ot(o){return`#include <${o}>`}function Bs(o){return`${o}Shader`}class Pr extends er{constructor(e,t,i,s=null){super(e,t,new tr,null,s),this.shader=i,this.slots={vertex:[],fragment:[]},this._parseShaderLib(),this._parseInclude("fragment","lights_physical_fragment","clearcoat_normal_fragment_begin","transmission_fragment"),this._parseObject(),this._sortSlotsToFlow(),this.useComparisonMethod=!0}getMethod(e){return Ur[e]||e}addSlot(e,t){this.slots[e].push(t)}_parseShaderLib(){const e=this.material;let t=e.type;if(e.isMeshPhysicalNodeMaterial?t="MeshPhysicalNodeMaterial":e.isMeshStandardNodeMaterial?t="MeshStandardNodeMaterial":e.isMeshPhongNodeMaterial?t="MeshPhongNodeMaterial":e.isMeshBasicNodeMaterial?t="MeshBasicNodeMaterial":e.isPointsNodeMaterial?t="PointsNodeMaterial":e.isLineBasicNodeMaterial&&(t="LineBasicNodeMaterial"),Zn[t]!==void 0){const i=Zn[t],s=this.shader;s.vertexShader=i.vertexShader,s.fragmentShader=i.fragmentShader,s.uniforms=gi.merge([i.uniforms,us.lights])}}_parseObject(){const{material:e,renderer:t}=this;this.addSlot("fragment",new be({node:sr,nodeType:"vec3",source:"void main() {",target:"vec3 TransformedNormalView = %RESULT%;",inclusionType:"append"})),t.toneMappingNode&&t.toneMappingNode.isNode===!0&&this.addSlot("fragment",new be({node:e.colorNode,nodeType:"vec4",source:Ot("tonemapping_fragment"),target:""})),e.colorNode&&e.colorNode.isNode&&this.addSlot("fragment",new be({node:e.colorNode,nodeType:"vec4",source:"vec4 diffuseColor = vec4( diffuse, opacity );",target:"vec4 diffuseColor = %RESULT%; diffuseColor.a *= opacity;"})),e.opacityNode&&e.opacityNode.isNode&&this.addSlot("fragment",new be({node:e.opacityNode,nodeType:"float",source:Ot("alphatest_fragment"),target:"diffuseColor.a = %RESULT%;",inclusionType:"append"})),e.normalNode&&e.normalNode.isNode&&this.addSlot("fragment",new be({node:e.normalNode,nodeType:"vec3",source:Ot("normal_fragment_begin"),target:"normal = %RESULT%;",inclusionType:"append"})),e.emissiveNode&&e.emissiveNode.isNode&&this.addSlot("fragment",new be({node:e.emissiveNode,nodeType:"vec3",source:Ot("emissivemap_fragment"),target:"totalEmissiveRadiance = %RESULT%;",inclusionType:"append"})),e.isMeshStandardNodeMaterial&&(e.metalnessNode&&e.metalnessNode.isNode&&this.addSlot("fragment",new be({node:e.metalnessNode,nodeType:"float",source:Ot("metalnessmap_fragment"),target:"metalnessFactor = %RESULT%;",inclusionType:"append"})),e.roughnessNode&&e.roughnessNode.isNode&&this.addSlot("fragment",new be({node:e.roughnessNode,nodeType:"float",source:Ot("roughnessmap_fragment"),target:"roughnessFactor = %RESULT%;",inclusionType:"append"})),e.isMeshPhysicalNodeMaterial&&(e.clearcoatNode&&e.clearcoatNode.isNode?(this.addSlot("fragment",new be({node:e.clearcoatNode,nodeType:"float",source:"material.clearcoat = clearcoat;",target:"material.clearcoat = %RESULT%;"})),e.clearcoatRoughnessNode&&e.clearcoatRoughnessNode.isNode&&this.addSlot("fragment",new be({node:e.clearcoatRoughnessNode,nodeType:"float",source:"material.clearcoatRoughness = clearcoatRoughness;",target:"material.clearcoatRoughness = %RESULT%;"})),e.clearcoatNormalNode&&e.clearcoatNormalNode.isNode&&this.addSlot("fragment",new be({node:e.clearcoatNormalNode,nodeType:"vec3",source:"vec3 clearcoatNormal = nonPerturbedNormal;",target:"vec3 clearcoatNormal = %RESULT%;"})),e.defines.USE_CLEARCOAT=""):delete e.defines.USE_CLEARCOAT,e.sheenNode&&e.sheenNode.isNode?(this.addSlot("fragment",new be({node:e.sheenNode,nodeType:"vec3",source:"material.sheenColor = sheenColor;",target:"material.sheenColor = %RESULT%;"})),e.sheenRoughnessNode&&e.sheenRoughnessNode.isNode&&this.addSlot("fragment",new be({node:e.sheenRoughnessNode,nodeType:"float",source:"material.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );",target:"material.sheenRoughness = clamp( %RESULT%, 0.07, 1.0 );"})),e.defines.USE_SHEEN=""):delete e.defines.USE_SHEEN,e.iridescenceNode&&e.iridescenceNode.isNode?(this.addSlot("fragment",new be({node:e.iridescenceNode,nodeType:"float",source:"material.iridescence = iridescence;",target:"material.iridescence = %RESULT%;"})),e.iridescenceIORNode&&e.iridescenceIORNode.isNode&&this.addSlot("fragment",new be({node:e.iridescenceIORNode,nodeType:"float",source:"material.iridescenceIOR = iridescenceIOR;",target:"material.iridescenceIOR = %RESULT%;"})),e.iridescenceThicknessNode&&e.iridescenceThicknessNode.isNode&&this.addSlot("fragment",new be({node:e.iridescenceThicknessNode,nodeType:"float",source:"material.iridescenceThickness = iridescenceThicknessMaximum;",target:"material.iridescenceThickness = %RESULT%;"})),e.defines.USE_IRIDESCENCE=""):delete e.defines.USE_IRIDESCENCE,e.iorNode&&e.iorNode.isNode&&this.addSlot("fragment",new be({node:e.iorNode,nodeType:"float",source:"material.ior = ior;",target:"material.ior = %RESULT%;"})),e.specularColorNode&&e.specularColorNode.isNode&&this.addSlot("fragment",new be({node:e.specularColorNode,nodeType:"vec3",source:"vec3 specularColorFactor = specularColor;",target:"vec3 specularColorFactor = %RESULT%;"})),e.specularIntensityNode&&e.specularIntensityNode.isNode&&this.addSlot("fragment",new be({node:e.specularIntensityNode,nodeType:"float",source:"float specularIntensityFactor = specularIntensity;",target:"float specularIntensityFactor = %RESULT%;"})),e.transmissionNode&&e.transmissionNode.isNode?(this.addSlot("fragment",new be({node:e.transmissionNode,nodeType:"float",source:"material.transmission = transmission;",target:"material.transmission = %RESULT%;"})),e.thicknessNode&&e.thicknessNode.isNode&&this.addSlot("fragment",new be({node:e.thicknessNode,nodeType:"float",source:"material.thickness = thickness;",target:"material.thickness = %RESULT%;"})),e.attenuationDistanceNode&&e.attenuationDistanceNode.isNode&&this.addSlot("fragment",new be({node:e.attenuationDistanceNode,nodeType:"float",source:"material.attenuationDistance = attenuationDistance;",target:"material.attenuationDistance = %RESULT%;"})),e.attenuationColorNode&&e.attenuationColorNode.isNode&&this.addSlot("fragment",new be({node:e.attenuationColorNode,nodeType:"vec3",source:"material.attenuationColor = attenuationColor;",target:"material.attenuationColor = %RESULT%;"})),e.transmission=1,e.defines.USE_TRANSMISSION=""):(e.transmission=0,delete e.defines.USE_TRANSMISSION))),e.positionNode&&e.positionNode.isNode&&this.addSlot("vertex",new be({node:e.positionNode,nodeType:"vec3",source:Ot("begin_vertex"),target:"transformed = %RESULT%;",inclusionType:"append"})),e.sizeNode&&e.sizeNode.isNode&&this.addSlot("vertex",new be({node:e.sizeNode,nodeType:"float",source:"gl_PointSize = size;",target:"gl_PointSize = %RESULT%;"}))}generateTexture(e,t,i){return e.isTextureCube?`textureCube( ${t}, ${i} )`:`texture2D( ${t}, ${i} )`}generateTextureLevel(e,t,i,s){return`textureLod( ${t}, ${i}, ${s} )`}buildFunctionCode(e){const t=e.layout,i=this.flowShaderNode(e),s=[];for(const n of t.inputs)s.push(this.getType(n.type)+" "+n.name);return`${this.getType(t.type)} ${t.name}( ${s.join(", ")} ) {
|
|
2
2
|
|
|
3
3
|
${i.vars}
|
|
4
4
|
|