Comparing version
@@ -76,2 +76,3 @@ /** | ||
const batch = TSL.batch; | ||
const bentNormalView = TSL.bentNormalView; | ||
const billboarding = TSL.billboarding; | ||
@@ -336,3 +337,2 @@ const bitAnd = TSL.bitAnd; | ||
const mx_worley_noise_vec3 = TSL.mx_worley_noise_vec3; | ||
const namespace = TSL.namespace; | ||
const negate = TSL.negate; | ||
@@ -350,3 +350,5 @@ const neutralToneMapping = TSL.neutralToneMapping; | ||
const normalView = TSL.normalView; | ||
const normalViewGeometry = TSL.normalViewGeometry; | ||
const normalWorld = TSL.normalWorld; | ||
const normalWorldGeometry = TSL.normalWorldGeometry; | ||
const normalize = TSL.normalize; | ||
@@ -397,3 +399,3 @@ const not = TSL.not; | ||
const pow4 = TSL.pow4; | ||
const premult = TSL.premult; | ||
const premultiplyAlpha = TSL.premultiplyAlpha; | ||
const property = TSL.property; | ||
@@ -430,2 +432,3 @@ const radians = TSL.radians; | ||
const sRGBTransferOETF = TSL.sRGBTransferOETF; | ||
const sample = TSL.sample; | ||
const sampler = TSL.sampler; | ||
@@ -475,2 +478,3 @@ const samplerComparison = TSL.samplerComparison; | ||
const sub = TSL.sub; | ||
const subBuild = TSL.subBuild; | ||
const subgroupIndex = TSL.subgroupIndex; | ||
@@ -488,2 +492,3 @@ const subgroupSize = TSL.subgroupSize; | ||
const textureBicubic = TSL.textureBicubic; | ||
const textureBicubicLevel = TSL.textureBicubicLevel; | ||
const textureCubeUV = TSL.textureCubeUV; | ||
@@ -504,10 +509,5 @@ const textureLoad = TSL.textureLoad; | ||
const transformNormalToView = TSL.transformNormalToView; | ||
const transformedBentNormalView = TSL.transformedBentNormalView; | ||
const transformedBitangentView = TSL.transformedBitangentView; | ||
const transformedBitangentWorld = TSL.transformedBitangentWorld; | ||
const transformedClearcoatNormalView = TSL.transformedClearcoatNormalView; | ||
const transformedNormalView = TSL.transformedNormalView; | ||
const transformedNormalWorld = TSL.transformedNormalWorld; | ||
const transformedTangentView = TSL.transformedTangentView; | ||
const transformedTangentWorld = TSL.transformedTangentWorld; | ||
const transmission = TSL.transmission; | ||
@@ -527,3 +527,3 @@ const transpose = TSL.transpose; | ||
const uniforms = TSL.uniforms; | ||
const unpremult = TSL.unpremult; | ||
const unpremultiplyAlpha = TSL.unpremultiplyAlpha; | ||
const userData = TSL.userData; | ||
@@ -569,2 +569,2 @@ const uv = TSL.uv; | ||
export { BRDF_GGX, BRDF_Lambert, BasicShadowFilter, Break, Const, Continue, DFGApprox, D_GGX, Discard, EPSILON, F_Schlick, Fn, INFINITY, If, Loop, NodeAccess, NodeShaderStage, NodeType, NodeUpdateType, PCFShadowFilter, PCFSoftShadowFilter, PI, PI2, Return, Schlick_to_F0, ScriptableNodeResources, ShaderNode, Switch, TBNViewMatrix, VSMShadowFilter, V_GGX_SmithCorrelated, Var, abs, acesFilmicToneMapping, acos, add, addNodeElement, agxToneMapping, all, alphaT, and, anisotropy, anisotropyB, anisotropyT, any, append, array, arrayBuffer, asin, assign, atan, atan2, atomicAdd, atomicAnd, atomicFunc, atomicLoad, atomicMax, atomicMin, atomicOr, atomicStore, atomicSub, atomicXor, attenuationColor, attenuationDistance, attribute, attributeArray, backgroundBlurriness, backgroundIntensity, backgroundRotation, batch, billboarding, bitAnd, bitNot, bitOr, bitXor, bitangentGeometry, bitangentLocal, bitangentView, bitangentWorld, bitcast, blendBurn, blendColor, blendDodge, blendOverlay, blendScreen, blur, bool, buffer, bufferAttribute, bumpMap, burn, bvec2, bvec3, bvec4, bypass, cache, call, cameraFar, cameraIndex, cameraNear, cameraNormalMatrix, cameraPosition, cameraProjectionMatrix, cameraProjectionMatrixInverse, cameraViewMatrix, cameraWorldMatrix, cbrt, cdl, ceil, checker, cineonToneMapping, clamp, clearcoat, clearcoatRoughness, code, color, colorSpaceToWorking, colorToDirection, compute, computeSkinning, cond, context, convert, convertColorSpace, convertToTexture, cos, cross, cubeTexture, dFdx, dFdy, dashSize, debug, decrement, decrementBefore, defaultBuildStages, defaultShaderStages, defined, degrees, deltaTime, densityFog, densityFogFactor, depth, depthPass, difference, diffuseColor, directPointLight, directionToColor, dispersion, distance, div, dodge, dot, drawIndex, dynamicBufferAttribute, element, emissive, equal, equals, equirectUV, exp, exp2, expression, faceDirection, faceForward, faceforward, float, floor, fog, fract, frameGroup, frameId, frontFacing, fwidth, gain, gapSize, getConstNodeType, getCurrentStack, getDirection, getDistanceAttenuation, getGeometryRoughness, getNormalFromDepth, getParallaxCorrectNormal, getRoughness, getScreenPosition, getShIrradianceAt, getShadowMaterial, getShadowRenderObjectFunction, getTextureIndex, getViewPosition, globalId, glsl, glslFn, grayscale, greaterThan, greaterThanEqual, hash, highpModelNormalViewMatrix, highpModelViewMatrix, hue, increment, incrementBefore, instance, instanceIndex, instancedArray, instancedBufferAttribute, instancedDynamicBufferAttribute, instancedMesh, int, inverseSqrt, inversesqrt, invocationLocalIndex, invocationSubgroupIndex, ior, iridescence, iridescenceIOR, iridescenceThickness, ivec2, ivec3, ivec4, js, label, length, lengthSq, lessThan, lessThanEqual, lightPosition, lightProjectionUV, lightShadowMatrix, lightTargetDirection, lightTargetPosition, lightViewPosition, lightingContext, lights, linearDepth, linearToneMapping, localId, log, log2, logarithmicDepthToViewZ, loop, luminance, mat2, mat3, mat4, matcapUV, materialAO, materialAlphaTest, materialAnisotropy, materialAnisotropyVector, materialAttenuationColor, materialAttenuationDistance, materialClearcoat, materialClearcoatNormal, materialClearcoatRoughness, materialColor, materialDispersion, materialEmissive, materialIOR, materialIridescence, materialIridescenceIOR, materialIridescenceThickness, materialLightMap, materialLineDashOffset, materialLineDashSize, materialLineGapSize, materialLineScale, materialLineWidth, materialMetalness, materialNormal, materialOpacity, materialPointSize, materialReference, materialReflectivity, materialRefractionRatio, materialRotation, materialRoughness, materialSheen, materialSheenRoughness, materialShininess, materialSpecular, materialSpecularColor, materialSpecularIntensity, materialSpecularStrength, materialThickness, materialTransmission, max, maxMipLevel, mediumpModelViewMatrix, metalness, min, mix, mixElement, mod, modInt, modelDirection, modelNormalMatrix, modelPosition, modelRadius, modelScale, modelViewMatrix, modelViewPosition, modelViewProjection, modelWorldMatrix, modelWorldMatrixInverse, morphReference, mrt, mul, mx_aastep, mx_cell_noise_float, mx_contrast, mx_fractal_noise_float, mx_fractal_noise_vec2, mx_fractal_noise_vec3, mx_fractal_noise_vec4, mx_hsvtorgb, mx_noise_float, mx_noise_vec3, mx_noise_vec4, mx_ramplr, mx_ramptb, mx_rgbtohsv, mx_safepower, mx_splitlr, mx_splittb, mx_srgb_texture_to_lin_rec709, mx_transform_uv, mx_worley_noise_float, mx_worley_noise_vec2, mx_worley_noise_vec3, namespace, negate, neutralToneMapping, nodeArray, nodeImmutable, nodeObject, nodeObjects, nodeProxy, normalFlat, normalGeometry, normalLocal, normalMap, normalView, normalWorld, normalize, not, notEqual, numWorkgroups, objectDirection, objectGroup, objectPosition, objectRadius, objectScale, objectViewPosition, objectWorldMatrix, oneMinus, or, orthographicDepthToViewZ, oscSawtooth, oscSine, oscSquare, oscTriangle, output, outputStruct, overlay, overloadingFn, parabola, parallaxDirection, parallaxUV, parameter, pass, passTexture, pcurve, perspectiveDepthToViewZ, pmremTexture, pointShadow, pointUV, pointWidth, positionGeometry, positionLocal, positionPrevious, positionView, positionViewDirection, positionWorld, positionWorldDirection, posterize, pow, pow2, pow3, pow4, premult, property, radians, rand, range, rangeFog, rangeFogFactor, reciprocal, reference, referenceBuffer, reflect, reflectVector, reflectView, reflector, refract, refractVector, refractView, reinhardToneMapping, remainder, remap, remapClamp, renderGroup, renderOutput, rendererReference, rotate, rotateUV, roughness, round, rtt, sRGBTransferEOTF, sRGBTransferOETF, sampler, samplerComparison, saturate, saturation, screen, screenCoordinate, screenSize, screenUV, scriptable, scriptableValue, select, setCurrentStack, shaderStages, shadow, shadowPositionWorld, shapeCircle, sharedUniformGroup, sheen, sheenRoughness, shiftLeft, shiftRight, shininess, sign, sin, sinc, skinning, smoothstep, smoothstepElement, specularColor, specularF90, spherizeUV, split, spritesheetUV, sqrt, stack, step, storage, storageBarrier, storageObject, storageTexture, string, struct, sub, subgroupIndex, subgroupSize, tan, tangentGeometry, tangentLocal, tangentView, tangentWorld, temp, texture, texture3D, textureBarrier, textureBicubic, textureCubeUV, textureLoad, textureSize, textureStore, thickness, time, timerDelta, timerGlobal, timerLocal, toneMapping, toneMappingExposure, toonOutlinePass, transformDirection, transformNormal, transformNormalToView, transformedBentNormalView, transformedBitangentView, transformedBitangentWorld, transformedClearcoatNormalView, transformedNormalView, transformedNormalWorld, transformedTangentView, transformedTangentWorld, transmission, transpose, triNoise3D, triplanarTexture, triplanarTextures, trunc, tslFn, uint, uniform, uniformArray, uniformCubeTexture, uniformGroup, uniformTexture, uniforms, unpremult, userData, uv, uvec2, uvec3, uvec4, varying, varyingProperty, vec2, vec3, vec4, vectorComponents, velocity, vertexColor, vertexIndex, vibrance, viewZToLogarithmicDepth, viewZToOrthographicDepth, viewZToPerspectiveDepth, viewport, viewportBottomLeft, viewportCoordinate, viewportDepthTexture, viewportLinearDepth, viewportMipTexture, viewportResolution, viewportSafeUV, viewportSharedTexture, viewportSize, viewportTexture, viewportTopLeft, viewportUV, wgsl, wgslFn, workgroupArray, workgroupBarrier, workgroupId, workingToColorSpace, xor }; | ||
export { BRDF_GGX, BRDF_Lambert, BasicShadowFilter, Break, Const, Continue, DFGApprox, D_GGX, Discard, EPSILON, F_Schlick, Fn, INFINITY, If, Loop, NodeAccess, NodeShaderStage, NodeType, NodeUpdateType, PCFShadowFilter, PCFSoftShadowFilter, PI, PI2, Return, Schlick_to_F0, ScriptableNodeResources, ShaderNode, Switch, TBNViewMatrix, VSMShadowFilter, V_GGX_SmithCorrelated, Var, abs, acesFilmicToneMapping, acos, add, addNodeElement, agxToneMapping, all, alphaT, and, anisotropy, anisotropyB, anisotropyT, any, append, array, arrayBuffer, asin, assign, atan, atan2, atomicAdd, atomicAnd, atomicFunc, atomicLoad, atomicMax, atomicMin, atomicOr, atomicStore, atomicSub, atomicXor, attenuationColor, attenuationDistance, attribute, attributeArray, backgroundBlurriness, backgroundIntensity, backgroundRotation, batch, bentNormalView, billboarding, bitAnd, bitNot, bitOr, bitXor, bitangentGeometry, bitangentLocal, bitangentView, bitangentWorld, bitcast, blendBurn, blendColor, blendDodge, blendOverlay, blendScreen, blur, bool, buffer, bufferAttribute, bumpMap, burn, bvec2, bvec3, bvec4, bypass, cache, call, cameraFar, cameraIndex, cameraNear, cameraNormalMatrix, cameraPosition, cameraProjectionMatrix, cameraProjectionMatrixInverse, cameraViewMatrix, cameraWorldMatrix, cbrt, cdl, ceil, checker, cineonToneMapping, clamp, clearcoat, clearcoatRoughness, code, color, colorSpaceToWorking, colorToDirection, compute, computeSkinning, cond, context, convert, convertColorSpace, convertToTexture, cos, cross, cubeTexture, dFdx, dFdy, dashSize, debug, decrement, decrementBefore, defaultBuildStages, defaultShaderStages, defined, degrees, deltaTime, densityFog, densityFogFactor, depth, depthPass, difference, diffuseColor, directPointLight, directionToColor, dispersion, distance, div, dodge, dot, drawIndex, dynamicBufferAttribute, element, emissive, equal, equals, equirectUV, exp, exp2, expression, faceDirection, faceForward, faceforward, float, floor, fog, fract, frameGroup, frameId, frontFacing, fwidth, gain, gapSize, getConstNodeType, getCurrentStack, getDirection, getDistanceAttenuation, getGeometryRoughness, getNormalFromDepth, getParallaxCorrectNormal, getRoughness, getScreenPosition, getShIrradianceAt, getShadowMaterial, getShadowRenderObjectFunction, getTextureIndex, getViewPosition, globalId, glsl, glslFn, grayscale, greaterThan, greaterThanEqual, hash, highpModelNormalViewMatrix, highpModelViewMatrix, hue, increment, incrementBefore, instance, instanceIndex, instancedArray, instancedBufferAttribute, instancedDynamicBufferAttribute, instancedMesh, int, inverseSqrt, inversesqrt, invocationLocalIndex, invocationSubgroupIndex, ior, iridescence, iridescenceIOR, iridescenceThickness, ivec2, ivec3, ivec4, js, label, length, lengthSq, lessThan, lessThanEqual, lightPosition, lightProjectionUV, lightShadowMatrix, lightTargetDirection, lightTargetPosition, lightViewPosition, lightingContext, lights, linearDepth, linearToneMapping, localId, log, log2, logarithmicDepthToViewZ, loop, luminance, mat2, mat3, mat4, matcapUV, materialAO, materialAlphaTest, materialAnisotropy, materialAnisotropyVector, materialAttenuationColor, materialAttenuationDistance, materialClearcoat, materialClearcoatNormal, materialClearcoatRoughness, materialColor, materialDispersion, materialEmissive, materialIOR, materialIridescence, materialIridescenceIOR, materialIridescenceThickness, materialLightMap, materialLineDashOffset, materialLineDashSize, materialLineGapSize, materialLineScale, materialLineWidth, materialMetalness, materialNormal, materialOpacity, materialPointSize, materialReference, materialReflectivity, materialRefractionRatio, materialRotation, materialRoughness, materialSheen, materialSheenRoughness, materialShininess, materialSpecular, materialSpecularColor, materialSpecularIntensity, materialSpecularStrength, materialThickness, materialTransmission, max, maxMipLevel, mediumpModelViewMatrix, metalness, min, mix, mixElement, mod, modInt, modelDirection, modelNormalMatrix, modelPosition, modelRadius, modelScale, modelViewMatrix, modelViewPosition, modelViewProjection, modelWorldMatrix, modelWorldMatrixInverse, morphReference, mrt, mul, mx_aastep, mx_cell_noise_float, mx_contrast, mx_fractal_noise_float, mx_fractal_noise_vec2, mx_fractal_noise_vec3, mx_fractal_noise_vec4, mx_hsvtorgb, mx_noise_float, mx_noise_vec3, mx_noise_vec4, mx_ramplr, mx_ramptb, mx_rgbtohsv, mx_safepower, mx_splitlr, mx_splittb, mx_srgb_texture_to_lin_rec709, mx_transform_uv, mx_worley_noise_float, mx_worley_noise_vec2, mx_worley_noise_vec3, negate, neutralToneMapping, nodeArray, nodeImmutable, nodeObject, nodeObjects, nodeProxy, normalFlat, normalGeometry, normalLocal, normalMap, normalView, normalViewGeometry, normalWorld, normalWorldGeometry, normalize, not, notEqual, numWorkgroups, objectDirection, objectGroup, objectPosition, objectRadius, objectScale, objectViewPosition, objectWorldMatrix, oneMinus, or, orthographicDepthToViewZ, oscSawtooth, oscSine, oscSquare, oscTriangle, output, outputStruct, overlay, overloadingFn, parabola, parallaxDirection, parallaxUV, parameter, pass, passTexture, pcurve, perspectiveDepthToViewZ, pmremTexture, pointShadow, pointUV, pointWidth, positionGeometry, positionLocal, positionPrevious, positionView, positionViewDirection, positionWorld, positionWorldDirection, posterize, pow, pow2, pow3, pow4, premultiplyAlpha, property, radians, rand, range, rangeFog, rangeFogFactor, reciprocal, reference, referenceBuffer, reflect, reflectVector, reflectView, reflector, refract, refractVector, refractView, reinhardToneMapping, remainder, remap, remapClamp, renderGroup, renderOutput, rendererReference, rotate, rotateUV, roughness, round, rtt, sRGBTransferEOTF, sRGBTransferOETF, sample, sampler, samplerComparison, saturate, saturation, screen, screenCoordinate, screenSize, screenUV, scriptable, scriptableValue, select, setCurrentStack, shaderStages, shadow, shadowPositionWorld, shapeCircle, sharedUniformGroup, sheen, sheenRoughness, shiftLeft, shiftRight, shininess, sign, sin, sinc, skinning, smoothstep, smoothstepElement, specularColor, specularF90, spherizeUV, split, spritesheetUV, sqrt, stack, step, storage, storageBarrier, storageObject, storageTexture, string, struct, sub, subBuild, subgroupIndex, subgroupSize, tan, tangentGeometry, tangentLocal, tangentView, tangentWorld, temp, texture, texture3D, textureBarrier, textureBicubic, textureBicubicLevel, textureCubeUV, textureLoad, textureSize, textureStore, thickness, time, timerDelta, timerGlobal, timerLocal, toneMapping, toneMappingExposure, toonOutlinePass, transformDirection, transformNormal, transformNormalToView, transformedClearcoatNormalView, transformedNormalView, transformedNormalWorld, transmission, transpose, triNoise3D, triplanarTexture, triplanarTextures, trunc, tslFn, uint, uniform, uniformArray, uniformCubeTexture, uniformGroup, uniformTexture, uniforms, unpremultiplyAlpha, userData, uv, uvec2, uvec3, uvec4, varying, varyingProperty, vec2, vec3, vec4, vectorComponents, velocity, vertexColor, vertexIndex, vibrance, viewZToLogarithmicDepth, viewZToOrthographicDepth, viewZToPerspectiveDepth, viewport, viewportBottomLeft, viewportCoordinate, viewportDepthTexture, viewportLinearDepth, viewportMipTexture, viewportResolution, viewportSafeUV, viewportSharedTexture, viewportSize, viewportTexture, viewportTopLeft, viewportUV, wgsl, wgslFn, workgroupArray, workgroupBarrier, workgroupId, workingToColorSpace, xor }; |
@@ -6,2 +6,2 @@ /** | ||
*/ | ||
import{TSL as e}from"three/webgpu";const t=e.BRDF_GGX,r=e.BRDF_Lambert,a=e.BasicShadowFilter,o=e.Break,i=e.Continue,n=e.DFGApprox,s=e.D_GGX,l=e.Discard,c=e.EPSILON,m=e.F_Schlick,p=e.Fn,d=e.INFINITY,u=e.If,g=e.Switch,h=e.Loop,f=e.NodeShaderStage,x=e.NodeType,b=e.NodeUpdateType,w=e.NodeAccess,v=e.PCFShadowFilter,S=e.PCFSoftShadowFilter,T=e.PI,_=e.PI2,V=e.Return,y=e.Schlick_to_F0,M=e.ScriptableNodeResources,D=e.ShaderNode,F=e.TBNViewMatrix,C=e.VSMShadowFilter,I=e.V_GGX_SmithCorrelated,P=e.abs,R=e.acesFilmicToneMapping,N=e.acos,B=e.add,L=e.addNodeElement,k=e.agxToneMapping,A=e.all,G=e.alphaT,O=e.and,W=e.anisotropy,j=e.anisotropyB,U=e.anisotropyT,z=e.any,q=e.append,E=e.array,Z=e.arrayBuffer,X=e.asin,Y=e.assign,H=e.atan,J=e.atan2,K=e.atomicAdd,Q=e.atomicAnd,$=e.atomicFunc,ee=e.atomicMax,te=e.atomicMin,re=e.atomicOr,ae=e.atomicStore,oe=e.atomicSub,ie=e.atomicXor,ne=e.atomicLoad,se=e.attenuationColor,le=e.attenuationDistance,ce=e.attribute,me=e.attributeArray,pe=e.backgroundBlurriness,de=e.backgroundIntensity,ue=e.backgroundRotation,ge=e.batch,he=e.billboarding,fe=e.bitAnd,xe=e.bitNot,be=e.bitOr,we=e.bitXor,ve=e.bitangentGeometry,Se=e.bitangentLocal,Te=e.bitangentView,_e=e.bitangentWorld,Ve=e.bitcast,ye=e.blendBurn,Me=e.blendColor,De=e.blendDodge,Fe=e.blendOverlay,Ce=e.blendScreen,Ie=e.blur,Pe=e.bool,Re=e.buffer,Ne=e.bufferAttribute,Be=e.bumpMap,Le=e.burn,ke=e.bvec2,Ae=e.bvec3,Ge=e.bvec4,Oe=e.bypass,We=e.cache,je=e.call,Ue=e.cameraFar,ze=e.cameraIndex,qe=e.cameraNear,Ee=e.cameraNormalMatrix,Ze=e.cameraPosition,Xe=e.cameraProjectionMatrix,Ye=e.cameraProjectionMatrixInverse,He=e.cameraViewMatrix,Je=e.cameraWorldMatrix,Ke=e.cbrt,Qe=e.cdl,$e=e.ceil,et=e.checker,tt=e.cineonToneMapping,rt=e.clamp,at=e.clearcoat,ot=e.clearcoatRoughness,it=e.code,nt=e.color,st=e.colorSpaceToWorking,lt=e.colorToDirection,ct=e.compute,mt=e.computeSkinning,pt=e.cond,dt=e.Const,ut=e.context,gt=e.convert,ht=e.convertColorSpace,ft=e.convertToTexture,xt=e.cos,bt=e.cross,wt=e.cubeTexture,vt=e.dFdx,St=e.dFdy,Tt=e.dashSize,_t=e.debug,Vt=e.decrement,yt=e.decrementBefore,Mt=e.defaultBuildStages,Dt=e.defaultShaderStages,Ft=e.defined,Ct=e.degrees,It=e.deltaTime,Pt=e.densityFog,Rt=e.densityFogFactor,Nt=e.depth,Bt=e.depthPass,Lt=e.difference,kt=e.diffuseColor,At=e.directPointLight,Gt=e.directionToColor,Ot=e.dispersion,Wt=e.distance,jt=e.div,Ut=e.dodge,zt=e.dot,qt=e.drawIndex,Et=e.dynamicBufferAttribute,Zt=e.element,Xt=e.emissive,Yt=e.equal,Ht=e.equals,Jt=e.equirectUV,Kt=e.exp,Qt=e.exp2,$t=e.expression,er=e.faceDirection,tr=e.faceForward,rr=e.faceforward,ar=e.float,or=e.floor,ir=e.fog,nr=e.fract,sr=e.frameGroup,lr=e.frameId,cr=e.frontFacing,mr=e.fwidth,pr=e.gain,dr=e.gapSize,ur=e.getConstNodeType,gr=e.getCurrentStack,hr=e.getDirection,fr=e.getDistanceAttenuation,xr=e.getGeometryRoughness,br=e.getNormalFromDepth,wr=e.getParallaxCorrectNormal,vr=e.getRoughness,Sr=e.getScreenPosition,Tr=e.getShIrradianceAt,_r=e.getTextureIndex,Vr=e.getViewPosition,yr=e.getShadowMaterial,Mr=e.getShadowRenderObjectFunction,Dr=e.glsl,Fr=e.glslFn,Cr=e.grayscale,Ir=e.greaterThan,Pr=e.greaterThanEqual,Rr=e.hash,Nr=e.highpModelNormalViewMatrix,Br=e.highpModelViewMatrix,Lr=e.hue,kr=e.increment,Ar=e.incrementBefore,Gr=e.instance,Or=e.instanceIndex,Wr=e.instancedArray,jr=e.instancedBufferAttribute,Ur=e.instancedDynamicBufferAttribute,zr=e.instancedMesh,qr=e.int,Er=e.inverseSqrt,Zr=e.inversesqrt,Xr=e.invocationLocalIndex,Yr=e.invocationSubgroupIndex,Hr=e.ior,Jr=e.iridescence,Kr=e.iridescenceIOR,Qr=e.iridescenceThickness,$r=e.ivec2,ea=e.ivec3,ta=e.ivec4,ra=e.js,aa=e.label,oa=e.length,ia=e.lengthSq,na=e.lessThan,sa=e.lessThanEqual,la=e.lightPosition,ca=e.lightShadowMatrix,ma=e.lightTargetDirection,pa=e.lightTargetPosition,da=e.lightViewPosition,ua=e.lightingContext,ga=e.lights,ha=e.linearDepth,fa=e.linearToneMapping,xa=e.localId,ba=e.globalId,wa=e.log,va=e.log2,Sa=e.logarithmicDepthToViewZ,Ta=e.loop,_a=e.luminance,Va=e.mediumpModelViewMatrix,ya=e.mat2,Ma=e.mat3,Da=e.mat4,Fa=e.matcapUV,Ca=e.materialAO,Ia=e.materialAlphaTest,Pa=e.materialAnisotropy,Ra=e.materialAnisotropyVector,Na=e.materialAttenuationColor,Ba=e.materialAttenuationDistance,La=e.materialClearcoat,ka=e.materialClearcoatNormal,Aa=e.materialClearcoatRoughness,Ga=e.materialColor,Oa=e.materialDispersion,Wa=e.materialEmissive,ja=e.materialIOR,Ua=e.materialIridescence,za=e.materialIridescenceIOR,qa=e.materialIridescenceThickness,Ea=e.materialLightMap,Za=e.materialLineDashOffset,Xa=e.materialLineDashSize,Ya=e.materialLineGapSize,Ha=e.materialLineScale,Ja=e.materialLineWidth,Ka=e.materialMetalness,Qa=e.materialNormal,$a=e.materialOpacity,eo=e.materialPointSize,to=e.materialReference,ro=e.materialReflectivity,ao=e.materialRefractionRatio,oo=e.materialRotation,io=e.materialRoughness,no=e.materialSheen,so=e.materialSheenRoughness,lo=e.materialShininess,co=e.materialSpecular,mo=e.materialSpecularColor,po=e.materialSpecularIntensity,uo=e.materialSpecularStrength,go=e.materialThickness,ho=e.materialTransmission,fo=e.max,xo=e.maxMipLevel,bo=e.metalness,wo=e.min,vo=e.mix,So=e.mixElement,To=e.mod,_o=e.modInt,Vo=e.modelDirection,yo=e.modelNormalMatrix,Mo=e.modelPosition,Do=e.modelRadius,Fo=e.modelScale,Co=e.modelViewMatrix,Io=e.modelViewPosition,Po=e.modelViewProjection,Ro=e.modelWorldMatrix,No=e.modelWorldMatrixInverse,Bo=e.morphReference,Lo=e.mrt,ko=e.mul,Ao=e.mx_aastep,Go=e.mx_cell_noise_float,Oo=e.mx_contrast,Wo=e.mx_fractal_noise_float,jo=e.mx_fractal_noise_vec2,Uo=e.mx_fractal_noise_vec3,zo=e.mx_fractal_noise_vec4,qo=e.mx_hsvtorgb,Eo=e.mx_noise_float,Zo=e.mx_noise_vec3,Xo=e.mx_noise_vec4,Yo=e.mx_ramplr,Ho=e.mx_ramptb,Jo=e.mx_rgbtohsv,Ko=e.mx_safepower,Qo=e.mx_splitlr,$o=e.mx_splittb,ei=e.mx_srgb_texture_to_lin_rec709,ti=e.mx_transform_uv,ri=e.mx_worley_noise_float,ai=e.mx_worley_noise_vec2,oi=e.mx_worley_noise_vec3,ii=e.namespace,ni=e.negate,si=e.neutralToneMapping,li=e.nodeArray,ci=e.nodeImmutable,mi=e.nodeObject,pi=e.nodeObjects,di=e.nodeProxy,ui=e.normalFlat,gi=e.normalGeometry,hi=e.normalLocal,fi=e.normalMap,xi=e.normalView,bi=e.normalWorld,wi=e.normalize,vi=e.not,Si=e.notEqual,Ti=e.numWorkgroups,_i=e.objectDirection,Vi=e.objectGroup,yi=e.objectPosition,Mi=e.objectRadius,Di=e.objectScale,Fi=e.objectViewPosition,Ci=e.objectWorldMatrix,Ii=e.oneMinus,Pi=e.or,Ri=e.orthographicDepthToViewZ,Ni=e.oscSawtooth,Bi=e.oscSine,Li=e.oscSquare,ki=e.oscTriangle,Ai=e.output,Gi=e.outputStruct,Oi=e.overlay,Wi=e.overloadingFn,ji=e.parabola,Ui=e.parallaxDirection,zi=e.parallaxUV,qi=e.parameter,Ei=e.pass,Zi=e.passTexture,Xi=e.pcurve,Yi=e.perspectiveDepthToViewZ,Hi=e.pmremTexture,Ji=e.pointUV,Ki=e.pointWidth,Qi=e.positionGeometry,$i=e.positionLocal,en=e.positionPrevious,tn=e.positionView,rn=e.positionViewDirection,an=e.positionWorld,on=e.positionWorldDirection,nn=e.posterize,sn=e.pow,ln=e.pow2,cn=e.pow3,mn=e.pow4,pn=e.premult,dn=e.property,un=e.radians,gn=e.rand,hn=e.range,fn=e.rangeFog,xn=e.rangeFogFactor,bn=e.reciprocal,wn=e.lightProjectionUV,vn=e.reference,Sn=e.referenceBuffer,Tn=e.reflect,_n=e.reflectVector,Vn=e.reflectView,yn=e.reflector,Mn=e.refract,Dn=e.refractVector,Fn=e.refractView,Cn=e.reinhardToneMapping,In=e.remainder,Pn=e.remap,Rn=e.remapClamp,Nn=e.renderGroup,Bn=e.renderOutput,Ln=e.rendererReference,kn=e.rotate,An=e.rotateUV,Gn=e.roughness,On=e.round,Wn=e.rtt,jn=e.sRGBTransferEOTF,Un=e.sRGBTransferOETF,zn=e.sampler,qn=e.samplerComparison,En=e.saturate,Zn=e.saturation,Xn=e.screen,Yn=e.screenCoordinate,Hn=e.screenSize,Jn=e.screenUV,Kn=e.scriptable,Qn=e.scriptableValue,$n=e.select,es=e.setCurrentStack,ts=e.shaderStages,rs=e.shadow,as=e.pointShadow,os=e.shadowPositionWorld,is=e.sharedUniformGroup,ns=e.shapeCircle,ss=e.sheen,ls=e.sheenRoughness,cs=e.shiftLeft,ms=e.shiftRight,ps=e.shininess,ds=e.sign,us=e.sin,gs=e.sinc,hs=e.skinning,fs=e.smoothstep,xs=e.smoothstepElement,bs=e.specularColor,ws=e.specularF90,vs=e.spherizeUV,Ss=e.split,Ts=e.spritesheetUV,_s=e.sqrt,Vs=e.stack,ys=e.step,Ms=e.storage,Ds=e.storageBarrier,Fs=e.storageObject,Cs=e.storageTexture,Is=e.string,Ps=e.struct,Rs=e.sub,Ns=e.subgroupIndex,Bs=e.subgroupSize,Ls=e.tan,ks=e.tangentGeometry,As=e.tangentLocal,Gs=e.tangentView,Os=e.tangentWorld,Ws=e.temp,js=e.texture,Us=e.texture3D,zs=e.textureBarrier,qs=e.textureBicubic,Es=e.textureCubeUV,Zs=e.textureLoad,Xs=e.textureSize,Ys=e.textureStore,Hs=e.thickness,Js=e.time,Ks=e.timerDelta,Qs=e.timerGlobal,$s=e.timerLocal,el=e.toneMapping,tl=e.toneMappingExposure,rl=e.toonOutlinePass,al=e.transformDirection,ol=e.transformNormal,il=e.transformNormalToView,nl=e.transformedBentNormalView,sl=e.transformedBitangentView,ll=e.transformedBitangentWorld,cl=e.transformedClearcoatNormalView,ml=e.transformedNormalView,pl=e.transformedNormalWorld,dl=e.transformedTangentView,ul=e.transformedTangentWorld,gl=e.transmission,hl=e.transpose,fl=e.triNoise3D,xl=e.triplanarTexture,bl=e.triplanarTextures,wl=e.trunc,vl=e.tslFn,Sl=e.uint,Tl=e.uniform,_l=e.uniformCubeTexture,Vl=e.uniformArray,yl=e.uniformGroup,Ml=e.uniformTexture,Dl=e.uniforms,Fl=e.unpremult,Cl=e.userData,Il=e.uv,Pl=e.uvec2,Rl=e.uvec3,Nl=e.uvec4,Bl=e.Var,Ll=e.varying,kl=e.varyingProperty,Al=e.vec2,Gl=e.vec3,Ol=e.vec4,Wl=e.vectorComponents,jl=e.velocity,Ul=e.vertexColor,zl=e.vertexIndex,ql=e.vibrance,El=e.viewZToLogarithmicDepth,Zl=e.viewZToOrthographicDepth,Xl=e.viewZToPerspectiveDepth,Yl=e.viewport,Hl=e.viewportBottomLeft,Jl=e.viewportCoordinate,Kl=e.viewportDepthTexture,Ql=e.viewportLinearDepth,$l=e.viewportMipTexture,ec=e.viewportResolution,tc=e.viewportSafeUV,rc=e.viewportSharedTexture,ac=e.viewportSize,oc=e.viewportTexture,ic=e.viewportTopLeft,nc=e.viewportUV,sc=e.wgsl,lc=e.wgslFn,cc=e.workgroupArray,mc=e.workgroupBarrier,pc=e.workgroupId,dc=e.workingToColorSpace,uc=e.xor;export{t as BRDF_GGX,r as BRDF_Lambert,a as BasicShadowFilter,o as Break,dt as Const,i as Continue,n as DFGApprox,s as D_GGX,l as Discard,c as EPSILON,m as F_Schlick,p as Fn,d as INFINITY,u as If,h as Loop,w as NodeAccess,f as NodeShaderStage,x as NodeType,b as NodeUpdateType,v as PCFShadowFilter,S as PCFSoftShadowFilter,T as PI,_ as PI2,V as Return,y as Schlick_to_F0,M as ScriptableNodeResources,D as ShaderNode,g as Switch,F as TBNViewMatrix,C as VSMShadowFilter,I as V_GGX_SmithCorrelated,Bl as Var,P as abs,R as acesFilmicToneMapping,N as acos,B as add,L as addNodeElement,k as agxToneMapping,A as all,G as alphaT,O as and,W as anisotropy,j as anisotropyB,U as anisotropyT,z as any,q as append,E as array,Z as arrayBuffer,X as asin,Y as assign,H as atan,J as atan2,K as atomicAdd,Q as atomicAnd,$ as atomicFunc,ne as atomicLoad,ee as atomicMax,te as atomicMin,re as atomicOr,ae as atomicStore,oe as atomicSub,ie as atomicXor,se as attenuationColor,le as attenuationDistance,ce as attribute,me as attributeArray,pe as backgroundBlurriness,de as backgroundIntensity,ue as backgroundRotation,ge as batch,he as billboarding,fe as bitAnd,xe as bitNot,be as bitOr,we as bitXor,ve as bitangentGeometry,Se as bitangentLocal,Te as bitangentView,_e as bitangentWorld,Ve as bitcast,ye as blendBurn,Me as blendColor,De as blendDodge,Fe as blendOverlay,Ce as blendScreen,Ie as blur,Pe as bool,Re as buffer,Ne as bufferAttribute,Be as bumpMap,Le as burn,ke as bvec2,Ae as bvec3,Ge as bvec4,Oe as bypass,We as cache,je as call,Ue as cameraFar,ze as cameraIndex,qe as cameraNear,Ee as cameraNormalMatrix,Ze as cameraPosition,Xe as cameraProjectionMatrix,Ye as cameraProjectionMatrixInverse,He as cameraViewMatrix,Je as cameraWorldMatrix,Ke as cbrt,Qe as cdl,$e as ceil,et as checker,tt as cineonToneMapping,rt as clamp,at as clearcoat,ot as clearcoatRoughness,it as code,nt as color,st as colorSpaceToWorking,lt as colorToDirection,ct as compute,mt as computeSkinning,pt as cond,ut as context,gt as convert,ht as convertColorSpace,ft as convertToTexture,xt as cos,bt as cross,wt as cubeTexture,vt as dFdx,St as dFdy,Tt as dashSize,_t as debug,Vt as decrement,yt as decrementBefore,Mt as defaultBuildStages,Dt as defaultShaderStages,Ft as defined,Ct as degrees,It as deltaTime,Pt as densityFog,Rt as densityFogFactor,Nt as depth,Bt as depthPass,Lt as difference,kt as diffuseColor,At as directPointLight,Gt as directionToColor,Ot as dispersion,Wt as distance,jt as div,Ut as dodge,zt as dot,qt as drawIndex,Et as dynamicBufferAttribute,Zt as element,Xt as emissive,Yt as equal,Ht as equals,Jt as equirectUV,Kt as exp,Qt as exp2,$t as expression,er as faceDirection,tr as faceForward,rr as faceforward,ar as float,or as floor,ir as fog,nr as fract,sr as frameGroup,lr as frameId,cr as frontFacing,mr as fwidth,pr as gain,dr as gapSize,ur as getConstNodeType,gr as getCurrentStack,hr as getDirection,fr as getDistanceAttenuation,xr as getGeometryRoughness,br as getNormalFromDepth,wr as getParallaxCorrectNormal,vr as getRoughness,Sr as getScreenPosition,Tr as getShIrradianceAt,yr as getShadowMaterial,Mr as getShadowRenderObjectFunction,_r as getTextureIndex,Vr as getViewPosition,ba as globalId,Dr as glsl,Fr as glslFn,Cr as grayscale,Ir as greaterThan,Pr as greaterThanEqual,Rr as hash,Nr as highpModelNormalViewMatrix,Br as highpModelViewMatrix,Lr as hue,kr as increment,Ar as incrementBefore,Gr as instance,Or as instanceIndex,Wr as instancedArray,jr as instancedBufferAttribute,Ur as instancedDynamicBufferAttribute,zr as instancedMesh,qr as int,Er as inverseSqrt,Zr as inversesqrt,Xr as invocationLocalIndex,Yr as invocationSubgroupIndex,Hr as ior,Jr as iridescence,Kr as iridescenceIOR,Qr as iridescenceThickness,$r as ivec2,ea as ivec3,ta as ivec4,ra as js,aa as label,oa as length,ia as lengthSq,na as lessThan,sa as lessThanEqual,la as lightPosition,wn as lightProjectionUV,ca as lightShadowMatrix,ma as lightTargetDirection,pa as lightTargetPosition,da as lightViewPosition,ua as lightingContext,ga as lights,ha as linearDepth,fa as linearToneMapping,xa as localId,wa as log,va as log2,Sa as logarithmicDepthToViewZ,Ta as loop,_a as luminance,ya as mat2,Ma as mat3,Da as mat4,Fa as matcapUV,Ca as materialAO,Ia as materialAlphaTest,Pa as materialAnisotropy,Ra as materialAnisotropyVector,Na as materialAttenuationColor,Ba as materialAttenuationDistance,La as materialClearcoat,ka as materialClearcoatNormal,Aa as materialClearcoatRoughness,Ga as materialColor,Oa as materialDispersion,Wa as materialEmissive,ja as materialIOR,Ua as materialIridescence,za as materialIridescenceIOR,qa as materialIridescenceThickness,Ea as materialLightMap,Za as materialLineDashOffset,Xa as materialLineDashSize,Ya as materialLineGapSize,Ha as materialLineScale,Ja as materialLineWidth,Ka as materialMetalness,Qa as materialNormal,$a as materialOpacity,eo as materialPointSize,to as materialReference,ro as materialReflectivity,ao as materialRefractionRatio,oo as materialRotation,io as materialRoughness,no as materialSheen,so as materialSheenRoughness,lo as materialShininess,co as materialSpecular,mo as materialSpecularColor,po as materialSpecularIntensity,uo as materialSpecularStrength,go as materialThickness,ho as materialTransmission,fo as max,xo as maxMipLevel,Va as mediumpModelViewMatrix,bo as metalness,wo as min,vo as mix,So as mixElement,To as mod,_o as modInt,Vo as modelDirection,yo as modelNormalMatrix,Mo as modelPosition,Do as modelRadius,Fo as modelScale,Co as modelViewMatrix,Io as modelViewPosition,Po as modelViewProjection,Ro as modelWorldMatrix,No as modelWorldMatrixInverse,Bo as morphReference,Lo as mrt,ko as mul,Ao as mx_aastep,Go as mx_cell_noise_float,Oo as mx_contrast,Wo as mx_fractal_noise_float,jo as mx_fractal_noise_vec2,Uo as mx_fractal_noise_vec3,zo as mx_fractal_noise_vec4,qo as mx_hsvtorgb,Eo as mx_noise_float,Zo as mx_noise_vec3,Xo as mx_noise_vec4,Yo as mx_ramplr,Ho as mx_ramptb,Jo as mx_rgbtohsv,Ko as mx_safepower,Qo as mx_splitlr,$o as mx_splittb,ei as mx_srgb_texture_to_lin_rec709,ti as mx_transform_uv,ri as mx_worley_noise_float,ai as mx_worley_noise_vec2,oi as mx_worley_noise_vec3,ii as namespace,ni as negate,si as neutralToneMapping,li as nodeArray,ci as nodeImmutable,mi as nodeObject,pi as nodeObjects,di as nodeProxy,ui as normalFlat,gi as normalGeometry,hi as normalLocal,fi as normalMap,xi as normalView,bi as normalWorld,wi as normalize,vi as not,Si as notEqual,Ti as numWorkgroups,_i as objectDirection,Vi as objectGroup,yi as objectPosition,Mi as objectRadius,Di as objectScale,Fi as objectViewPosition,Ci as objectWorldMatrix,Ii as oneMinus,Pi as or,Ri as orthographicDepthToViewZ,Ni as oscSawtooth,Bi as oscSine,Li as oscSquare,ki as oscTriangle,Ai as output,Gi as outputStruct,Oi as overlay,Wi as overloadingFn,ji as parabola,Ui as parallaxDirection,zi as parallaxUV,qi as parameter,Ei as pass,Zi as passTexture,Xi as pcurve,Yi as perspectiveDepthToViewZ,Hi as pmremTexture,as as pointShadow,Ji as pointUV,Ki as pointWidth,Qi as positionGeometry,$i as positionLocal,en as positionPrevious,tn as positionView,rn as positionViewDirection,an as positionWorld,on as positionWorldDirection,nn as posterize,sn as pow,ln as pow2,cn as pow3,mn as pow4,pn as premult,dn as property,un as radians,gn as rand,hn as range,fn as rangeFog,xn as rangeFogFactor,bn as reciprocal,vn as reference,Sn as referenceBuffer,Tn as reflect,_n as reflectVector,Vn as reflectView,yn as reflector,Mn as refract,Dn as refractVector,Fn as refractView,Cn as reinhardToneMapping,In as remainder,Pn as remap,Rn as remapClamp,Nn as renderGroup,Bn as renderOutput,Ln as rendererReference,kn as rotate,An as rotateUV,Gn as roughness,On as round,Wn as rtt,jn as sRGBTransferEOTF,Un as sRGBTransferOETF,zn as sampler,qn as samplerComparison,En as saturate,Zn as saturation,Xn as screen,Yn as screenCoordinate,Hn as screenSize,Jn as screenUV,Kn as scriptable,Qn as scriptableValue,$n as select,es as setCurrentStack,ts as shaderStages,rs as shadow,os as shadowPositionWorld,ns as shapeCircle,is as sharedUniformGroup,ss as sheen,ls as sheenRoughness,cs as shiftLeft,ms as shiftRight,ps as shininess,ds as sign,us as sin,gs as sinc,hs as skinning,fs as smoothstep,xs as smoothstepElement,bs as specularColor,ws as specularF90,vs as spherizeUV,Ss as split,Ts as spritesheetUV,_s as sqrt,Vs as stack,ys as step,Ms as storage,Ds as storageBarrier,Fs as storageObject,Cs as storageTexture,Is as string,Ps as struct,Rs as sub,Ns as subgroupIndex,Bs as subgroupSize,Ls as tan,ks as tangentGeometry,As as tangentLocal,Gs as tangentView,Os as tangentWorld,Ws as temp,js as texture,Us as texture3D,zs as textureBarrier,qs as textureBicubic,Es as textureCubeUV,Zs as textureLoad,Xs as textureSize,Ys as textureStore,Hs as thickness,Js as time,Ks as timerDelta,Qs as timerGlobal,$s as timerLocal,el as toneMapping,tl as toneMappingExposure,rl as toonOutlinePass,al as transformDirection,ol as transformNormal,il as transformNormalToView,nl as transformedBentNormalView,sl as transformedBitangentView,ll as transformedBitangentWorld,cl as transformedClearcoatNormalView,ml as transformedNormalView,pl as transformedNormalWorld,dl as transformedTangentView,ul as transformedTangentWorld,gl as transmission,hl as transpose,fl as triNoise3D,xl as triplanarTexture,bl as triplanarTextures,wl as trunc,vl as tslFn,Sl as uint,Tl as uniform,Vl as uniformArray,_l as uniformCubeTexture,yl as uniformGroup,Ml as uniformTexture,Dl as uniforms,Fl as unpremult,Cl as userData,Il as uv,Pl as uvec2,Rl as uvec3,Nl as uvec4,Ll as varying,kl as varyingProperty,Al as vec2,Gl as vec3,Ol as vec4,Wl as vectorComponents,jl as velocity,Ul as vertexColor,zl as vertexIndex,ql as vibrance,El as viewZToLogarithmicDepth,Zl as viewZToOrthographicDepth,Xl as viewZToPerspectiveDepth,Yl as viewport,Hl as viewportBottomLeft,Jl as viewportCoordinate,Kl as viewportDepthTexture,Ql as viewportLinearDepth,$l as viewportMipTexture,ec as viewportResolution,tc as viewportSafeUV,rc as viewportSharedTexture,ac as viewportSize,oc as viewportTexture,ic as viewportTopLeft,nc as viewportUV,sc as wgsl,lc as wgslFn,cc as workgroupArray,mc as workgroupBarrier,pc as workgroupId,dc as workingToColorSpace,uc as xor}; | ||
import{TSL as e}from"three/webgpu";const t=e.BRDF_GGX,r=e.BRDF_Lambert,a=e.BasicShadowFilter,o=e.Break,i=e.Continue,n=e.DFGApprox,l=e.D_GGX,s=e.Discard,c=e.EPSILON,m=e.F_Schlick,p=e.Fn,d=e.INFINITY,u=e.If,g=e.Switch,h=e.Loop,x=e.NodeShaderStage,f=e.NodeType,b=e.NodeUpdateType,w=e.NodeAccess,v=e.PCFShadowFilter,S=e.PCFSoftShadowFilter,T=e.PI,_=e.PI2,y=e.Return,V=e.Schlick_to_F0,M=e.ScriptableNodeResources,D=e.ShaderNode,F=e.TBNViewMatrix,C=e.VSMShadowFilter,I=e.V_GGX_SmithCorrelated,P=e.abs,R=e.acesFilmicToneMapping,N=e.acos,B=e.add,L=e.addNodeElement,A=e.agxToneMapping,G=e.all,k=e.alphaT,O=e.and,j=e.anisotropy,W=e.anisotropyB,U=e.anisotropyT,z=e.any,q=e.append,E=e.array,Z=e.arrayBuffer,X=e.asin,Y=e.assign,H=e.atan,J=e.atan2,K=e.atomicAdd,Q=e.atomicAnd,$=e.atomicFunc,ee=e.atomicMax,te=e.atomicMin,re=e.atomicOr,ae=e.atomicStore,oe=e.atomicSub,ie=e.atomicXor,ne=e.atomicLoad,le=e.attenuationColor,se=e.attenuationDistance,ce=e.attribute,me=e.attributeArray,pe=e.backgroundBlurriness,de=e.backgroundIntensity,ue=e.backgroundRotation,ge=e.batch,he=e.bentNormalView,xe=e.billboarding,fe=e.bitAnd,be=e.bitNot,we=e.bitOr,ve=e.bitXor,Se=e.bitangentGeometry,Te=e.bitangentLocal,_e=e.bitangentView,ye=e.bitangentWorld,Ve=e.bitcast,Me=e.blendBurn,De=e.blendColor,Fe=e.blendDodge,Ce=e.blendOverlay,Ie=e.blendScreen,Pe=e.blur,Re=e.bool,Ne=e.buffer,Be=e.bufferAttribute,Le=e.bumpMap,Ae=e.burn,Ge=e.bvec2,ke=e.bvec3,Oe=e.bvec4,je=e.bypass,We=e.cache,Ue=e.call,ze=e.cameraFar,qe=e.cameraIndex,Ee=e.cameraNear,Ze=e.cameraNormalMatrix,Xe=e.cameraPosition,Ye=e.cameraProjectionMatrix,He=e.cameraProjectionMatrixInverse,Je=e.cameraViewMatrix,Ke=e.cameraWorldMatrix,Qe=e.cbrt,$e=e.cdl,et=e.ceil,tt=e.checker,rt=e.cineonToneMapping,at=e.clamp,ot=e.clearcoat,it=e.clearcoatRoughness,nt=e.code,lt=e.color,st=e.colorSpaceToWorking,ct=e.colorToDirection,mt=e.compute,pt=e.computeSkinning,dt=e.cond,ut=e.Const,gt=e.context,ht=e.convert,xt=e.convertColorSpace,ft=e.convertToTexture,bt=e.cos,wt=e.cross,vt=e.cubeTexture,St=e.dFdx,Tt=e.dFdy,_t=e.dashSize,yt=e.debug,Vt=e.decrement,Mt=e.decrementBefore,Dt=e.defaultBuildStages,Ft=e.defaultShaderStages,Ct=e.defined,It=e.degrees,Pt=e.deltaTime,Rt=e.densityFog,Nt=e.densityFogFactor,Bt=e.depth,Lt=e.depthPass,At=e.difference,Gt=e.diffuseColor,kt=e.directPointLight,Ot=e.directionToColor,jt=e.dispersion,Wt=e.distance,Ut=e.div,zt=e.dodge,qt=e.dot,Et=e.drawIndex,Zt=e.dynamicBufferAttribute,Xt=e.element,Yt=e.emissive,Ht=e.equal,Jt=e.equals,Kt=e.equirectUV,Qt=e.exp,$t=e.exp2,er=e.expression,tr=e.faceDirection,rr=e.faceForward,ar=e.faceforward,or=e.float,ir=e.floor,nr=e.fog,lr=e.fract,sr=e.frameGroup,cr=e.frameId,mr=e.frontFacing,pr=e.fwidth,dr=e.gain,ur=e.gapSize,gr=e.getConstNodeType,hr=e.getCurrentStack,xr=e.getDirection,fr=e.getDistanceAttenuation,br=e.getGeometryRoughness,wr=e.getNormalFromDepth,vr=e.getParallaxCorrectNormal,Sr=e.getRoughness,Tr=e.getScreenPosition,_r=e.getShIrradianceAt,yr=e.getTextureIndex,Vr=e.getViewPosition,Mr=e.getShadowMaterial,Dr=e.getShadowRenderObjectFunction,Fr=e.glsl,Cr=e.glslFn,Ir=e.grayscale,Pr=e.greaterThan,Rr=e.greaterThanEqual,Nr=e.hash,Br=e.highpModelNormalViewMatrix,Lr=e.highpModelViewMatrix,Ar=e.hue,Gr=e.increment,kr=e.incrementBefore,Or=e.instance,jr=e.instanceIndex,Wr=e.instancedArray,Ur=e.instancedBufferAttribute,zr=e.instancedDynamicBufferAttribute,qr=e.instancedMesh,Er=e.int,Zr=e.inverseSqrt,Xr=e.inversesqrt,Yr=e.invocationLocalIndex,Hr=e.invocationSubgroupIndex,Jr=e.ior,Kr=e.iridescence,Qr=e.iridescenceIOR,$r=e.iridescenceThickness,ea=e.ivec2,ta=e.ivec3,ra=e.ivec4,aa=e.js,oa=e.label,ia=e.length,na=e.lengthSq,la=e.lessThan,sa=e.lessThanEqual,ca=e.lightPosition,ma=e.lightShadowMatrix,pa=e.lightTargetDirection,da=e.lightTargetPosition,ua=e.lightViewPosition,ga=e.lightingContext,ha=e.lights,xa=e.linearDepth,fa=e.linearToneMapping,ba=e.localId,wa=e.globalId,va=e.log,Sa=e.log2,Ta=e.logarithmicDepthToViewZ,_a=e.loop,ya=e.luminance,Va=e.mediumpModelViewMatrix,Ma=e.mat2,Da=e.mat3,Fa=e.mat4,Ca=e.matcapUV,Ia=e.materialAO,Pa=e.materialAlphaTest,Ra=e.materialAnisotropy,Na=e.materialAnisotropyVector,Ba=e.materialAttenuationColor,La=e.materialAttenuationDistance,Aa=e.materialClearcoat,Ga=e.materialClearcoatNormal,ka=e.materialClearcoatRoughness,Oa=e.materialColor,ja=e.materialDispersion,Wa=e.materialEmissive,Ua=e.materialIOR,za=e.materialIridescence,qa=e.materialIridescenceIOR,Ea=e.materialIridescenceThickness,Za=e.materialLightMap,Xa=e.materialLineDashOffset,Ya=e.materialLineDashSize,Ha=e.materialLineGapSize,Ja=e.materialLineScale,Ka=e.materialLineWidth,Qa=e.materialMetalness,$a=e.materialNormal,eo=e.materialOpacity,to=e.materialPointSize,ro=e.materialReference,ao=e.materialReflectivity,oo=e.materialRefractionRatio,io=e.materialRotation,no=e.materialRoughness,lo=e.materialSheen,so=e.materialSheenRoughness,co=e.materialShininess,mo=e.materialSpecular,po=e.materialSpecularColor,uo=e.materialSpecularIntensity,go=e.materialSpecularStrength,ho=e.materialThickness,xo=e.materialTransmission,fo=e.max,bo=e.maxMipLevel,wo=e.metalness,vo=e.min,So=e.mix,To=e.mixElement,_o=e.mod,yo=e.modInt,Vo=e.modelDirection,Mo=e.modelNormalMatrix,Do=e.modelPosition,Fo=e.modelRadius,Co=e.modelScale,Io=e.modelViewMatrix,Po=e.modelViewPosition,Ro=e.modelViewProjection,No=e.modelWorldMatrix,Bo=e.modelWorldMatrixInverse,Lo=e.morphReference,Ao=e.mrt,Go=e.mul,ko=e.mx_aastep,Oo=e.mx_cell_noise_float,jo=e.mx_contrast,Wo=e.mx_fractal_noise_float,Uo=e.mx_fractal_noise_vec2,zo=e.mx_fractal_noise_vec3,qo=e.mx_fractal_noise_vec4,Eo=e.mx_hsvtorgb,Zo=e.mx_noise_float,Xo=e.mx_noise_vec3,Yo=e.mx_noise_vec4,Ho=e.mx_ramplr,Jo=e.mx_ramptb,Ko=e.mx_rgbtohsv,Qo=e.mx_safepower,$o=e.mx_splitlr,ei=e.mx_splittb,ti=e.mx_srgb_texture_to_lin_rec709,ri=e.mx_transform_uv,ai=e.mx_worley_noise_float,oi=e.mx_worley_noise_vec2,ii=e.mx_worley_noise_vec3,ni=e.negate,li=e.neutralToneMapping,si=e.nodeArray,ci=e.nodeImmutable,mi=e.nodeObject,pi=e.nodeObjects,di=e.nodeProxy,ui=e.normalFlat,gi=e.normalGeometry,hi=e.normalLocal,xi=e.normalMap,fi=e.normalView,bi=e.normalViewGeometry,wi=e.normalWorld,vi=e.normalWorldGeometry,Si=e.normalize,Ti=e.not,_i=e.notEqual,yi=e.numWorkgroups,Vi=e.objectDirection,Mi=e.objectGroup,Di=e.objectPosition,Fi=e.objectRadius,Ci=e.objectScale,Ii=e.objectViewPosition,Pi=e.objectWorldMatrix,Ri=e.oneMinus,Ni=e.or,Bi=e.orthographicDepthToViewZ,Li=e.oscSawtooth,Ai=e.oscSine,Gi=e.oscSquare,ki=e.oscTriangle,Oi=e.output,ji=e.outputStruct,Wi=e.overlay,Ui=e.overloadingFn,zi=e.parabola,qi=e.parallaxDirection,Ei=e.parallaxUV,Zi=e.parameter,Xi=e.pass,Yi=e.passTexture,Hi=e.pcurve,Ji=e.perspectiveDepthToViewZ,Ki=e.pmremTexture,Qi=e.pointUV,$i=e.pointWidth,en=e.positionGeometry,tn=e.positionLocal,rn=e.positionPrevious,an=e.positionView,on=e.positionViewDirection,nn=e.positionWorld,ln=e.positionWorldDirection,sn=e.posterize,cn=e.pow,mn=e.pow2,pn=e.pow3,dn=e.pow4,un=e.premultiplyAlpha,gn=e.property,hn=e.radians,xn=e.rand,fn=e.range,bn=e.rangeFog,wn=e.rangeFogFactor,vn=e.reciprocal,Sn=e.lightProjectionUV,Tn=e.reference,_n=e.referenceBuffer,yn=e.reflect,Vn=e.reflectVector,Mn=e.reflectView,Dn=e.reflector,Fn=e.refract,Cn=e.refractVector,In=e.refractView,Pn=e.reinhardToneMapping,Rn=e.remainder,Nn=e.remap,Bn=e.remapClamp,Ln=e.renderGroup,An=e.renderOutput,Gn=e.rendererReference,kn=e.rotate,On=e.rotateUV,jn=e.roughness,Wn=e.round,Un=e.rtt,zn=e.sRGBTransferEOTF,qn=e.sRGBTransferOETF,En=e.sample,Zn=e.sampler,Xn=e.samplerComparison,Yn=e.saturate,Hn=e.saturation,Jn=e.screen,Kn=e.screenCoordinate,Qn=e.screenSize,$n=e.screenUV,el=e.scriptable,tl=e.scriptableValue,rl=e.select,al=e.setCurrentStack,ol=e.shaderStages,il=e.shadow,nl=e.pointShadow,ll=e.shadowPositionWorld,sl=e.sharedUniformGroup,cl=e.shapeCircle,ml=e.sheen,pl=e.sheenRoughness,dl=e.shiftLeft,ul=e.shiftRight,gl=e.shininess,hl=e.sign,xl=e.sin,fl=e.sinc,bl=e.skinning,wl=e.smoothstep,vl=e.smoothstepElement,Sl=e.specularColor,Tl=e.specularF90,_l=e.spherizeUV,yl=e.split,Vl=e.spritesheetUV,Ml=e.sqrt,Dl=e.stack,Fl=e.step,Cl=e.storage,Il=e.storageBarrier,Pl=e.storageObject,Rl=e.storageTexture,Nl=e.string,Bl=e.struct,Ll=e.sub,Al=e.subBuild,Gl=e.subgroupIndex,kl=e.subgroupSize,Ol=e.tan,jl=e.tangentGeometry,Wl=e.tangentLocal,Ul=e.tangentView,zl=e.tangentWorld,ql=e.temp,El=e.texture,Zl=e.texture3D,Xl=e.textureBarrier,Yl=e.textureBicubic,Hl=e.textureBicubicLevel,Jl=e.textureCubeUV,Kl=e.textureLoad,Ql=e.textureSize,$l=e.textureStore,es=e.thickness,ts=e.time,rs=e.timerDelta,as=e.timerGlobal,os=e.timerLocal,is=e.toneMapping,ns=e.toneMappingExposure,ls=e.toonOutlinePass,ss=e.transformDirection,cs=e.transformNormal,ms=e.transformNormalToView,ps=e.transformedClearcoatNormalView,ds=e.transformedNormalView,us=e.transformedNormalWorld,gs=e.transmission,hs=e.transpose,xs=e.triNoise3D,fs=e.triplanarTexture,bs=e.triplanarTextures,ws=e.trunc,vs=e.tslFn,Ss=e.uint,Ts=e.uniform,_s=e.uniformCubeTexture,ys=e.uniformArray,Vs=e.uniformGroup,Ms=e.uniformTexture,Ds=e.uniforms,Fs=e.unpremultiplyAlpha,Cs=e.userData,Is=e.uv,Ps=e.uvec2,Rs=e.uvec3,Ns=e.uvec4,Bs=e.Var,Ls=e.varying,As=e.varyingProperty,Gs=e.vec2,ks=e.vec3,Os=e.vec4,js=e.vectorComponents,Ws=e.velocity,Us=e.vertexColor,zs=e.vertexIndex,qs=e.vibrance,Es=e.viewZToLogarithmicDepth,Zs=e.viewZToOrthographicDepth,Xs=e.viewZToPerspectiveDepth,Ys=e.viewport,Hs=e.viewportBottomLeft,Js=e.viewportCoordinate,Ks=e.viewportDepthTexture,Qs=e.viewportLinearDepth,$s=e.viewportMipTexture,ec=e.viewportResolution,tc=e.viewportSafeUV,rc=e.viewportSharedTexture,ac=e.viewportSize,oc=e.viewportTexture,ic=e.viewportTopLeft,nc=e.viewportUV,lc=e.wgsl,sc=e.wgslFn,cc=e.workgroupArray,mc=e.workgroupBarrier,pc=e.workgroupId,dc=e.workingToColorSpace,uc=e.xor;export{t as BRDF_GGX,r as BRDF_Lambert,a as BasicShadowFilter,o as Break,ut as Const,i as Continue,n as DFGApprox,l as D_GGX,s as Discard,c as EPSILON,m as F_Schlick,p as Fn,d as INFINITY,u as If,h as Loop,w as NodeAccess,x as NodeShaderStage,f as NodeType,b as NodeUpdateType,v as PCFShadowFilter,S as PCFSoftShadowFilter,T as PI,_ as PI2,y as Return,V as Schlick_to_F0,M as ScriptableNodeResources,D as ShaderNode,g as Switch,F as TBNViewMatrix,C as VSMShadowFilter,I as V_GGX_SmithCorrelated,Bs as Var,P as abs,R as acesFilmicToneMapping,N as acos,B as add,L as addNodeElement,A as agxToneMapping,G as all,k as alphaT,O as and,j as anisotropy,W as anisotropyB,U as anisotropyT,z as any,q as append,E as array,Z as arrayBuffer,X as asin,Y as assign,H as atan,J as atan2,K as atomicAdd,Q as atomicAnd,$ as atomicFunc,ne as atomicLoad,ee as atomicMax,te as atomicMin,re as atomicOr,ae as atomicStore,oe as atomicSub,ie as atomicXor,le as attenuationColor,se as attenuationDistance,ce as attribute,me as attributeArray,pe as backgroundBlurriness,de as backgroundIntensity,ue as backgroundRotation,ge as batch,he as bentNormalView,xe as billboarding,fe as bitAnd,be as bitNot,we as bitOr,ve as bitXor,Se as bitangentGeometry,Te as bitangentLocal,_e as bitangentView,ye as bitangentWorld,Ve as bitcast,Me as blendBurn,De as blendColor,Fe as blendDodge,Ce as blendOverlay,Ie as blendScreen,Pe as blur,Re as bool,Ne as buffer,Be as bufferAttribute,Le as bumpMap,Ae as burn,Ge as bvec2,ke as bvec3,Oe as bvec4,je as bypass,We as cache,Ue as call,ze as cameraFar,qe as cameraIndex,Ee as cameraNear,Ze as cameraNormalMatrix,Xe as cameraPosition,Ye as cameraProjectionMatrix,He as cameraProjectionMatrixInverse,Je as cameraViewMatrix,Ke as cameraWorldMatrix,Qe as cbrt,$e as cdl,et as ceil,tt as checker,rt as cineonToneMapping,at as clamp,ot as clearcoat,it as clearcoatRoughness,nt as code,lt as color,st as colorSpaceToWorking,ct as colorToDirection,mt as compute,pt as computeSkinning,dt as cond,gt as context,ht as convert,xt as convertColorSpace,ft as convertToTexture,bt as cos,wt as cross,vt as cubeTexture,St as dFdx,Tt as dFdy,_t as dashSize,yt as debug,Vt as decrement,Mt as decrementBefore,Dt as defaultBuildStages,Ft as defaultShaderStages,Ct as defined,It as degrees,Pt as deltaTime,Rt as densityFog,Nt as densityFogFactor,Bt as depth,Lt as depthPass,At as difference,Gt as diffuseColor,kt as directPointLight,Ot as directionToColor,jt as dispersion,Wt as distance,Ut as div,zt as dodge,qt as dot,Et as drawIndex,Zt as dynamicBufferAttribute,Xt as element,Yt as emissive,Ht as equal,Jt as equals,Kt as equirectUV,Qt as exp,$t as exp2,er as expression,tr as faceDirection,rr as faceForward,ar as faceforward,or as float,ir as floor,nr as fog,lr as fract,sr as frameGroup,cr as frameId,mr as frontFacing,pr as fwidth,dr as gain,ur as gapSize,gr as getConstNodeType,hr as getCurrentStack,xr as getDirection,fr as getDistanceAttenuation,br as getGeometryRoughness,wr as getNormalFromDepth,vr as getParallaxCorrectNormal,Sr as getRoughness,Tr as getScreenPosition,_r as getShIrradianceAt,Mr as getShadowMaterial,Dr as getShadowRenderObjectFunction,yr as getTextureIndex,Vr as getViewPosition,wa as globalId,Fr as glsl,Cr as glslFn,Ir as grayscale,Pr as greaterThan,Rr as greaterThanEqual,Nr as hash,Br as highpModelNormalViewMatrix,Lr as highpModelViewMatrix,Ar as hue,Gr as increment,kr as incrementBefore,Or as instance,jr as instanceIndex,Wr as instancedArray,Ur as instancedBufferAttribute,zr as instancedDynamicBufferAttribute,qr as instancedMesh,Er as int,Zr as inverseSqrt,Xr as inversesqrt,Yr as invocationLocalIndex,Hr as invocationSubgroupIndex,Jr as ior,Kr as iridescence,Qr as iridescenceIOR,$r as iridescenceThickness,ea as ivec2,ta as ivec3,ra as ivec4,aa as js,oa as label,ia as length,na as lengthSq,la as lessThan,sa as lessThanEqual,ca as lightPosition,Sn as lightProjectionUV,ma as lightShadowMatrix,pa as lightTargetDirection,da as lightTargetPosition,ua as lightViewPosition,ga as lightingContext,ha as lights,xa as linearDepth,fa as linearToneMapping,ba as localId,va as log,Sa as log2,Ta as logarithmicDepthToViewZ,_a as loop,ya as luminance,Ma as mat2,Da as mat3,Fa as mat4,Ca as matcapUV,Ia as materialAO,Pa as materialAlphaTest,Ra as materialAnisotropy,Na as materialAnisotropyVector,Ba as materialAttenuationColor,La as materialAttenuationDistance,Aa as materialClearcoat,Ga as materialClearcoatNormal,ka as materialClearcoatRoughness,Oa as materialColor,ja as materialDispersion,Wa as materialEmissive,Ua as materialIOR,za as materialIridescence,qa as materialIridescenceIOR,Ea as materialIridescenceThickness,Za as materialLightMap,Xa as materialLineDashOffset,Ya as materialLineDashSize,Ha as materialLineGapSize,Ja as materialLineScale,Ka as materialLineWidth,Qa as materialMetalness,$a as materialNormal,eo as materialOpacity,to as materialPointSize,ro as materialReference,ao as materialReflectivity,oo as materialRefractionRatio,io as materialRotation,no as materialRoughness,lo as materialSheen,so as materialSheenRoughness,co as materialShininess,mo as materialSpecular,po as materialSpecularColor,uo as materialSpecularIntensity,go as materialSpecularStrength,ho as materialThickness,xo as materialTransmission,fo as max,bo as maxMipLevel,Va as mediumpModelViewMatrix,wo as metalness,vo as min,So as mix,To as mixElement,_o as mod,yo as modInt,Vo as modelDirection,Mo as modelNormalMatrix,Do as modelPosition,Fo as modelRadius,Co as modelScale,Io as modelViewMatrix,Po as modelViewPosition,Ro as modelViewProjection,No as modelWorldMatrix,Bo as modelWorldMatrixInverse,Lo as morphReference,Ao as mrt,Go as mul,ko as mx_aastep,Oo as mx_cell_noise_float,jo as mx_contrast,Wo as mx_fractal_noise_float,Uo as mx_fractal_noise_vec2,zo as mx_fractal_noise_vec3,qo as mx_fractal_noise_vec4,Eo as mx_hsvtorgb,Zo as mx_noise_float,Xo as mx_noise_vec3,Yo as mx_noise_vec4,Ho as mx_ramplr,Jo as mx_ramptb,Ko as mx_rgbtohsv,Qo as mx_safepower,$o as mx_splitlr,ei as mx_splittb,ti as mx_srgb_texture_to_lin_rec709,ri as mx_transform_uv,ai as mx_worley_noise_float,oi as mx_worley_noise_vec2,ii as mx_worley_noise_vec3,ni as negate,li as neutralToneMapping,si as nodeArray,ci as nodeImmutable,mi as nodeObject,pi as nodeObjects,di as nodeProxy,ui as normalFlat,gi as normalGeometry,hi as normalLocal,xi as normalMap,fi as normalView,bi as normalViewGeometry,wi as normalWorld,vi as normalWorldGeometry,Si as normalize,Ti as not,_i as notEqual,yi as numWorkgroups,Vi as objectDirection,Mi as objectGroup,Di as objectPosition,Fi as objectRadius,Ci as objectScale,Ii as objectViewPosition,Pi as objectWorldMatrix,Ri as oneMinus,Ni as or,Bi as orthographicDepthToViewZ,Li as oscSawtooth,Ai as oscSine,Gi as oscSquare,ki as oscTriangle,Oi as output,ji as outputStruct,Wi as overlay,Ui as overloadingFn,zi as parabola,qi as parallaxDirection,Ei as parallaxUV,Zi as parameter,Xi as pass,Yi as passTexture,Hi as pcurve,Ji as perspectiveDepthToViewZ,Ki as pmremTexture,nl as pointShadow,Qi as pointUV,$i as pointWidth,en as positionGeometry,tn as positionLocal,rn as positionPrevious,an as positionView,on as positionViewDirection,nn as positionWorld,ln as positionWorldDirection,sn as posterize,cn as pow,mn as pow2,pn as pow3,dn as pow4,un as premultiplyAlpha,gn as property,hn as radians,xn as rand,fn as range,bn as rangeFog,wn as rangeFogFactor,vn as reciprocal,Tn as reference,_n as referenceBuffer,yn as reflect,Vn as reflectVector,Mn as reflectView,Dn as reflector,Fn as refract,Cn as refractVector,In as refractView,Pn as reinhardToneMapping,Rn as remainder,Nn as remap,Bn as remapClamp,Ln as renderGroup,An as renderOutput,Gn as rendererReference,kn as rotate,On as rotateUV,jn as roughness,Wn as round,Un as rtt,zn as sRGBTransferEOTF,qn as sRGBTransferOETF,En as sample,Zn as sampler,Xn as samplerComparison,Yn as saturate,Hn as saturation,Jn as screen,Kn as screenCoordinate,Qn as screenSize,$n as screenUV,el as scriptable,tl as scriptableValue,rl as select,al as setCurrentStack,ol as shaderStages,il as shadow,ll as shadowPositionWorld,cl as shapeCircle,sl as sharedUniformGroup,ml as sheen,pl as sheenRoughness,dl as shiftLeft,ul as shiftRight,gl as shininess,hl as sign,xl as sin,fl as sinc,bl as skinning,wl as smoothstep,vl as smoothstepElement,Sl as specularColor,Tl as specularF90,_l as spherizeUV,yl as split,Vl as spritesheetUV,Ml as sqrt,Dl as stack,Fl as step,Cl as storage,Il as storageBarrier,Pl as storageObject,Rl as storageTexture,Nl as string,Bl as struct,Ll as sub,Al as subBuild,Gl as subgroupIndex,kl as subgroupSize,Ol as tan,jl as tangentGeometry,Wl as tangentLocal,Ul as tangentView,zl as tangentWorld,ql as temp,El as texture,Zl as texture3D,Xl as textureBarrier,Yl as textureBicubic,Hl as textureBicubicLevel,Jl as textureCubeUV,Kl as textureLoad,Ql as textureSize,$l as textureStore,es as thickness,ts as time,rs as timerDelta,as as timerGlobal,os as timerLocal,is as toneMapping,ns as toneMappingExposure,ls as toonOutlinePass,ss as transformDirection,cs as transformNormal,ms as transformNormalToView,ps as transformedClearcoatNormalView,ds as transformedNormalView,us as transformedNormalWorld,gs as transmission,hs as transpose,xs as triNoise3D,fs as triplanarTexture,bs as triplanarTextures,ws as trunc,vs as tslFn,Ss as uint,Ts as uniform,ys as uniformArray,_s as uniformCubeTexture,Vs as uniformGroup,Ms as uniformTexture,Ds as uniforms,Fs as unpremultiplyAlpha,Cs as userData,Is as uv,Ps as uvec2,Rs as uvec3,Ns as uvec4,Ls as varying,As as varyingProperty,Gs as vec2,ks as vec3,Os as vec4,js as vectorComponents,Ws as velocity,Us as vertexColor,zs as vertexIndex,qs as vibrance,Es as viewZToLogarithmicDepth,Zs as viewZToOrthographicDepth,Xs as viewZToPerspectiveDepth,Ys as viewport,Hs as viewportBottomLeft,Js as viewportCoordinate,Ks as viewportDepthTexture,Qs as viewportLinearDepth,$s as viewportMipTexture,ec as viewportResolution,tc as viewportSafeUV,rc as viewportSharedTexture,ac as viewportSize,oc as viewportTexture,ic as viewportTopLeft,nc as viewportUV,lc as wgsl,sc as wgslFn,cc as workgroupArray,mc as workgroupBarrier,pc as workgroupId,dc as workingToColorSpace,uc as xor}; |
@@ -111,31 +111,4 @@ /** | ||
// @deprecated, r168 | ||
static isWebGLAvailable() { | ||
console.warn( 'isWebGLAvailable() has been deprecated and will be removed in r178. Use isWebGL2Available() instead.' ); | ||
try { | ||
const canvas = document.createElement( 'canvas' ); | ||
return !! ( window.WebGLRenderingContext && ( canvas.getContext( 'webgl' ) || canvas.getContext( 'experimental-webgl' ) ) ); | ||
} catch ( e ) { | ||
return false; | ||
} | ||
} | ||
static getWebGLErrorMessage() { | ||
console.warn( 'getWebGLErrorMessage() has been deprecated and will be removed in r178. Use getWebGL2ErrorMessage() instead.' ); | ||
return this._getErrorMessage( 1 ); | ||
} | ||
} | ||
export default WebGL; |
@@ -891,2 +891,36 @@ import { | ||
/** | ||
* Sets the colors of the control's gizmo. | ||
* | ||
* @param {number|Color|string} xAxis - The x-axis color. | ||
* @param {number|Color|string} yAxis - The y-axis color. | ||
* @param {number|Color|string} zAxis - The z-axis color. | ||
* @param {number|Color|string} active - The color for active elements. | ||
*/ | ||
setColors( xAxis, yAxis, zAxis, active ) { | ||
const materialLib = this._gizmo.materialLib; | ||
materialLib.xAxis.color.set( xAxis ); | ||
materialLib.yAxis.color.set( yAxis ); | ||
materialLib.zAxis.color.set( zAxis ); | ||
materialLib.active.color.set( active ); | ||
materialLib.xAxisTransparent.color.set( xAxis ); | ||
materialLib.yAxisTransparent.color.set( yAxis ); | ||
materialLib.zAxisTransparent.color.set( zAxis ); | ||
materialLib.activeTransparent.color.set( active ); | ||
// update color caches | ||
if ( materialLib.xAxis._color ) materialLib.xAxis._color.set( xAxis ); | ||
if ( materialLib.yAxis._color ) materialLib.yAxis._color.set( yAxis ); | ||
if ( materialLib.zAxis._color ) materialLib.zAxis._color.set( zAxis ); | ||
if ( materialLib.active._color ) materialLib.active._color.set( active ); | ||
if ( materialLib.xAxisTransparent._color ) materialLib.xAxisTransparent._color.set( xAxis ); | ||
if ( materialLib.yAxisTransparent._color ) materialLib.yAxisTransparent._color.set( yAxis ); | ||
if ( materialLib.zAxisTransparent._color ) materialLib.zAxisTransparent._color.set( zAxis ); | ||
if ( materialLib.activeTransparent._color ) materialLib.activeTransparent._color.set( active ); | ||
} | ||
} | ||
@@ -1150,2 +1184,15 @@ | ||
// materials in the below property are configurable via setColors() | ||
this.materialLib = { | ||
xAxis: matRed, | ||
yAxis: matGreen, | ||
zAxis: matBlue, | ||
active: matYellow, | ||
xAxisTransparent: matRedTransparent, | ||
yAxisTransparent: matGreenTransparent, | ||
zAxisTransparent: matBlueTransparent, | ||
activeTransparent: matYellowTransparent | ||
}; | ||
// reusable geometry | ||
@@ -1205,12 +1252,12 @@ | ||
XYZ: [ | ||
[ new Mesh( new OctahedronGeometry( 0.1, 0 ), matWhiteTransparent.clone() ), [ 0, 0, 0 ]] | ||
[ new Mesh( new OctahedronGeometry( 0.1, 0 ), matWhiteTransparent ), [ 0, 0, 0 ]] | ||
], | ||
XY: [ | ||
[ new Mesh( new BoxGeometry( 0.15, 0.15, 0.01 ), matBlueTransparent.clone() ), [ 0.15, 0.15, 0 ]] | ||
[ new Mesh( new BoxGeometry( 0.15, 0.15, 0.01 ), matBlueTransparent ), [ 0.15, 0.15, 0 ]] | ||
], | ||
YZ: [ | ||
[ new Mesh( new BoxGeometry( 0.15, 0.15, 0.01 ), matRedTransparent.clone() ), [ 0, 0.15, 0.15 ], [ 0, Math.PI / 2, 0 ]] | ||
[ new Mesh( new BoxGeometry( 0.15, 0.15, 0.01 ), matRedTransparent ), [ 0, 0.15, 0.15 ], [ 0, Math.PI / 2, 0 ]] | ||
], | ||
XZ: [ | ||
[ new Mesh( new BoxGeometry( 0.15, 0.15, 0.01 ), matGreenTransparent.clone() ), [ 0.15, 0, 0.15 ], [ - Math.PI / 2, 0, 0 ]] | ||
[ new Mesh( new BoxGeometry( 0.15, 0.15, 0.01 ), matGreenTransparent ), [ 0.15, 0, 0.15 ], [ - Math.PI / 2, 0, 0 ]] | ||
] | ||
@@ -1257,9 +1304,9 @@ }; | ||
X: [ | ||
[ new Line( lineGeometry, matHelper.clone() ), [ - 1e3, 0, 0 ], null, [ 1e6, 1, 1 ], 'helper' ] | ||
[ new Line( lineGeometry, matHelper ), [ - 1e3, 0, 0 ], null, [ 1e6, 1, 1 ], 'helper' ] | ||
], | ||
Y: [ | ||
[ new Line( lineGeometry, matHelper.clone() ), [ 0, - 1e3, 0 ], [ 0, 0, Math.PI / 2 ], [ 1e6, 1, 1 ], 'helper' ] | ||
[ new Line( lineGeometry, matHelper ), [ 0, - 1e3, 0 ], [ 0, 0, Math.PI / 2 ], [ 1e6, 1, 1 ], 'helper' ] | ||
], | ||
Z: [ | ||
[ new Line( lineGeometry, matHelper.clone() ), [ 0, 0, - 1e3 ], [ 0, - Math.PI / 2, 0 ], [ 1e6, 1, 1 ], 'helper' ] | ||
[ new Line( lineGeometry, matHelper ), [ 0, 0, - 1e3 ], [ 0, - Math.PI / 2, 0 ], [ 1e6, 1, 1 ], 'helper' ] | ||
] | ||
@@ -1288,3 +1335,3 @@ }; | ||
AXIS: [ | ||
[ new Line( lineGeometry, matHelper.clone() ), [ - 1e3, 0, 0 ], null, [ 1e6, 1, 1 ], 'helper' ] | ||
[ new Line( lineGeometry, matHelper ), [ - 1e3, 0, 0 ], null, [ 1e6, 1, 1 ], 'helper' ] | ||
] | ||
@@ -1337,3 +1384,3 @@ }; | ||
XYZ: [ | ||
[ new Mesh( new BoxGeometry( 0.1, 0.1, 0.1 ), matWhiteTransparent.clone() ) ], | ||
[ new Mesh( new BoxGeometry( 0.1, 0.1, 0.1 ), matWhiteTransparent ) ], | ||
] | ||
@@ -1371,9 +1418,9 @@ }; | ||
X: [ | ||
[ new Line( lineGeometry, matHelper.clone() ), [ - 1e3, 0, 0 ], null, [ 1e6, 1, 1 ], 'helper' ] | ||
[ new Line( lineGeometry, matHelper ), [ - 1e3, 0, 0 ], null, [ 1e6, 1, 1 ], 'helper' ] | ||
], | ||
Y: [ | ||
[ new Line( lineGeometry, matHelper.clone() ), [ 0, - 1e3, 0 ], [ 0, 0, Math.PI / 2 ], [ 1e6, 1, 1 ], 'helper' ] | ||
[ new Line( lineGeometry, matHelper ), [ 0, - 1e3, 0 ], [ 0, 0, Math.PI / 2 ], [ 1e6, 1, 1 ], 'helper' ] | ||
], | ||
Z: [ | ||
[ new Line( lineGeometry, matHelper.clone() ), [ 0, 0, - 1e3 ], [ 0, - Math.PI / 2, 0 ], [ 1e6, 1, 1 ], 'helper' ] | ||
[ new Line( lineGeometry, matHelper ), [ 0, 0, - 1e3 ], [ 0, - Math.PI / 2, 0 ], [ 1e6, 1, 1 ], 'helper' ] | ||
] | ||
@@ -1759,3 +1806,3 @@ }; | ||
handle.material.color.setHex( 0xffff00 ); | ||
handle.material.color.copy( this.materialLib.active.color ); | ||
handle.material.opacity = 1.0; | ||
@@ -1769,3 +1816,3 @@ | ||
handle.material.color.setHex( 0xffff00 ); | ||
handle.material.color.copy( this.materialLib.active.color ); | ||
handle.material.opacity = 1.0; | ||
@@ -1772,0 +1819,0 @@ |
@@ -73,3 +73,3 @@ import { | ||
super( 1, 1, 1, segments, segments, segments ); | ||
super( width, height, depth, segments, segments, segments ); | ||
@@ -76,0 +76,0 @@ // if we just have one segment we're the same as a regular box |
import { Clock, Vector3, Quaternion, Matrix4 } from 'three'; | ||
const RAPIER_PATH = 'https://cdn.skypack.dev/@dimforge/rapier3d-compat@0.12.0'; | ||
const RAPIER_PATH = 'https://cdn.skypack.dev/@dimforge/rapier3d-compat@0.17.3'; | ||
@@ -135,3 +135,3 @@ const frameRate = 60; | ||
const body = mesh.isInstancedMesh | ||
const { body, collider } = mesh.isInstancedMesh | ||
? createInstancedBody( mesh, mass, shape ) | ||
@@ -143,2 +143,3 @@ : createBody( mesh.position, mesh.quaternion, mass, shape ); | ||
mesh.userData.physics.body = body; | ||
mesh.userData.physics.collider = collider; | ||
@@ -148,3 +149,3 @@ if ( mass > 0 ) { | ||
meshes.push( mesh ); | ||
meshMap.set( mesh, body ); | ||
meshMap.set( mesh, { body, collider } ); | ||
@@ -155,2 +156,23 @@ } | ||
function removeMesh( mesh ) { | ||
const index = meshes.indexOf( mesh ); | ||
if ( index !== - 1 ) { | ||
meshes.splice( index, 1 ); | ||
meshMap.delete( mesh ); | ||
if ( ! mesh.userData.physics ) return; | ||
const body = mesh.userData.physics.body; | ||
const collider = mesh.userData.physics.collider; | ||
if ( body ) removeBody( body ); | ||
if ( collider ) removeCollider( collider ); | ||
} | ||
} | ||
function createInstancedBody( mesh, mass, shape ) { | ||
@@ -161,2 +183,3 @@ | ||
const bodies = []; | ||
const colliders = []; | ||
@@ -166,7 +189,9 @@ for ( let i = 0; i < mesh.count; i ++ ) { | ||
const position = _vector.fromArray( array, i * 16 + 12 ); | ||
bodies.push( createBody( position, null, mass, shape ) ); | ||
const { body, collider } = createBody( position, null, mass, shape ); | ||
bodies.push( body ); | ||
colliders.push( collider ); | ||
} | ||
return bodies; | ||
return { body: bodies, collider: colliders }; | ||
@@ -182,11 +207,47 @@ } | ||
const body = world.createRigidBody( desc ); | ||
world.createCollider( shape, body ); | ||
const collider = world.createCollider( shape, body ); | ||
return body; | ||
return { body, collider }; | ||
} | ||
function removeBody( body ) { | ||
if ( Array.isArray( body ) ) { | ||
for ( let i = 0; i < body.length; i ++ ) { | ||
world.removeRigidBody( body[ i ] ); | ||
} | ||
} else { | ||
world.removeRigidBody( body ); | ||
} | ||
} | ||
function removeCollider( collider ) { | ||
if ( Array.isArray( collider ) ) { | ||
for ( let i = 0; i < collider.length; i ++ ) { | ||
world.removeCollider( collider[ i ] ); | ||
} | ||
} else { | ||
world.removeCollider( collider ); | ||
} | ||
} | ||
function setMeshPosition( mesh, position, index = 0 ) { | ||
let body = meshMap.get( mesh ); | ||
let { body } = meshMap.get( mesh ); | ||
@@ -207,3 +268,3 @@ if ( mesh.isInstancedMesh ) { | ||
let body = meshMap.get( mesh ); | ||
let { body } = meshMap.get( mesh ); | ||
@@ -256,3 +317,3 @@ if ( mesh.isInstancedMesh ) { | ||
const array = mesh.instanceMatrix.array; | ||
const bodies = meshMap.get( mesh ); | ||
const { body: bodies } = meshMap.get( mesh ); | ||
@@ -275,3 +336,3 @@ for ( let j = 0; j < bodies.length; j ++ ) { | ||
const body = meshMap.get( mesh ); | ||
const { body } = meshMap.get( mesh ); | ||
@@ -320,2 +381,11 @@ mesh.position.copy( body.translation() ); | ||
/** | ||
* Removes the given mesh from this physics simulation. | ||
* | ||
* @method | ||
* @name RapierPhysics#removeMesh | ||
* @param {Mesh} mesh The mesh to remove. | ||
*/ | ||
removeMesh: removeMesh, | ||
/** | ||
* Set the position of the given mesh which is part of the physics simulation. Calling this | ||
@@ -322,0 +392,0 @@ * method will reset the current simulated velocity of the mesh. |
@@ -1,9 +0,122 @@ | ||
export class Program { | ||
import { toFloatType } from './TranspilerUtils.js'; | ||
export class ASTNode { | ||
constructor() { | ||
this.body = []; | ||
this.isASTNode = true; | ||
this.linker = { | ||
reference: null, | ||
accesses: [], | ||
assignments: [] | ||
}; | ||
this.parent = null; | ||
} | ||
get isNumericExpression() { | ||
return false; | ||
} | ||
get hasAssignment() { | ||
if ( this.isAssignment === true ) { | ||
return true; | ||
} | ||
if ( this.parent === null ) { | ||
return false; | ||
} | ||
return this.parent.hasAssignment; | ||
} | ||
getType() { | ||
return this.type || null; | ||
} | ||
getParent( parents = [] ) { | ||
if ( this.parent === null ) { | ||
return parents; | ||
} | ||
parents.push( this.parent ); | ||
return this.parent.getParent( parents ); | ||
} | ||
initialize() { | ||
for ( const key in this ) { | ||
if ( this[ key ] && this[ key ].isASTNode ) { | ||
this[ key ].parent = this; | ||
} else if ( Array.isArray( this[ key ] ) ) { | ||
const array = this[ key ]; | ||
for ( const item of array ) { | ||
if ( item && item.isASTNode ) { | ||
item.parent = this; | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
export class Comment extends ASTNode { | ||
constructor( comment ) { | ||
super(); | ||
this.comment = comment; | ||
this.isComment = true; | ||
this.initialize(); | ||
} | ||
} | ||
export class Program extends ASTNode { | ||
constructor( body = [] ) { | ||
super(); | ||
this.body = body; | ||
this.isProgram = true; | ||
this.initialize(); | ||
} | ||
@@ -13,6 +126,8 @@ | ||
export class VariableDeclaration { | ||
export class VariableDeclaration extends ASTNode { | ||
constructor( type, name, value = null, next = null, immutable = false ) { | ||
super(); | ||
this.type = type; | ||
@@ -27,10 +142,20 @@ this.name = name; | ||
this.initialize(); | ||
} | ||
get isAssignment() { | ||
return this.value !== null; | ||
} | ||
} | ||
export class Uniform { | ||
export class Uniform extends ASTNode { | ||
constructor( type, name ) { | ||
super(); | ||
this.type = type; | ||
@@ -41,2 +166,4 @@ this.name = name; | ||
this.initialize(); | ||
} | ||
@@ -46,6 +173,8 @@ | ||
export class Varying { | ||
export class Varying extends ASTNode { | ||
constructor( type, name ) { | ||
super(); | ||
this.type = type; | ||
@@ -56,2 +185,4 @@ this.name = name; | ||
this.initialize(); | ||
} | ||
@@ -61,6 +192,8 @@ | ||
export class FunctionParameter { | ||
export class FunctionParameter extends ASTNode { | ||
constructor( type, name, qualifier = null, immutable = true ) { | ||
super(); | ||
this.type = type; | ||
@@ -73,2 +206,4 @@ this.name = name; | ||
this.initialize(); | ||
} | ||
@@ -78,13 +213,17 @@ | ||
export class FunctionDeclaration { | ||
export class FunctionDeclaration extends ASTNode { | ||
constructor( type, name, params = [] ) { | ||
constructor( type, name, params = [], body = [] ) { | ||
super(); | ||
this.type = type; | ||
this.name = name; | ||
this.params = params; | ||
this.body = []; | ||
this.body = body; | ||
this.isFunctionDeclaration = true; | ||
this.initialize(); | ||
} | ||
@@ -94,6 +233,8 @@ | ||
export class Expression { | ||
export class Expression extends ASTNode { | ||
constructor( expression ) { | ||
super(); | ||
this.expression = expression; | ||
@@ -103,2 +244,4 @@ | ||
this.initialize(); | ||
} | ||
@@ -108,6 +251,8 @@ | ||
export class Ternary { | ||
export class Ternary extends ASTNode { | ||
constructor( cond, left, right ) { | ||
super(); | ||
this.cond = cond; | ||
@@ -119,2 +264,4 @@ this.left = left; | ||
this.initialize(); | ||
} | ||
@@ -124,6 +271,8 @@ | ||
export class Operator { | ||
export class Operator extends ASTNode { | ||
constructor( type, left, right ) { | ||
super(); | ||
this.type = type; | ||
@@ -135,11 +284,52 @@ this.left = left; | ||
this.initialize(); | ||
} | ||
get isAssignment() { | ||
return /^(=|\+=|-=|\*=|\/=|%=|<<=|>>=|>>>=|&=|\^=|\|=)$/.test( this.type ); | ||
} | ||
get isNumericExpression() { | ||
if ( this.left.isNumericExpression && this.right.isNumericExpression ) { | ||
return true; | ||
} | ||
return false; | ||
} | ||
getType() { | ||
const leftType = this.left.getType(); | ||
const rightType = this.right.getType(); | ||
if ( leftType === rightType ) { | ||
return leftType; | ||
} else if ( toFloatType( leftType ) === toFloatType( rightType ) ) { | ||
return toFloatType( leftType ); | ||
} | ||
return null; | ||
} | ||
} | ||
export class Unary { | ||
export class Unary extends ASTNode { | ||
constructor( type, expression, after = false ) { | ||
super(); | ||
this.type = type; | ||
@@ -151,10 +341,32 @@ this.expression = expression; | ||
this.initialize(); | ||
} | ||
get isAssignment() { | ||
return /^(\+\+|--)$/.test( this.type ); | ||
} | ||
get isNumericExpression() { | ||
if ( this.expression.isNumber ) { | ||
return true; | ||
} | ||
return false; | ||
} | ||
} | ||
export class Number { | ||
export class Number extends ASTNode { | ||
constructor( value, type = 'float' ) { | ||
super(); | ||
this.type = type; | ||
@@ -165,10 +377,20 @@ this.value = value; | ||
this.initialize(); | ||
} | ||
get isNumericExpression() { | ||
return true; | ||
} | ||
} | ||
export class String { | ||
export class String extends ASTNode { | ||
constructor( value ) { | ||
super(); | ||
this.value = value; | ||
@@ -178,2 +400,4 @@ | ||
this.initialize(); | ||
} | ||
@@ -184,9 +408,10 @@ | ||
export class Conditional { | ||
export class Conditional extends ASTNode { | ||
constructor( cond = null ) { | ||
constructor( cond = null, body = [] ) { | ||
super(); | ||
this.cond = cond; | ||
this.body = []; | ||
this.body = body; | ||
this.elseConditional = null; | ||
@@ -196,2 +421,4 @@ | ||
this.initialize(); | ||
} | ||
@@ -201,6 +428,8 @@ | ||
export class FunctionCall { | ||
export class FunctionCall extends ASTNode { | ||
constructor( name, params = [] ) { | ||
super(); | ||
this.name = name; | ||
@@ -211,2 +440,4 @@ this.params = params; | ||
this.initialize(); | ||
} | ||
@@ -216,6 +447,8 @@ | ||
export class Return { | ||
export class Return extends ASTNode { | ||
constructor( value ) { | ||
super(); | ||
this.value = value; | ||
@@ -225,2 +458,4 @@ | ||
this.initialize(); | ||
} | ||
@@ -230,8 +465,12 @@ | ||
export class Discard { | ||
export class Discard extends ASTNode { | ||
constructor() { | ||
super(); | ||
this.isDiscard = true; | ||
this.initialize(); | ||
} | ||
@@ -241,6 +480,36 @@ | ||
export class Accessor { | ||
export class Continue extends ASTNode { | ||
constructor() { | ||
super(); | ||
this.isContinue = true; | ||
this.initialize(); | ||
} | ||
} | ||
export class Break extends ASTNode { | ||
constructor() { | ||
super(); | ||
this.isBreak = true; | ||
this.initialize(); | ||
} | ||
} | ||
export class Accessor extends ASTNode { | ||
constructor( property ) { | ||
super(); | ||
this.property = property; | ||
@@ -250,10 +519,26 @@ | ||
this.initialize(); | ||
} | ||
getType() { | ||
if ( this.linker.reference ) { | ||
return this.linker.reference.getType(); | ||
} | ||
return super.getType(); | ||
} | ||
} | ||
export class StaticElement { | ||
export class StaticElement extends ASTNode { | ||
constructor( value ) { | ||
super(); | ||
this.value = value; | ||
@@ -263,2 +548,4 @@ | ||
this.initialize(); | ||
} | ||
@@ -268,6 +555,8 @@ | ||
export class DynamicElement { | ||
export class DynamicElement extends ASTNode { | ||
constructor( value ) { | ||
super(); | ||
this.value = value; | ||
@@ -277,2 +566,4 @@ | ||
this.initialize(); | ||
} | ||
@@ -282,6 +573,8 @@ | ||
export class AccessorElements { | ||
export class AccessorElements extends ASTNode { | ||
constructor( object, elements = [] ) { | ||
super(); | ||
this.object = object; | ||
@@ -292,2 +585,4 @@ this.elements = elements; | ||
this.initialize(); | ||
} | ||
@@ -297,16 +592,72 @@ | ||
export class For { | ||
export class For extends ASTNode { | ||
constructor( initialization, condition, afterthought ) { | ||
constructor( initialization, condition, afterthought, body = [] ) { | ||
super(); | ||
this.initialization = initialization; | ||
this.condition = condition; | ||
this.afterthought = afterthought; | ||
this.body = body; | ||
this.body = []; | ||
this.isFor = true; | ||
this.initialize(); | ||
} | ||
} | ||
export class While extends ASTNode { | ||
constructor( condition, body = [] ) { | ||
super(); | ||
this.condition = condition; | ||
this.body = body; | ||
this.isWhile = true; | ||
this.initialize(); | ||
} | ||
} | ||
export class Switch extends ASTNode { | ||
constructor( discriminant, cases ) { | ||
super(); | ||
this.discriminant = discriminant; | ||
this.cases = cases; | ||
this.isSwitch = true; | ||
this.initialize(); | ||
} | ||
} | ||
export class SwitchCase extends ASTNode { | ||
constructor( body, conditions = null ) { | ||
super(); | ||
this.body = body; | ||
this.conditions = conditions; | ||
this.isDefault = conditions === null ? true : false; | ||
this.isSwitchCase = true; | ||
this.initialize(); | ||
} | ||
} |
@@ -1,3 +0,5 @@ | ||
import { Program, FunctionDeclaration, For, AccessorElements, Ternary, Varying, DynamicElement, StaticElement, FunctionParameter, Unary, Conditional, VariableDeclaration, Operator, Number, String, FunctionCall, Return, Accessor, Uniform, Discard } from './AST.js'; | ||
import { Program, FunctionDeclaration, Switch, For, AccessorElements, Ternary, Varying, DynamicElement, StaticElement, FunctionParameter, Unary, Conditional, VariableDeclaration, Operator, Number, String, FunctionCall, Return, Accessor, Uniform, Discard, SwitchCase, Continue, Break, While, Comment } from './AST.js'; | ||
import { isType } from './TranspilerUtils.js'; | ||
const unaryOperators = [ | ||
@@ -7,2 +9,6 @@ '+', '-', '~', '!', '++', '--' | ||
const arithmeticOperators = [ | ||
'*', '/', '%', '+', '-', '<<', '>>' | ||
]; | ||
const precedenceOperators = [ | ||
@@ -45,3 +51,3 @@ '*', '/', '%', | ||
const commentRegExp = /^\/\*[\s\S]*?\*\//; | ||
const inlineCommentRegExp = /^\/\/.*?(\n|$)/; | ||
const inlineCommentRegExp = /^\/\/.*?(?=\n|$)/; | ||
@@ -85,4 +91,6 @@ const numberRegExp = /^((0x\w+)|(\.?\d+\.?\d*((e-?\d+)|\w)?))/; | ||
this.tag = null; | ||
this.isTag = false; | ||
this.tags = null; | ||
} | ||
@@ -195,3 +203,3 @@ | ||
readToken() { | ||
nextToken() { | ||
@@ -208,25 +216,38 @@ const remainingCode = this.skip( spaceRegExp ); | ||
const token = new Token( this, parser.type, result[ parser.group || 0 ], this.position ); | ||
token.isTag = parser.isTag; | ||
this.position += result[ 0 ].length; | ||
if ( parser.isTag ) { | ||
return token; | ||
const nextToken = this.readToken(); | ||
} | ||
if ( nextToken ) { | ||
} | ||
nextToken.tag = token; | ||
} | ||
} | ||
readToken() { | ||
return nextToken; | ||
let token = this.nextToken(); | ||
} | ||
if ( token && token.isTag ) { | ||
return token; | ||
const tags = []; | ||
while ( token.isTag ) { | ||
tags.push( token ); | ||
token = this.nextToken(); | ||
if ( ! token ) return; | ||
} | ||
token.tags = tags; | ||
} | ||
return token; | ||
} | ||
@@ -236,4 +257,2 @@ | ||
const isType = ( str ) => /void|bool|float|u?int|mat[234]|mat[234]x[234]|(u|i|b)?vec[234]/.test( str ); | ||
class GLSLDecoder { | ||
@@ -247,4 +266,2 @@ | ||
this._currentFunction = null; | ||
this.addPolyfill( 'gl_FragCoord', 'vec3 gl_FragCoord = vec3( screenCoordinate.x, screenCoordinate.y.oneMinus(), screenCoordinate.z );' ); | ||
@@ -337,2 +354,9 @@ | ||
// important for negate operator after arithmetic operator: a * -1, a * -( b ) | ||
if ( inverse && arithmeticOperators.includes( tokens[ i - 1 ].str ) ) { | ||
return; | ||
} | ||
if ( groupIndex === 0 && token.str === operator ) { | ||
@@ -357,3 +381,3 @@ | ||
return this._evalOperator( new Operator( operator, left, right ) ); | ||
return new Operator( operator, left, right ); | ||
@@ -459,3 +483,3 @@ } | ||
return this._evalOperator( new Operator( operator.str, left, right ) ); | ||
return new Operator( operator.str, left, right ); | ||
@@ -505,2 +529,10 @@ } | ||
} else if ( firstToken.str === 'continue' ) { | ||
return new Continue(); | ||
} else if ( firstToken.str === 'break' ) { | ||
return new Break(); | ||
} | ||
@@ -671,11 +703,6 @@ | ||
const params = this.parseFunctionParams( paramsTokens.slice( 1, paramsTokens.length - 1 ) ); | ||
const body = this.parseBlock(); | ||
const func = new FunctionDeclaration( type, name, params ); | ||
const func = new FunctionDeclaration( type, name, params, body ); | ||
this._currentFunction = func; | ||
this.parseBlock( func ); | ||
this._currentFunction = null; | ||
return func; | ||
@@ -775,2 +802,27 @@ | ||
parseWhile() { | ||
this.readToken(); // skip 'while' | ||
const conditionTokens = this.readTokensUntil( ')' ).slice( 1, - 1 ); | ||
const condition = this.parseExpressionFromTokens( conditionTokens ); | ||
let body; | ||
if ( this.getToken().str === '{' ) { | ||
body = this.parseBlock(); | ||
} else { | ||
body = [ this.parseExpression() ]; | ||
} | ||
const statement = new While( condition, body ); | ||
return statement; | ||
} | ||
parseFor() { | ||
@@ -801,14 +853,16 @@ | ||
const statement = new For( initialization, condition, afterthought ); | ||
let body; | ||
if ( this.getToken().str === '{' ) { | ||
this.parseBlock( statement ); | ||
body = this.parseBlock(); | ||
} else { | ||
statement.body.push( this.parseExpression() ); | ||
body = [ this.parseExpression() ]; | ||
} | ||
const statement = new For( initialization, condition, afterthought, body ); | ||
return statement; | ||
@@ -818,2 +872,78 @@ | ||
parseSwitch() { | ||
this.readToken(); // Skip 'switch' | ||
const switchDeterminantTokens = this.readTokensUntil( ')' ); | ||
// Parse expresison between parentheses. Index 1: char after '('. Index -1: char before ')' | ||
const discriminant = this.parseExpressionFromTokens( switchDeterminantTokens.slice( 1, - 1 ) ); | ||
// Validate curly braces | ||
if ( this.getToken().str !== '{' ) { | ||
throw new Error( 'Expected \'{\' after switch(...) ' ); | ||
} | ||
this.readToken(); // Skip '{' | ||
const cases = this.parseSwitchCases(); | ||
const switchStatement = new Switch( discriminant, cases ); | ||
return switchStatement; | ||
} | ||
parseSwitchCases() { | ||
const cases = []; | ||
let token = this.getToken(); | ||
let conditions = null; | ||
const isCase = ( token ) => token.str === 'case' || token.str === 'default'; | ||
while ( isCase( token ) ) { | ||
this.readToken(); // Skip 'case' or 'default' | ||
if ( token.str === 'case' ) { | ||
const caseTokens = this.readTokensUntil( ':' ); | ||
const caseStatement = this.parseExpressionFromTokens( caseTokens.slice( 0, - 1 ) ); | ||
conditions = conditions || []; | ||
conditions.push( caseStatement ); | ||
} else { | ||
this.readTokensUntil( ':' ); // Skip 'default:' | ||
conditions = null; | ||
} | ||
token = this.getToken(); | ||
if ( isCase( token ) ) { | ||
// If the next token is another case/default, continue parsing | ||
continue; | ||
} | ||
cases.push( new SwitchCase( this.parseBlock(), conditions ) ); | ||
token = this.getToken(); | ||
conditions = null; | ||
} | ||
return cases; | ||
} | ||
parseIf() { | ||
@@ -831,14 +961,18 @@ | ||
const parseIfBlock = ( cond ) => { | ||
const parseIfBlock = () => { | ||
let body; | ||
if ( this.getToken().str === '{' ) { | ||
this.parseBlock( cond ); | ||
body = this.parseBlock(); | ||
} else { | ||
cond.body.push( this.parseExpression() ); | ||
body = [ this.parseExpression() ]; | ||
} | ||
return body; | ||
}; | ||
@@ -848,6 +982,5 @@ | ||
const conditional = new Conditional( parseIfExpression() ); | ||
// Parse the first if statement | ||
const conditional = new Conditional( parseIfExpression(), parseIfBlock() ); | ||
parseIfBlock( conditional ); | ||
// | ||
@@ -861,18 +994,21 @@ | ||
// Assign the current if/else statement as the previous within the chain of conditionals | ||
const previous = current; | ||
let expression = null; | ||
// If an 'else if' statement, parse the conditional within the if | ||
if ( this.getToken().str === 'if' ) { | ||
current = new Conditional( parseIfExpression() ); | ||
// Current conditional now equal to next conditional in the chain | ||
expression = parseIfExpression(); | ||
} else { | ||
} | ||
current = new Conditional(); | ||
current = new Conditional( expression, parseIfBlock() ); | ||
current.parent = previous; | ||
} | ||
// n - 1 conditional's else statement assigned to new if/else statement | ||
previous.elseConditional = current; | ||
parseIfBlock( current ); | ||
} | ||
@@ -884,4 +1020,6 @@ | ||
parseBlock( scope ) { | ||
parseBlock() { | ||
const body = []; | ||
const firstToken = this.getToken(); | ||
@@ -905,7 +1043,11 @@ | ||
if ( groupIndex < 0 ) { | ||
if ( groupIndex === 0 && ( token.str === 'case' || token.str === 'default' ) ) { | ||
return body; // switch case or default statement, return body | ||
} else if ( groupIndex < 0 ) { | ||
this.readToken(); // skip '}' | ||
break; | ||
return body; | ||
@@ -916,2 +1058,29 @@ } | ||
if ( token.tags ) { | ||
let lastStatement = null; | ||
for ( const tag of token.tags ) { | ||
if ( tag.type === Token.COMMENT ) { | ||
const str = tag.str.replace( /\t/g, '' ); | ||
if ( ! lastStatement || lastStatement.isComment !== true ) { | ||
lastStatement = new Comment( str ); | ||
body.push( lastStatement ); | ||
} else { | ||
lastStatement.comment += '\n' + str; | ||
} | ||
} | ||
} | ||
} | ||
if ( token.isLiteral || token.isOperator ) { | ||
@@ -955,2 +1124,10 @@ | ||
} else if ( token.str === 'while' ) { | ||
statement = this.parseWhile(); | ||
} else if ( token.str === 'switch' ) { | ||
statement = this.parseSwitch(); | ||
} else { | ||
@@ -966,3 +1143,3 @@ | ||
scope.body.push( statement ); | ||
body.push( statement ); | ||
@@ -977,42 +1154,6 @@ } else { | ||
} | ||
return body; | ||
_evalOperator( operator ) { | ||
if ( operator.type.includes( '=' ) ) { | ||
const parameter = this._getFunctionParameter( operator.left.property ); | ||
if ( parameter !== undefined ) { | ||
// Parameters are immutable in WGSL | ||
parameter.immutable = false; | ||
} | ||
} | ||
return operator; | ||
} | ||
_getFunctionParameter( name ) { | ||
if ( this._currentFunction ) { | ||
for ( const param of this._currentFunction.params ) { | ||
if ( param.name === name ) { | ||
return param; | ||
} | ||
} | ||
} | ||
} | ||
parse( source ) { | ||
@@ -1041,6 +1182,5 @@ | ||
const program = new Program(); | ||
const body = this.parseBlock(); | ||
const program = new Program( body ); | ||
this.parseBlock( program ); | ||
return program; | ||
@@ -1047,0 +1187,0 @@ |
@@ -0,1 +1,3 @@ | ||
import Linker from './Linker.js'; | ||
/** | ||
@@ -35,2 +37,11 @@ * A class that transpiles shader code from one language into another. | ||
/** | ||
* The linker. It processes the AST and resolves | ||
* variable and function references, ensuring that all | ||
* dependencies are properly linked. | ||
* | ||
* @type {Linker} | ||
*/ | ||
this.linker = new Linker(); | ||
} | ||
@@ -46,4 +57,9 @@ | ||
return this.encoder.emit( this.decoder.parse( source ) ); | ||
const ast = this.decoder.parse( source ); | ||
// Process the AST to resolve variable and function references and optimizations. | ||
this.linker.process( ast ); | ||
return this.encoder.emit( ast ); | ||
} | ||
@@ -50,0 +66,0 @@ |
@@ -5,2 +5,3 @@ import { REVISION } from 'three/webgpu'; | ||
import { VariableDeclaration, Accessor } from './AST.js'; | ||
import { isExpression, isPrimitive } from './TranspilerUtils.js'; | ||
@@ -51,4 +52,2 @@ const opLib = { | ||
const isPrimitive = ( value ) => /^(true|false|-?(\d|\.\d))/.test( value ); | ||
class TSLEncoder { | ||
@@ -63,10 +62,6 @@ | ||
this.iife = false; | ||
this.uniqueNames = false; | ||
this.reference = false; | ||
this._currentVariable = null; | ||
this.block = null; | ||
this._currentProperties = {}; | ||
this._lastStatement = null; | ||
} | ||
@@ -80,3 +75,3 @@ | ||
if ( TSL[ name ] !== undefined && this.global.has( name ) === false && this._currentProperties[ name ] === undefined ) { | ||
if ( TSL[ name ] !== undefined && this.global.has( name ) === false ) { | ||
@@ -139,3 +134,3 @@ this.imports.add( name ); | ||
emitExpression( node ) { | ||
emitExpression( node, output = null ) { | ||
@@ -146,4 +141,8 @@ let code; | ||
this.addImport( node.property ); | ||
if ( node.linker.reference === null ) { | ||
this.addImport( node.property ); | ||
} | ||
code = node.property; | ||
@@ -153,14 +152,4 @@ | ||
if ( node.type === 'int' || node.type === 'uint' ) { | ||
code = node.value; | ||
code = node.type + '( ' + node.value + ' )'; | ||
this.addImport( node.type ); | ||
} else { | ||
code = node.value; | ||
} | ||
} else if ( node.isString ) { | ||
@@ -174,6 +163,6 @@ | ||
const left = this.emitExpression( node.left ); | ||
const right = this.emitExpression( node.right ); | ||
const left = this.emitExpression( node.left, output ); | ||
const right = this.emitExpression( node.right, output ); | ||
if ( isPrimitive( left ) && isPrimitive( right ) ) { | ||
if ( node.isNumericExpression ) { | ||
@@ -264,2 +253,14 @@ return left + ' ' + node.type + ' ' + right; | ||
} else if ( node.isBreak ) { | ||
this.addImport( 'Break' ); | ||
code = 'Break()'; | ||
} else if ( node.isContinue ) { | ||
this.addImport( 'Continue' ); | ||
code = 'Continue()'; | ||
} else if ( node.isAccessorElements ) { | ||
@@ -305,2 +306,10 @@ | ||
} else if ( node.isWhile ) { | ||
code = this.emitWhile( node ); | ||
} else if ( node.isSwitch ) { | ||
code = this.emitSwitch( node ); | ||
} else if ( node.isVariableDeclaration ) { | ||
@@ -326,23 +335,20 @@ | ||
} else if ( node.isUnary && node.expression.isNumber ) { | ||
} else if ( node.isUnary && node.expression.isNumber && node.type === '-' ) { | ||
code = node.expression.type + '( ' + node.type + ' ' + node.expression.value + ' )'; | ||
code = '- ' + node.expression.value; | ||
this.addImport( node.expression.type ); | ||
if ( node.expression.type !== 'float' ) { | ||
} else if ( node.isUnary ) { | ||
code = node.expression.type + '( ' + code + ' )'; | ||
let type = unaryLib[ node.type ]; | ||
this.addImport( node.expression.type ); | ||
if ( node.type === '++' || node.type === '--' ) { | ||
} | ||
if ( this._currentVariable === null ) { | ||
} else if ( node.isUnary ) { | ||
// optimize increment/decrement operator | ||
// to avoid creating a new variable | ||
let type = unaryLib[ node.type ]; | ||
node.after = false; | ||
if ( node.hasAssignment ) { | ||
} | ||
if ( node.after === false ) { | ||
@@ -384,4 +390,2 @@ | ||
this.setLastStatement( null ); | ||
let code = ''; | ||
@@ -393,3 +397,18 @@ | ||
code += this.emitExtraLine( statement ); | ||
code += this.emitExtraLine( statement, body ); | ||
if ( statement.isComment ) { | ||
code += this.emitComment( statement, body ); | ||
continue; | ||
} | ||
if ( this.block && this.block.isSwitchCase ) { | ||
if ( statement.isBreak ) continue; // skip break statements in switch cases | ||
} | ||
code += this.tab + this.emitExpression( statement ); | ||
@@ -401,4 +420,2 @@ | ||
this.setLastStatement( statement ); | ||
} | ||
@@ -524,2 +541,59 @@ | ||
emitSwitch( switchNode ) { | ||
const discriminantString = this.emitExpression( switchNode.discriminant ); | ||
this.tab += '\t'; | ||
let switchString = `Switch( ${ discriminantString } )\n${ this.tab }`; | ||
const previousBlock = this.block; | ||
for ( const switchCase of switchNode.cases ) { | ||
this.block = switchCase; | ||
let caseBodyString; | ||
if ( ! switchCase.isDefault ) { | ||
const caseConditions = [ ]; | ||
for ( const condition of switchCase.conditions ) { | ||
caseConditions.push( this.emitExpression( condition ) ); | ||
} | ||
caseBodyString = this.emitBody( switchCase.body ); | ||
switchString += `.Case( ${ caseConditions.join( ', ' ) }, `; | ||
} else { | ||
caseBodyString = this.emitBody( switchCase.body ); | ||
switchString += '.Default( '; | ||
} | ||
switchString += `() => { | ||
${ caseBodyString } | ||
${ this.tab }} )`; | ||
} | ||
this.block = previousBlock; | ||
this.tab = this.tab.slice( 0, - 1 ); | ||
this.imports.add( 'Switch' ); | ||
return switchString; | ||
} | ||
emitFor( node ) { | ||
@@ -572,2 +646,18 @@ | ||
emitWhile( node ) { | ||
const condition = this.emitExpression( node.condition ); | ||
let whileStr = `Loop( ${ condition }, () => {\n\n`; | ||
whileStr += this.emitBody( node.body ) + '\n\n'; | ||
whileStr += this.tab + '} )'; | ||
this.imports.add( 'Loop' ); | ||
return whileStr; | ||
} | ||
emitVariables( node, isRoot = true ) { | ||
@@ -577,6 +667,2 @@ | ||
this._currentVariable = node; | ||
const valueStr = value ? this.emitExpression( value ) : ''; | ||
let varStr = isRoot ? 'const ' : ''; | ||
@@ -587,9 +673,21 @@ varStr += name; | ||
if ( value.isFunctionCall && value.name === type ) { | ||
let valueStr = this.emitExpression( value ); | ||
varStr += ' = ' + valueStr; | ||
if ( value.isNumericExpression ) { | ||
// convert JS primitive to node | ||
valueStr = `${ type }( ${ valueStr } )`; | ||
this.addImport( type ); | ||
} | ||
if ( node.linker.assignments.length > 0 ) { | ||
varStr += ' = ' + valueStr + '.toVar()'; | ||
} else { | ||
varStr += ` = ${ type }( ${ valueStr } )`; | ||
varStr += ' = ' + valueStr; | ||
@@ -600,10 +698,6 @@ } | ||
varStr += ` = ${ type }()`; | ||
varStr += ` = property( '${ type }' )`; | ||
} | ||
this.addImport( 'property' ); | ||
if ( node.immutable === false ) { | ||
varStr += '.toVar()'; | ||
} | ||
@@ -617,6 +711,2 @@ | ||
this.addImport( type ); | ||
this._currentVariable = null; | ||
return varStr; | ||
@@ -645,3 +735,3 @@ | ||
return `${ prefix }const ${ name } = /*#__PURE__*/ overloadingFn( [ ${ nodes.map( node => node.name + '_' + nodes.indexOf( node ) ).join( ', ' ) } ] );\n`; | ||
return `${ prefix }const ${ name } = /*@__PURE__*/ overloadingFn( [ ${ nodes.map( node => node.name + '_' + nodes.indexOf( node ) ).join( ', ' ) } ] );\n`; | ||
@@ -654,4 +744,2 @@ } | ||
this._currentProperties = { name: node }; | ||
const params = []; | ||
@@ -665,7 +753,5 @@ const inputs = []; | ||
let str = `{ name: '${ param.name }', type: '${ param.type }'`; | ||
let name = param.name; | ||
if ( param.immutable === false && ( param.qualifier !== 'inout' && param.qualifier !== 'out' ) ) { | ||
if ( param.linker.assignments.length > 0 ) { | ||
@@ -686,11 +772,7 @@ name = name + '_immutable'; | ||
str += ', qualifier: \'' + param.qualifier + '\''; | ||
} | ||
inputs.push( str + ' }' ); | ||
inputs.push( param.name + ': \'' + param.type + '\'' ); | ||
params.push( name ); | ||
this._currentProperties[ name ] = param; | ||
} | ||
@@ -700,4 +782,8 @@ | ||
node.body.unshift( new VariableDeclaration( param.type, param.name, new Accessor( param.name + '_immutable' ) ) ); | ||
const mutableParam = new VariableDeclaration( param.type, param.name, new Accessor( param.name + '_immutable' ), null, true ); | ||
mutableParam.parent = param.parent; // link to the original node | ||
mutableParam.linker.assignments.push( mutableParam ); | ||
node.body.unshift( mutableParam ); | ||
} | ||
@@ -733,23 +819,15 @@ | ||
let funcStr = `${ prefix }const ${ fnName } = /*#__PURE__*/ Fn( (${ paramsStr }) => { | ||
let funcStr = `${ prefix }const ${ fnName } = /*@__PURE__*/ Fn( (${ paramsStr }) => { | ||
${ bodyStr } | ||
${ this.tab }} )`; | ||
${ this.tab }}`; | ||
const layoutInput = inputs.length > 0 ? '\n\t\t' + this.tab + inputs.join( ',\n\t\t' + this.tab ) + '\n\t' + this.tab : ''; | ||
if ( node.layout !== false && hasPointer === false ) { | ||
const uniqueName = this.uniqueNames ? fnName + '_' + Math.random().toString( 36 ).slice( 2 ) : fnName; | ||
funcStr += ', { ' + inputs.join( ', ' ) + ', return: \'' + type + '\' }'; | ||
funcStr += `.setLayout( { | ||
${ this.tab }\tname: '${ uniqueName }', | ||
${ this.tab }\ttype: '${ type }', | ||
${ this.tab }\tinputs: [${ layoutInput }] | ||
${ this.tab }} )`; | ||
} | ||
funcStr += ';\n'; | ||
funcStr += ' );\n'; | ||
@@ -770,17 +848,38 @@ this.imports.add( 'Fn' ); | ||
setLastStatement( statement ) { | ||
emitComment( statement, body ) { | ||
this._lastStatement = statement; | ||
const index = body.indexOf( statement ); | ||
const previous = body[ index - 1 ]; | ||
const next = body[ index + 1 ]; | ||
let output = ''; | ||
if ( previous && isExpression( previous ) ) { | ||
output += '\n'; | ||
} | ||
output += this.tab + statement.comment.replace( /\n/g, '\n' + this.tab ) + '\n'; | ||
if ( next && isExpression( next ) ) { | ||
output += '\n'; | ||
} | ||
return output; | ||
} | ||
emitExtraLine( statement ) { | ||
emitExtraLine( statement, body ) { | ||
const last = this._lastStatement; | ||
if ( last === null ) return ''; | ||
const index = body.indexOf( statement ); | ||
const previous = body[ index - 1 ]; | ||
if ( previous === undefined ) return ''; | ||
if ( statement.isReturn ) return '\n'; | ||
const isExpression = ( st ) => st.isFunctionDeclaration !== true && st.isFor !== true && st.isConditional !== true; | ||
const lastExp = isExpression( last ); | ||
const lastExp = isExpression( previous ); | ||
const currExp = isExpression( statement ); | ||
@@ -820,4 +919,12 @@ | ||
code += this.emitExtraLine( statement ); | ||
code += this.emitExtraLine( statement, ast.body ); | ||
if ( statement.isComment ) { | ||
code += this.emitComment( statement, ast.body ); | ||
continue; | ||
} | ||
if ( statement.isFunctionDeclaration ) { | ||
@@ -833,4 +940,2 @@ | ||
this.setLastStatement( statement ); | ||
} | ||
@@ -837,0 +942,0 @@ |
import { RenderTarget, Vector2, NodeMaterial, RendererUtils, QuadMesh, TempNode, NodeUpdateType } from 'three/webgpu'; | ||
import { nodeObject, Fn, float, uv, uniform, convertToTexture, vec2, vec4, passTexture, mul, premult, unpremult } from 'three/tsl'; | ||
import { nodeObject, Fn, float, uv, uniform, convertToTexture, vec2, vec4, passTexture, mul, premultiplyAlpha, unpremultiplyAlpha } from 'three/tsl'; | ||
@@ -252,4 +252,4 @@ const _quadMesh = /*@__PURE__*/ new QuadMesh(); | ||
sampleTexture = ( uv ) => premult( textureNode.sample( uv ) ); | ||
output = ( color ) => unpremult( color ); | ||
sampleTexture = ( uv ) => premultiplyAlpha( textureNode.sample( uv ) ); | ||
output = ( color ) => unpremultiplyAlpha( color ); | ||
@@ -256,0 +256,0 @@ } else { |
@@ -1,2 +0,2 @@ | ||
import { float, Fn, vec2, uv, sin, rand, degrees, cos, Loop, vec4, premult, unpremult } from 'three/tsl'; | ||
import { float, Fn, vec2, uv, sin, rand, degrees, cos, Loop, vec4, premultiplyAlpha, unpremultiplyAlpha } from 'three/tsl'; | ||
@@ -37,3 +37,3 @@ /** | ||
return premultipliedAlpha ? premult( sample ) : sample; | ||
return premultipliedAlpha ? premultiplyAlpha( sample ) : sample; | ||
@@ -55,4 +55,4 @@ }; | ||
return premultipliedAlpha ? unpremult( blurred_image ) : blurred_image; | ||
return premultipliedAlpha ? unpremultiplyAlpha( blurred_image ) : blurred_image; | ||
} ); |
import { AdditiveBlending, Color, Vector2, RendererUtils, PassNode, QuadMesh, NodeMaterial } from 'three/webgpu'; | ||
import { nodeObject, uniform, mrt, texture, getTextureIndex } from 'three/tsl'; | ||
import { nodeObject, uniform, mrt, texture, getTextureIndex, unpremultiplyAlpha } from 'three/tsl'; | ||
@@ -280,3 +280,3 @@ const _size = /*@__PURE__*/ new Vector2(); | ||
this._quadMesh.material = new NodeMaterial(); | ||
this._quadMesh.material.fragmentNode = sampleTexture; | ||
this._quadMesh.material.fragmentNode = unpremultiplyAlpha( sampleTexture ); | ||
this._quadMesh.material.transparent = true; | ||
@@ -283,0 +283,0 @@ this._quadMesh.material.depthTest = false; |
{ | ||
"name": "three", | ||
"version": "0.177.0", | ||
"version": "0.178.0", | ||
"description": "JavaScript 3D library", | ||
@@ -5,0 +5,0 @@ "type": "module", |
@@ -1,2 +0,2 @@ | ||
export const REVISION = '177'; | ||
export const REVISION = '178'; | ||
@@ -1615,4 +1615,4 @@ /** | ||
SAMPLE: 'sample', | ||
FLAT_FIRST: 'flat first', | ||
FLAT_EITHER: 'flat either' | ||
FIRST: 'first', | ||
EITHER: 'either' | ||
}; | ||
@@ -1619,0 +1619,0 @@ |
@@ -91,3 +91,3 @@ import { Vector3 } from '../math/Vector3.js'; | ||
* the values in the GLSL code. For instance, if `array` is an instance of `UInt16Array`, | ||
* and `normalized` is `true`, the values `0 -+65535` in the array data will be mapped to | ||
* and `normalized` is `true`, the values `0 - +65535` in the array data will be mapped to | ||
* `0.0f - +1.0f` in the GLSL attribute. If `normalized` is `false`, the values will be converted | ||
@@ -845,4 +845,4 @@ * to floats unmodified, i.e. `65535` becomes `65535.0f`. | ||
* | ||
* This class automatically converts to and from FP16 since `Float16Array` is not | ||
* natively supported in JavaScript. | ||
* This class automatically converts to and from FP16 via `Uint16Array` since `Float16Array` | ||
* browser support is still problematic. | ||
* | ||
@@ -849,0 +849,0 @@ * @augments BufferAttribute |
@@ -64,3 +64,3 @@ /** | ||
this.startTime = now(); | ||
this.startTime = performance.now(); | ||
@@ -114,3 +114,3 @@ this.oldTime = this.startTime; | ||
const newTime = now(); | ||
const newTime = performance.now(); | ||
@@ -130,8 +130,2 @@ diff = ( newTime - this.oldTime ) / 1000; | ||
function now() { | ||
return performance.now(); | ||
} | ||
export { Clock }; |
@@ -22,4 +22,5 @@ /** | ||
* @param {number} count - The expected number of vertices in VBO. | ||
* @param {boolean} [normalized=false] - Whether the data are normalized or not. | ||
*/ | ||
constructor( buffer, type, itemSize, elementSize, count ) { | ||
constructor( buffer, type, itemSize, elementSize, count, normalized = false ) { | ||
@@ -78,2 +79,13 @@ /** | ||
/** | ||
* Applies to integer data only. Indicates how the underlying data in the buffer maps to | ||
* the values in the GLSL code. For instance, if `buffer` contains data of `gl.UNSIGNED_SHORT`, | ||
* and `normalized` is `true`, the values `0 - +65535` in the buffer data will be mapped to | ||
* `0.0f - +1.0f` in the GLSL attribute. If `normalized` is `false`, the values will be converted | ||
* to floats unmodified, i.e. `65535` becomes `65535.0f`. | ||
* | ||
* @type {boolean} | ||
*/ | ||
this.normalized = normalized; | ||
/** | ||
* A version number, incremented every time the `needsUpdate` is set to `true`. | ||
@@ -80,0 +92,0 @@ * |
@@ -50,3 +50,3 @@ import { Quaternion } from '../math/Quaternion.js'; | ||
/** | ||
* Fires when a new child object has been added. | ||
* Fires when a child object has been removed. | ||
* | ||
@@ -53,0 +53,0 @@ * @event Object3D#childremoved |
@@ -193,7 +193,7 @@ import { Vector2 } from '../../math/Vector2.js'; | ||
* | ||
* @param {number} aX - The x coordinate of the center of the arc offsetted from the previous curve. | ||
* @param {number} aY - The y coordinate of the center of the arc offsetted from the previous curve. | ||
* @param {number} aRadius - The radius of the arc. | ||
* @param {number} aStartAngle - The start angle in radians. | ||
* @param {number} aEndAngle - The end angle in radians. | ||
* @param {number} [aX=0] - The x coordinate of the center of the arc offsetted from the previous curve. | ||
* @param {number} [aY=0] - The y coordinate of the center of the arc offsetted from the previous curve. | ||
* @param {number} [aRadius=1] - The radius of the arc. | ||
* @param {number} [aStartAngle=0] - The start angle in radians. | ||
* @param {number} [aEndAngle=Math.PI*2] - The end angle in radians. | ||
* @param {boolean} [aClockwise=false] - Whether to sweep the arc clockwise or not. | ||
@@ -217,7 +217,7 @@ * @return {Path} A reference to this path. | ||
* | ||
* @param {number} aX - The x coordinate of the center of the arc. | ||
* @param {number} aY - The y coordinate of the center of the arc. | ||
* @param {number} aRadius - The radius of the arc. | ||
* @param {number} aStartAngle - The start angle in radians. | ||
* @param {number} aEndAngle - The end angle in radians. | ||
* @param {number} [aX=0] - The x coordinate of the center of the arc. | ||
* @param {number} [aY=0] - The y coordinate of the center of the arc. | ||
* @param {number} [aRadius=1] - The radius of the arc. | ||
* @param {number} [aStartAngle=0] - The start angle in radians. | ||
* @param {number} [aEndAngle=Math.PI*2] - The end angle in radians. | ||
* @param {boolean} [aClockwise=false] - Whether to sweep the arc clockwise or not. | ||
@@ -238,8 +238,8 @@ * @return {Path} A reference to this path. | ||
* | ||
* @param {number} aX - The x coordinate of the center of the ellipse offsetted from the previous curve. | ||
* @param {number} aY - The y coordinate of the center of the ellipse offsetted from the previous curve. | ||
* @param {number} xRadius - The radius of the ellipse in the x axis. | ||
* @param {number} yRadius - The radius of the ellipse in the y axis. | ||
* @param {number} aStartAngle - The start angle in radians. | ||
* @param {number} aEndAngle - The end angle in radians. | ||
* @param {number} [aX=0] - The x coordinate of the center of the ellipse offsetted from the previous curve. | ||
* @param {number} [aY=0] - The y coordinate of the center of the ellipse offsetted from the previous curve. | ||
* @param {number} [xRadius=1] - The radius of the ellipse in the x axis. | ||
* @param {number} [yRadius=1] - The radius of the ellipse in the y axis. | ||
* @param {number} [aStartAngle=0] - The start angle in radians. | ||
* @param {number} [aEndAngle=Math.PI*2] - The end angle in radians. | ||
* @param {boolean} [aClockwise=false] - Whether to sweep the ellipse clockwise or not. | ||
@@ -263,8 +263,8 @@ * @param {number} [aRotation=0] - The rotation angle of the ellipse in radians, counterclockwise from the positive X axis. | ||
* | ||
* @param {number} aX - The x coordinate of the absolute center of the ellipse. | ||
* @param {number} aY - The y coordinate of the absolute center of the ellipse. | ||
* @param {number} xRadius - The radius of the ellipse in the x axis. | ||
* @param {number} yRadius - The radius of the ellipse in the y axis. | ||
* @param {number} aStartAngle - The start angle in radians. | ||
* @param {number} aEndAngle - The end angle in radians. | ||
* @param {number} [aX=0] - The x coordinate of the absolute center of the ellipse. | ||
* @param {number} [aY=0] - The y coordinate of the absolute center of the ellipse. | ||
* @param {number} [xRadius=1] - The radius of the ellipse in the x axis. | ||
* @param {number} [yRadius=1] - The radius of the ellipse in the y axis. | ||
* @param {number} [aStartAngle=0] - The start angle in radians. | ||
* @param {number} [aEndAngle=Math.PI*2] - The end angle in radians. | ||
* @param {boolean} [aClockwise=false] - Whether to sweep the ellipse clockwise or not. | ||
@@ -271,0 +271,0 @@ * @param {number} [aRotation=0] - The rotation angle of the ellipse in radians, counterclockwise from the positive X axis. |
@@ -77,3 +77,3 @@ import { Cache } from './Cache.js'; | ||
const cached = Cache.get( url ); | ||
const cached = Cache.get( `file:${url}` ); | ||
@@ -267,3 +267,3 @@ if ( cached !== undefined ) { | ||
// error response bodies as proper responses to requests. | ||
Cache.add( url, data ); | ||
Cache.add( `file:${url}`, data ); | ||
@@ -270,0 +270,0 @@ const callbacks = loading[ url ]; |
@@ -105,3 +105,3 @@ import { Cache } from './Cache.js'; | ||
const cached = Cache.get( url ); | ||
const cached = Cache.get( `image-bitmap:${url}` ); | ||
@@ -169,3 +169,3 @@ if ( cached !== undefined ) { | ||
Cache.add( url, imageBitmap ); | ||
Cache.add( `image-bitmap:${url}`, imageBitmap ); | ||
@@ -184,3 +184,3 @@ if ( onLoad ) onLoad( imageBitmap ); | ||
Cache.remove( url ); | ||
Cache.remove( `image-bitmap:${url}` ); | ||
@@ -192,3 +192,3 @@ scope.manager.itemError( url ); | ||
Cache.add( url, promise ); | ||
Cache.add( `image-bitmap:${url}`, promise ); | ||
scope.manager.itemStart( url ); | ||
@@ -195,0 +195,0 @@ |
@@ -5,2 +5,4 @@ import { Cache } from './Cache.js'; | ||
const _loading = new WeakMap(); | ||
/** | ||
@@ -52,16 +54,33 @@ * A loader for loading images. The class loads images with the HTML `Image` API. | ||
const cached = Cache.get( url ); | ||
const cached = Cache.get( `image:${url}` ); | ||
if ( cached !== undefined ) { | ||
scope.manager.itemStart( url ); | ||
if ( cached.complete === true ) { | ||
setTimeout( function () { | ||
scope.manager.itemStart( url ); | ||
if ( onLoad ) onLoad( cached ); | ||
setTimeout( function () { | ||
scope.manager.itemEnd( url ); | ||
if ( onLoad ) onLoad( cached ); | ||
}, 0 ); | ||
scope.manager.itemEnd( url ); | ||
}, 0 ); | ||
} else { | ||
let arr = _loading.get( cached ); | ||
if ( arr === undefined ) { | ||
arr = []; | ||
_loading.set( cached, arr ); | ||
} | ||
arr.push( { onLoad, onError } ); | ||
} | ||
return cached; | ||
@@ -77,6 +96,17 @@ | ||
Cache.add( url, this ); | ||
if ( onLoad ) onLoad( this ); | ||
// | ||
const callbacks = _loading.get( this ) || []; | ||
for ( let i = 0; i < callbacks.length; i ++ ) { | ||
const callback = callbacks[ i ]; | ||
if ( callback.onLoad ) callback.onLoad( this ); | ||
} | ||
_loading.delete( this ); | ||
scope.manager.itemEnd( url ); | ||
@@ -92,2 +122,18 @@ | ||
Cache.remove( `image:${url}` ); | ||
// | ||
const callbacks = _loading.get( this ) || []; | ||
for ( let i = 0; i < callbacks.length; i ++ ) { | ||
const callback = callbacks[ i ]; | ||
if ( callback.onError ) callback.onError( event ); | ||
} | ||
_loading.delete( this ); | ||
scope.manager.itemError( url ); | ||
@@ -114,2 +160,3 @@ scope.manager.itemEnd( url ); | ||
Cache.add( `image:${url}`, image ); | ||
scope.manager.itemStart( url ); | ||
@@ -116,0 +163,0 @@ |
@@ -6,4 +6,5 @@ import NodeMaterial from './NodeMaterial.js'; | ||
import BasicLightingModel from '../../nodes/functions/BasicLightingModel.js'; | ||
import { normalView } from '../../nodes/accessors/Normal.js'; | ||
import { normalViewGeometry } from '../../nodes/accessors/Normal.js'; | ||
import { diffuseColor } from '../../nodes/core/PropertyNode.js'; | ||
import { directionToFaceDirection } from '../../nodes/display/FrontFacingNode.js'; | ||
@@ -63,3 +64,3 @@ import { MeshBasicMaterial } from '../MeshBasicMaterial.js'; | ||
* Basic materials are not affected by normal and bump maps so we | ||
* return by default {@link normalView}. | ||
* return by default {@link normalViewGeometry}. | ||
* | ||
@@ -70,3 +71,3 @@ * @return {Node<vec3>} The normal node. | ||
return normalView; // see #28839 | ||
return directionToFaceDirection( normalViewGeometry ); // see #28839 | ||
@@ -73,0 +74,0 @@ } |
@@ -6,3 +6,3 @@ import NodeMaterial from './NodeMaterial.js'; | ||
import { mix } from '../../nodes/math/MathNode.js'; | ||
import { matcapUV } from '../../nodes/utils/MatcapUVNode.js'; | ||
import { matcapUV } from '../../nodes/utils/MatcapUV.js'; | ||
@@ -9,0 +9,0 @@ import { MeshMatcapMaterial } from '../MeshMatcapMaterial.js'; |
@@ -5,3 +5,3 @@ import NodeMaterial from './NodeMaterial.js'; | ||
import { materialOpacity } from '../../nodes/accessors/MaterialNode.js'; | ||
import { transformedNormalView } from '../../nodes/accessors/Normal.js'; | ||
import { normalView } from '../../nodes/accessors/Normal.js'; | ||
import { colorSpaceToWorking } from '../../nodes/display/ColorSpaceNode.js'; | ||
@@ -62,3 +62,3 @@ import { float, vec4 } from '../../nodes/tsl/TSLBase.js'; | ||
diffuseColor.assign( colorSpaceToWorking( vec4( directionToColor( transformedNormalView ), opacityNode ), SRGBColorSpace ) ); | ||
diffuseColor.assign( colorSpaceToWorking( vec4( directionToColor( normalView ), opacityNode ), SRGBColorSpace ) ); | ||
@@ -65,0 +65,0 @@ } |
@@ -9,2 +9,3 @@ import { clearcoat, clearcoatRoughness, sheen, sheenRoughness, iridescence, iridescenceIOR, iridescenceThickness, specularColor, specularF90, diffuseColor, metalness, roughness, anisotropy, alphaT, anisotropyT, anisotropyB, ior, transmission, thickness, attenuationDistance, attenuationColor, dispersion } from '../../nodes/core/PropertyNode.js'; | ||
import { mix, pow2, min } from '../../nodes/math/MathNode.js'; | ||
import { subBuild } from '../../nodes/core/SubBuildNode.js'; | ||
@@ -482,3 +483,3 @@ import { MeshPhysicalMaterial } from '../MeshPhysicalMaterial.js'; | ||
builder.context.setupClearcoatNormal = () => this.setupClearcoatNormal( builder ); | ||
builder.context.setupClearcoatNormal = () => subBuild( this.setupClearcoatNormal( builder ), 'NORMAL', 'vec3' ); | ||
@@ -485,0 +486,0 @@ super.setup( builder ); |
import MeshPhysicalNodeMaterial from './MeshPhysicalNodeMaterial.js'; | ||
import PhysicalLightingModel from '../../nodes/functions/PhysicalLightingModel.js'; | ||
import { transformedNormalView } from '../../nodes/accessors/Normal.js'; | ||
import { normalView } from '../../nodes/accessors/Normal.js'; | ||
import { positionViewDirection } from '../../nodes/accessors/Position.js'; | ||
@@ -55,3 +55,3 @@ import { float, vec3 } from '../../nodes/tsl/TSLBase.js'; | ||
const scatteringHalf = lightDirection.add( transformedNormalView.mul( thicknessDistortionNode ) ).normalize(); | ||
const scatteringHalf = lightDirection.add( normalView.mul( thicknessDistortionNode ) ).normalize(); | ||
const scatteringDot = float( positionViewDirection.dot( scatteringHalf.negate() ).saturate().pow( thicknessPowerNode ).mul( thicknessScaleNode ) ); | ||
@@ -58,0 +58,0 @@ const scatteringIllu = vec3( scatteringDot.add( thicknessAmbientNode ).mul( thicknessColorNode ) ); |
@@ -16,3 +16,3 @@ import { Material } from '../Material.js'; | ||
import { mix } from '../../nodes/math/MathNode.js'; | ||
import { namespace, float, vec3, vec4, bool } from '../../nodes/tsl/TSLBase.js'; | ||
import { float, vec3, vec4, bool } from '../../nodes/tsl/TSLBase.js'; | ||
import AONode from '../../nodes/lighting/AONode.js'; | ||
@@ -28,2 +28,4 @@ import { lightingContext } from '../../nodes/lighting/LightingContextNode.js'; | ||
import { vertexColor } from '../../nodes/accessors/VertexColorNode.js'; | ||
import { premultiplyAlpha } from '../../nodes/display/BlendModes.js'; | ||
import { subBuild } from '../../nodes/core/SubBuildNode.js'; | ||
@@ -449,3 +451,3 @@ /** | ||
builder.context.setupNormal = () => this.setupNormal( builder ); | ||
builder.context.setupNormal = () => subBuild( this.setupNormal( builder ), 'NORMAL', 'vec3' ); | ||
builder.context.setupPositionView = () => this.setupPositionView( builder ); | ||
@@ -461,3 +463,3 @@ builder.context.setupModelViewProjection = () => this.setupModelViewProjection( builder ); | ||
const mvp = this.setupVertex( builder ); | ||
const mvp = subBuild( this.setupVertex( builder ), 'VERTEX' ); | ||
@@ -774,3 +776,3 @@ const vertexNode = this.vertexNode || mvp; | ||
positionLocal.assign( namespace( this.positionNode, 'POSITION' ) ); | ||
positionLocal.assign( subBuild( this.positionNode, 'POSITION', 'vec3' ) ); | ||
@@ -1086,2 +1088,15 @@ } | ||
/** | ||
* Setups premultiplied alpha. | ||
* | ||
* @param {NodeBuilder} builder - The current node builder. | ||
* @param {Node<vec4>} outputNode - The existing output node. | ||
* @return {Node<vec4>} The output node. | ||
*/ | ||
setupPremultipliedAlpha( builder, outputNode ) { | ||
return premultiplyAlpha( outputNode ); | ||
} | ||
/** | ||
* Setups the output node. | ||
@@ -1103,2 +1118,10 @@ * | ||
// PREMULTIPLIED ALPHA | ||
if ( this.premultipliedAlpha === true ) { | ||
outputNode = this.setupPremultipliedAlpha( builder, outputNode ); | ||
} | ||
return outputNode; | ||
@@ -1105,0 +1128,0 @@ |
import { WebGLCoordinateSystem, WebGPUCoordinateSystem } from '../constants.js'; | ||
import { Vector2 } from './Vector2.js'; | ||
import { Vector3 } from './Vector3.js'; | ||
@@ -7,2 +8,3 @@ import { Sphere } from './Sphere.js'; | ||
const _sphere = /*@__PURE__*/ new Sphere(); | ||
const _defaultSpriteCenter = /*@__PURE__*/ new Vector2( 0.5, 0.5 ); | ||
const _vector = /*@__PURE__*/ new Vector3(); | ||
@@ -165,3 +167,6 @@ | ||
_sphere.center.set( 0, 0, 0 ); | ||
_sphere.radius = 0.7071067811865476; | ||
const offset = _defaultSpriteCenter.distanceTo( sprite.center ); | ||
_sphere.radius = 0.7071067811865476 + offset; | ||
_sphere.applyMatrix4( sprite.matrixWorld ); | ||
@@ -168,0 +173,0 @@ |
@@ -485,3 +485,3 @@ import { clamp } from './MathUtils.js'; | ||
if ( r < Number.EPSILON ) { | ||
if ( r < 1e-8 ) { // the epsilon value has been discussed in #31286 | ||
@@ -488,0 +488,0 @@ // vFrom and vTo point in opposite directions |
@@ -0,5 +1,5 @@ | ||
import { normalView } from './Normal.js'; | ||
import { tangentView } from './Tangent.js'; | ||
import { bitangentView } from './Bitangent.js'; | ||
import { normalView, transformedNormalView } from './Normal.js'; | ||
import { tangentView } from './Tangent.js'; | ||
import { mat3 } from '../tsl/TSLBase.js'; | ||
import { Fn, mat3 } from '../tsl/TSLBase.js'; | ||
import { mix } from '../math/MathNode.js'; | ||
@@ -15,3 +15,3 @@ import { anisotropy, anisotropyB, roughness } from '../core/PropertyNode.js'; | ||
*/ | ||
export const TBNViewMatrix = /*@__PURE__*/ mat3( tangentView, bitangentView, normalView ); | ||
export const TBNViewMatrix = /*@__PURE__*/ mat3( tangentView, bitangentView, normalView ).toVar( 'TBNViewMatrix' ); | ||
@@ -44,3 +44,3 @@ /** | ||
*/ | ||
export const transformedBentNormalView = /*@__PURE__*/ ( () => { | ||
export const bentNormalView = /*@__PURE__*/ ( Fn( () => { | ||
@@ -51,7 +51,6 @@ // https://google.github.io/filament/Filament.md.html#lighting/imagebasedlights/anisotropy | ||
bentNormal = bentNormal.cross( anisotropyB ).normalize(); | ||
bentNormal = mix( bentNormal, transformedNormalView, anisotropy.mul( roughness.oneMinus() ).oneMinus().pow2().pow2() ).normalize(); | ||
bentNormal = mix( bentNormal, normalView, anisotropy.mul( roughness.oneMinus() ).oneMinus().pow2().pow2() ).normalize(); | ||
return bentNormal; | ||
} )(); | ||
} ).once() )(); |
@@ -1,6 +0,6 @@ | ||
import { varying } from '../core/VaryingNode.js'; | ||
import { Fn } from '../tsl/TSLCore.js'; | ||
import { cameraViewMatrix } from './Camera.js'; | ||
import { normalGeometry, normalLocal, normalView, normalWorld, transformedNormalView } from './Normal.js'; | ||
import { tangentGeometry, tangentLocal, tangentView, tangentWorld, transformedTangentView } from './Tangent.js'; | ||
import { normalGeometry, normalLocal, normalView, normalWorld } from './Normal.js'; | ||
import { tangentGeometry, tangentLocal, tangentView, tangentWorld } from './Tangent.js'; | ||
import { bitangentViewFrame } from './TangentUtils.js'; | ||
import { directionToFaceDirection } from '../display/FrontFacingNode.js'; | ||
@@ -16,9 +16,9 @@ /** | ||
*/ | ||
const getBitangent = /*@__PURE__*/ Fn( ( [ crossNormalTangent, varyingName ], builder ) => { | ||
const getBitangent = /*@__PURE__*/ Fn( ( [ crossNormalTangent, varyingName ], { subBuildFn, material } ) => { | ||
let bitangent = crossNormalTangent.mul( tangentGeometry.w ).xyz; | ||
if ( builder.material.flatShading !== true ) { | ||
if ( subBuildFn === 'NORMAL' && material.flatShading !== true ) { | ||
bitangent = varying( bitangent, varyingName ); | ||
bitangent = bitangent.toVarying( varyingName ); | ||
@@ -29,3 +29,3 @@ } | ||
} ).once(); | ||
} ).once( [ 'NORMAL' ] ); | ||
@@ -54,4 +54,26 @@ /** | ||
*/ | ||
export const bitangentView = getBitangent( normalView.cross( tangentView ), 'v_bitangentView' ).normalize().toVar( 'bitangentView' ); | ||
export const bitangentView = /*@__PURE__*/ ( Fn( ( { subBuildFn, geometry, material } ) => { | ||
let node; | ||
if ( subBuildFn === 'VERTEX' || geometry.hasAttribute( 'tangent' ) ) { | ||
node = getBitangent( normalView.cross( tangentView ), 'v_bitangentView' ).normalize(); | ||
} else { | ||
node = bitangentViewFrame; | ||
} | ||
if ( material.flatShading !== true ) { | ||
node = directionToFaceDirection( node ); | ||
} | ||
return node; | ||
}, 'vec3' ).once( [ 'NORMAL', 'VERTEX' ] ) )().toVar( 'bitangentView' ); | ||
/** | ||
@@ -64,17 +86,1 @@ * TSL object that represents the vertex bitangent in world space of the current rendered object. | ||
export const bitangentWorld = /*@__PURE__*/ getBitangent( normalWorld.cross( tangentWorld ), 'v_bitangentWorld' ).normalize().toVar( 'bitangentWorld' ); | ||
/** | ||
* TSL object that represents the transformed vertex bitangent in view space of the current rendered object. | ||
* | ||
* @tsl | ||
* @type {Node<vec3>} | ||
*/ | ||
export const transformedBitangentView = /*@__PURE__*/ getBitangent( transformedNormalView.cross( transformedTangentView ), 'v_transformedBitangentView' ).normalize().toVar( 'transformedBitangentView' ); | ||
/** | ||
* TSL object that represents the transformed vertex bitangent in world space of the current rendered object. | ||
* | ||
* @tsl | ||
* @type {Node<vec4>} | ||
*/ | ||
export const transformedBitangentWorld = /*@__PURE__*/ transformedBitangentView.transformDirection( cameraViewMatrix ).normalize().toVar( 'transformedBitangentWorld' ); |
import { attribute } from '../core/AttributeNode.js'; | ||
import { cameraViewMatrix } from './Camera.js'; | ||
import { modelNormalMatrix, modelWorldMatrix } from './ModelNode.js'; | ||
import { mat3, vec3, Fn, varying } from '../tsl/TSLBase.js'; | ||
import { mat3, vec3, Fn } from '../tsl/TSLBase.js'; | ||
import { positionView } from './Position.js'; | ||
import { faceDirection } from '../display/FrontFacingNode.js'; | ||
import { directionToFaceDirection } from '../display/FrontFacingNode.js'; | ||
@@ -50,3 +50,3 @@ /** | ||
*/ | ||
export const normalView = /*@__PURE__*/ ( Fn( ( builder ) => { | ||
export const normalViewGeometry = /*@__PURE__*/ ( Fn( ( builder ) => { | ||
@@ -61,3 +61,3 @@ let node; | ||
node = varying( transformNormalToView( normalLocal ), 'v_normalView' ).normalize(); | ||
node = transformNormalToView( normalLocal ).toVarying( 'v_normalViewGeometry' ).normalize(); | ||
@@ -68,3 +68,3 @@ } | ||
}, 'vec3' ).once() )().toVar( 'normalView' ); | ||
}, 'vec3' ).once() )().toVar( 'normalViewGeometry' ); | ||
@@ -77,15 +77,15 @@ /** | ||
*/ | ||
export const normalWorld = /*@__PURE__*/ ( Fn( ( builder ) => { | ||
export const normalWorldGeometry = /*@__PURE__*/ ( Fn( ( builder ) => { | ||
let normal = normalView.transformDirection( cameraViewMatrix ); | ||
let normal = normalViewGeometry.transformDirection( cameraViewMatrix ); | ||
if ( builder.material.flatShading !== true ) { | ||
normal = varying( normal, 'v_normalWorld' ); | ||
normal = normal.toVarying( 'v_normalWorldGeometry' ); | ||
} | ||
return normal; | ||
return normal.normalize().toVar( 'normalWorldGeometry' ); | ||
}, 'vec3' ).once() )().normalize().toVar( 'normalWorld' ); | ||
}, 'vec3' ).once() )(); | ||
@@ -98,13 +98,27 @@ /** | ||
*/ | ||
export const transformedNormalView = /*@__PURE__*/ ( Fn( ( builder ) => { | ||
export const normalView = /*@__PURE__*/ ( Fn( ( { subBuildFn, material, context } ) => { | ||
// Use getUV context to avoid side effects from nodes overwriting getUV in the context (e.g. EnvironmentNode) | ||
let node; | ||
let node = builder.context.setupNormal().context( { getUV: null } ); | ||
if ( subBuildFn === 'NORMAL' || subBuildFn === 'VERTEX' ) { | ||
if ( builder.material.flatShading !== true ) node = node.mul( faceDirection ); | ||
node = normalViewGeometry; | ||
if ( material.flatShading !== true ) { | ||
node = directionToFaceDirection( node ); | ||
} | ||
} else { | ||
// Use getUV context to avoid side effects from nodes overwriting getUV in the context (e.g. EnvironmentNode) | ||
node = context.setupNormal().context( { getUV: null } ); | ||
} | ||
return node; | ||
}, 'vec3' ).once() )().toVar( 'transformedNormalView' ); | ||
}, 'vec3' ).once( [ 'NORMAL', 'VERTEX' ] ) )().toVar( 'normalView' ); | ||
@@ -117,3 +131,3 @@ /** | ||
*/ | ||
export const transformedNormalWorld = /*@__PURE__*/ transformedNormalView.transformDirection( cameraViewMatrix ).toVar( 'transformedNormalWorld' ); | ||
export const normalWorld = /*@__PURE__*/ normalView.transformDirection( cameraViewMatrix ).toVar( 'normalWorld' ); | ||
@@ -126,13 +140,21 @@ /** | ||
*/ | ||
export const transformedClearcoatNormalView = /*@__PURE__*/ ( Fn( ( builder ) => { | ||
export const clearcoatNormalView = /*@__PURE__*/ ( Fn( ( { subBuildFn, context } ) => { | ||
// Use getUV context to avoid side effects from nodes overwriting getUV in the context (e.g. EnvironmentNode) | ||
let node; | ||
let node = builder.context.setupClearcoatNormal().context( { getUV: null } ); | ||
if ( subBuildFn === 'NORMAL' || subBuildFn === 'VERTEX' ) { | ||
if ( builder.material.flatShading !== true ) node = node.mul( faceDirection ); | ||
node = normalView; | ||
} else { | ||
// Use getUV context to avoid side effects from nodes overwriting getUV in the context (e.g. EnvironmentNode) | ||
node = context.setupClearcoatNormal().context( { getUV: null } ); | ||
} | ||
return node; | ||
}, 'vec3' ).once() )().toVar( 'transformedClearcoatNormalView' ); | ||
}, 'vec3' ).once( [ 'NORMAL', 'VERTEX' ] ) )().toVar( 'clearcoatNormalView' ); | ||
@@ -184,1 +206,45 @@ /** | ||
} ); | ||
// Deprecated | ||
/** | ||
* TSL object that represents the transformed vertex normal in view space of the current rendered object. | ||
* | ||
* @tsl | ||
* @type {Node<vec3>} | ||
* @deprecated since r178. Use `normalView` instead. | ||
*/ | ||
export const transformedNormalView = ( Fn( () => { // @deprecated, r177 | ||
console.warn( 'THREE.TSL: "transformedNormalView" is deprecated. Use "normalView" instead.' ); | ||
return normalView; | ||
} ).once( [ 'NORMAL', 'VERTEX' ] ) )(); | ||
/** | ||
* TSL object that represents the transformed vertex normal in world space of the current rendered object. | ||
* | ||
* @tsl | ||
* @type {Node<vec3>} | ||
* @deprecated since r178. Use `normalWorld` instead. | ||
*/ | ||
export const transformedNormalWorld = ( Fn( () => { // @deprecated, r177 | ||
console.warn( 'THREE.TSL: "transformedNormalWorld" is deprecated. Use "normalWorld" instead.' ); | ||
return normalWorld; | ||
} ).once( [ 'NORMAL', 'VERTEX' ] ) )(); | ||
/** | ||
* TSL object that represents the transformed clearcoat vertex normal in view space of the current rendered object. | ||
* | ||
* @tsl | ||
* @type {Node<vec3>} | ||
* @deprecated since r178. Use `clearcoatNormalView` instead. | ||
*/ | ||
export const transformedClearcoatNormalView = ( Fn( () => { // @deprecated, r177 | ||
console.warn( 'THREE.TSL: "transformedClearcoatNormalView" is deprecated. Use "clearcoatNormalView" instead.' ); | ||
return clearcoatNormalView; | ||
} ).once( [ 'NORMAL', 'VERTEX' ] ) )(); |
@@ -266,4 +266,4 @@ import Node from '../core/Node.js'; | ||
* @param {?Object3D} [object3d] - The 3D object. | ||
* @returns {Object3DNode<vec3>} | ||
* @returns {Object3DNode<float>} | ||
*/ | ||
export const objectRadius = /*@__PURE__*/ nodeProxy( Object3DNode, Object3DNode.RADIUS ).setParameterLength( 1 ); |
@@ -38,5 +38,5 @@ import { attribute } from '../core/AttributeNode.js'; | ||
return modelWorldMatrix.mul( positionLocal ).xyz.toVarying( builder.getNamespace( 'v_positionWorld' ) ); | ||
return modelWorldMatrix.mul( positionLocal ).xyz.toVarying( builder.getSubBuildProperty( 'v_positionWorld' ) ); | ||
}, 'vec3' ).once( 'POSITION' ) )(); | ||
}, 'vec3' ).once( [ 'POSITION' ] ) )(); | ||
@@ -49,9 +49,9 @@ /** | ||
*/ | ||
export const positionWorldDirection = /*@__PURE__*/ ( Fn( ( builder ) => { | ||
export const positionWorldDirection = /*@__PURE__*/ ( Fn( () => { | ||
const vertexPWD = positionLocal.transformDirection( modelWorldMatrix ).toVarying( builder.getNamespace( 'v_positionWorldDirection' ) ); | ||
const vertexPWD = positionLocal.transformDirection( modelWorldMatrix ).toVarying( 'v_positionWorldDirection' ); | ||
return vertexPWD.normalize().toVar( 'positionWorldDirection' ); | ||
}, 'vec3' ).once( 'POSITION' ) )(); | ||
}, 'vec3' ).once( [ 'POSITION' ] ) )(); | ||
@@ -66,5 +66,5 @@ /** | ||
return builder.context.setupPositionView().toVarying( builder.getNamespace( 'v_positionView' ) ); | ||
return builder.context.setupPositionView().toVarying( 'v_positionView' ); | ||
}, 'vec3' ).once( 'POSITION' ) )(); | ||
}, 'vec3' ).once( [ 'POSITION' ] ) )(); | ||
@@ -71,0 +71,0 @@ /** |
import { cameraViewMatrix } from './Camera.js'; | ||
import { transformedNormalView } from './Normal.js'; | ||
import { normalView } from './Normal.js'; | ||
import { positionViewDirection } from './Position.js'; | ||
@@ -12,3 +12,3 @@ import { materialRefractionRatio } from './MaterialProperties.js'; | ||
*/ | ||
export const reflectView = /*@__PURE__*/ positionViewDirection.negate().reflect( transformedNormalView ); | ||
export const reflectView = /*@__PURE__*/ positionViewDirection.negate().reflect( normalView ); | ||
@@ -21,3 +21,3 @@ /** | ||
*/ | ||
export const refractView = /*@__PURE__*/ positionViewDirection.negate().refract( transformedNormalView, materialRefractionRatio ); | ||
export const refractView = /*@__PURE__*/ positionViewDirection.negate().refract( normalView, materialRefractionRatio ); | ||
@@ -24,0 +24,0 @@ /** |
@@ -5,2 +5,4 @@ import { attribute } from '../core/AttributeNode.js'; | ||
import { Fn, vec4 } from '../tsl/TSLBase.js'; | ||
import { tangentViewFrame } from './TangentUtils.js'; | ||
import { directionToFaceDirection } from '../display/FrontFacingNode.js'; | ||
@@ -39,4 +41,26 @@ /** | ||
*/ | ||
export const tangentView = /*@__PURE__*/ modelViewMatrix.mul( vec4( tangentLocal, 0 ) ).xyz.toVarying( 'v_tangentView' ).normalize().toVar( 'tangentView' ); | ||
export const tangentView = /*@__PURE__*/ ( Fn( ( { subBuildFn, geometry, material } ) => { | ||
let node; | ||
if ( subBuildFn === 'VERTEX' || geometry.hasAttribute( 'tangent' ) ) { | ||
node = modelViewMatrix.mul( vec4( tangentLocal, 0 ) ).xyz.toVarying( 'v_tangentView' ).normalize(); | ||
} else { | ||
node = tangentViewFrame; | ||
} | ||
if ( material.flatShading !== true ) { | ||
node = directionToFaceDirection( node ); | ||
} | ||
return node; | ||
}, 'vec3' ).once( [ 'NORMAL', 'VERTEX' ] ) )().toVar( 'tangentView' ); | ||
/** | ||
@@ -49,17 +73,1 @@ * TSL object that represents the vertex tangent in world space of the current rendered object. | ||
export const tangentWorld = /*@__PURE__*/ tangentView.transformDirection( cameraViewMatrix ).toVarying( 'v_tangentWorld' ).normalize().toVar( 'tangentWorld' ); | ||
/** | ||
* TSL object that represents the transformed vertex tangent in view space of the current rendered object. | ||
* | ||
* @tsl | ||
* @type {Node<vec3>} | ||
*/ | ||
export const transformedTangentView = /*@__PURE__*/ tangentView.toVar( 'transformedTangentView' ); | ||
/** | ||
* TSL object that represents the transformed vertex tangent in world space of the current rendered object. | ||
* | ||
* @tsl | ||
* @type {Node<vec3>} | ||
*/ | ||
export const transformedTangentWorld = /*@__PURE__*/ transformedTangentView.transformDirection( cameraViewMatrix ).normalize().toVar( 'transformedTangentWorld' ); |
import { add, mul, div } from '../math/OperatorNode.js'; | ||
import { floor, ceil, fract, pow } from '../math/MathNode.js'; | ||
import { Fn, float, vec2, vec4, int } from '../tsl/TSLBase.js'; | ||
import { Fn, vec2, vec4, int } from '../tsl/TSLBase.js'; | ||
import { maxMipLevel } from '../utils/MaxMipLevelNode.js'; | ||
@@ -60,6 +61,6 @@ // Mipped Bicubic Texture Filtering by N8 | ||
* @param {TextureNode} textureNode - The texture node that should be filtered. | ||
* @param {Node<float>} [lodNode=float(3)] - Defines the LOD to sample from. | ||
* @param {Node<float>} lodNode - Defines the LOD to sample from. | ||
* @return {Node} The filtered texture sample. | ||
*/ | ||
export const textureBicubic = /*@__PURE__*/ Fn( ( [ textureNode, lodNode = float( 3 ) ] ) => { | ||
export const textureBicubicLevel = /*@__PURE__*/ Fn( ( [ textureNode, lodNode ] ) => { | ||
@@ -76,1 +77,18 @@ const fLodSize = vec2( textureNode.size( int( lodNode ) ) ); | ||
} ); | ||
/** | ||
* Applies mipped bicubic texture filtering to the given texture node. | ||
* | ||
* @tsl | ||
* @function | ||
* @param {TextureNode} textureNode - The texture node that should be filtered. | ||
* @param {Node<float>} [strength] - Defines the strength of the bicubic filtering. | ||
* @return {Node} The filtered texture sample. | ||
*/ | ||
export const textureBicubic = /*@__PURE__*/ Fn( ( [ textureNode, strength ] ) => { | ||
const lod = strength.mul( maxMipLevel( textureNode ) ); | ||
return textureBicubicLevel( textureNode, lod ); | ||
} ); |
@@ -349,17 +349,1 @@ import { nodeObject } from '../tsl/TSLBase.js'; | ||
export const uniformArray = ( values, nodeType ) => nodeObject( new UniformArrayNode( values, nodeType ) ); | ||
/** | ||
* @tsl | ||
* @function | ||
* @deprecated since r168. Use {@link uniformArray} instead. | ||
* | ||
* @param {Array<any>} values - Array-like data. | ||
* @param {string} nodeType - The data type of the array elements. | ||
* @returns {UniformArrayNode} | ||
*/ | ||
export const uniforms = ( values, nodeType ) => { // @deprecated, r168 | ||
console.warn( 'THREE.TSL: uniforms() has been renamed to uniformArray().' ); | ||
return nodeObject( new UniformArrayNode( values, nodeType ) ); | ||
}; |
@@ -100,16 +100,2 @@ import Node from './Node.js'; | ||
/** | ||
* Assigns a namespace to the given node by updating its context. | ||
* | ||
* Important for TSL functions that use `.once( namespace )` to ensure that the namespace will run twice, | ||
* once when the node is build in the specific namespace and once when the node is built in the others namespace. | ||
* | ||
* This is useful for nodes like `positionWorld` that need to be re-updated if used in `material.positionNode` and outside of it in the same material. | ||
* | ||
* @param {Object} node - The node to which the namespace will be assigned. | ||
* @param {string} namespace - The namespace to be assigned to the node. | ||
* @returns {Object} The updated node with the new namespace in its context. | ||
*/ | ||
export const namespace = ( node, namespace ) => node.context( { namespace } ); | ||
addMethodChaining( 'cache', cache ); |
@@ -738,3 +738,3 @@ import { NodeUpdateType } from './constants.js'; | ||
result = ''; | ||
result = '/* Recursion detected. */'; | ||
@@ -741,0 +741,0 @@ } |
@@ -250,2 +250,3 @@ import Node from './Node.js'; | ||
const previousBuildStack = builder.currentStack; | ||
const previousStack = getCurrentStack(); | ||
@@ -255,2 +256,4 @@ | ||
builder.currentStack = this; | ||
const buildStage = builder.buildStage; | ||
@@ -285,37 +288,12 @@ | ||
const result = this.outputNode ? this.outputNode.build( builder, ...params ) : super.build( builder, ...params ); | ||
setCurrentStack( previousStack ); | ||
return this.outputNode ? this.outputNode.build( builder, ...params ) : super.build( builder, ...params ); | ||
builder.currentStack = previousBuildStack; | ||
} | ||
return result; | ||
// Deprecated | ||
/** | ||
* @function | ||
* @deprecated since r168. Use {@link StackNode#Else} instead. | ||
* | ||
* @param {...any} params | ||
* @returns {StackNode} | ||
*/ | ||
else( ...params ) { // @deprecated, r168 | ||
console.warn( 'THREE.TSL: .else() has been renamed to .Else().' ); | ||
return this.Else( ...params ); | ||
} | ||
/** | ||
* @deprecated since r168. Use {@link StackNode#ElseIf} instead. | ||
* | ||
* @param {...any} params | ||
* @returns {StackNode} | ||
*/ | ||
elseif( ...params ) { // @deprecated, r168 | ||
console.warn( 'THREE.TSL: .elseif() has been renamed to .ElseIf().' ); | ||
return this.ElseIf( ...params ); | ||
} | ||
} | ||
@@ -322,0 +300,0 @@ |
import Node from './Node.js'; | ||
import { NodeShaderStage } from './constants.js'; | ||
import { addMethodChaining, nodeProxy } from '../tsl/TSLCore.js'; | ||
import { subBuild } from './SubBuildNode.js'; | ||
@@ -134,3 +135,3 @@ /** | ||
properties.varying = varying = builder.getVaryingFromNode( this, name, type, interpolationType, interpolationSampling ); | ||
properties.node = this.node; | ||
properties.node = subBuild( this.node, 'VERTEX' ); | ||
@@ -164,6 +165,7 @@ } | ||
const propertyKey = builder.getSubBuildProperty( 'property', builder.currentStack ); | ||
const properties = builder.getNodeProperties( this ); | ||
const varying = this.setupVarying( builder ); | ||
if ( properties.propertyName === undefined ) { | ||
if ( properties[ propertyKey ] === undefined ) { | ||
@@ -174,5 +176,5 @@ const type = this.getNodeType( builder ); | ||
// force node run in vertex stage | ||
builder.flowNodeFromShaderStage( NodeShaderStage.VERTEX, this.node, type, propertyName ); | ||
builder.flowNodeFromShaderStage( NodeShaderStage.VERTEX, properties.node, type, propertyName ); | ||
properties.propertyName = propertyName; | ||
properties[ propertyKey ] = propertyName; | ||
@@ -179,0 +181,0 @@ } |
@@ -146,3 +146,3 @@ import { Fn, If, vec4 } from '../tsl/TSLBase.js'; | ||
*/ | ||
export const premult = /*@__PURE__*/ Fn( ( [ color ] ) => { | ||
export const premultiplyAlpha = /*@__PURE__*/ Fn( ( [ color ] ) => { | ||
@@ -166,3 +166,3 @@ return vec4( color.rgb.mul( color.a ), color.a ); | ||
*/ | ||
export const unpremult = /*@__PURE__*/ Fn( ( [ color ] ) => { | ||
export const unpremultiplyAlpha = /*@__PURE__*/ Fn( ( [ color ] ) => { | ||
@@ -169,0 +169,0 @@ If( color.a.equal( 0.0 ), () => vec4( 0.0 ) ); |
import Node from '../core/Node.js'; | ||
import { nodeImmutable, float } from '../tsl/TSLBase.js'; | ||
import { nodeImmutable, float, Fn } from '../tsl/TSLBase.js'; | ||
import { BackSide, WebGLCoordinateSystem } from '../../constants.js'; | ||
import { BackSide, DoubleSide, WebGLCoordinateSystem } from '../../constants.js'; | ||
@@ -39,2 +39,6 @@ /** | ||
if ( builder.shaderStage !== 'fragment' ) return 'true'; | ||
// | ||
const { renderer, material } = builder; | ||
@@ -76,1 +80,29 @@ | ||
export const faceDirection = /*@__PURE__*/ float( frontFacing ).mul( 2.0 ).sub( 1.0 ); | ||
/** | ||
* Converts a direction vector to a face direction vector based on the material's side. | ||
* | ||
* If the material is set to `BackSide`, the direction is inverted. | ||
* If the material is set to `DoubleSide`, the direction is multiplied by `faceDirection`. | ||
* | ||
* @tsl | ||
* @param {Node<vec3>} direction - The direction vector to convert. | ||
* @returns {Node<vec3>} The converted direction vector. | ||
*/ | ||
export const directionToFaceDirection = /*@__PURE__*/ Fn( ( [ direction ], { material } ) => { | ||
const side = material.side; | ||
if ( side === BackSide ) { | ||
direction = direction.mul( - 1.0 ); | ||
} else if ( side === DoubleSide ) { | ||
direction = direction.mul( faceDirection ); | ||
} | ||
return direction; | ||
} ); |
import TempNode from '../core/TempNode.js'; | ||
import { add } from '../math/OperatorNode.js'; | ||
import { normalView, transformNormalToView } from '../accessors/Normal.js'; | ||
import { positionView } from '../accessors/Position.js'; | ||
import { TBNViewMatrix } from '../accessors/AccessorsUtils.js'; | ||
import { uv } from '../accessors/UV.js'; | ||
import { faceDirection } from './FrontFacingNode.js'; | ||
import { Fn, nodeProxy, vec3 } from '../tsl/TSLBase.js'; | ||
import { nodeProxy, vec3 } from '../tsl/TSLBase.js'; | ||
import { TangentSpaceNormalMap, ObjectSpaceNormalMap } from '../../constants.js'; | ||
import { directionToFaceDirection } from './FrontFacingNode.js'; | ||
// Normal Mapping Without Precomputed Tangents | ||
// http://www.thetenthplanet.de/archives/1180 | ||
const perturbNormal2Arb = /*@__PURE__*/ Fn( ( inputs ) => { | ||
const { eye_pos, surf_norm, mapN, uv } = inputs; | ||
const q0 = eye_pos.dFdx(); | ||
const q1 = eye_pos.dFdy(); | ||
const st0 = uv.dFdx(); | ||
const st1 = uv.dFdy(); | ||
const N = surf_norm; // normalized | ||
const q1perp = q1.cross( N ); | ||
const q0perp = N.cross( q0 ); | ||
const T = q1perp.mul( st0.x ).add( q0perp.mul( st1.x ) ); | ||
const B = q1perp.mul( st0.y ).add( q0perp.mul( st1.y ) ); | ||
const det = T.dot( T ).max( B.dot( B ) ); | ||
const scale = faceDirection.mul( det.inverseSqrt() ); | ||
return add( T.mul( mapN.x, scale ), B.mul( mapN.y, scale ), N.mul( mapN.z ) ).normalize(); | ||
} ); | ||
/** | ||
@@ -92,3 +62,3 @@ * This class can be used for applying normals maps to materials. | ||
setup( builder ) { | ||
setup( { material } ) { | ||
@@ -101,34 +71,33 @@ const { normalMapType, scaleNode } = this; | ||
normalMap = vec3( normalMap.xy.mul( scaleNode ), normalMap.z ); | ||
let scale = scaleNode; | ||
if ( material.flatShading === true ) { | ||
scale = directionToFaceDirection( scale ); | ||
} | ||
normalMap = vec3( normalMap.xy.mul( scale ), normalMap.z ); | ||
} | ||
let outputNode = null; | ||
let output = null; | ||
if ( normalMapType === ObjectSpaceNormalMap ) { | ||
outputNode = transformNormalToView( normalMap ); | ||
output = transformNormalToView( normalMap ); | ||
} else if ( normalMapType === TangentSpaceNormalMap ) { | ||
const tangent = builder.hasGeometryAttribute( 'tangent' ); | ||
output = TBNViewMatrix.mul( normalMap ).normalize(); | ||
if ( tangent === true ) { | ||
} else { | ||
outputNode = TBNViewMatrix.mul( normalMap ).normalize(); | ||
console.error( `THREE.NodeMaterial: Unsupported normal map type: ${ normalMapType }` ); | ||
} else { | ||
output = normalView; // Fallback to default normal view | ||
outputNode = perturbNormal2Arb( { | ||
eye_pos: positionView, | ||
surf_norm: normalView, | ||
mapN: normalMap, | ||
uv: uv() | ||
} ); | ||
} | ||
} | ||
return outputNode; | ||
return output; | ||
@@ -135,0 +104,0 @@ } |
@@ -129,4 +129,13 @@ import TempNode from '../core/TempNode.js'; | ||
return new this.constructor( this.passNode, this.textureName, this.previousTexture ); | ||
const newNode = new this.constructor( this.passNode, this.textureName, this.previousTexture ); | ||
newNode.uvNode = this.uvNode; | ||
newNode.levelNode = this.levelNode; | ||
newNode.biasNode = this.biasNode; | ||
newNode.sampler = this.sampler; | ||
newNode.depthNode = this.depthNode; | ||
newNode.compareNode = this.compareNode; | ||
newNode.gradNode = this.gradNode; | ||
return newNode; | ||
} | ||
@@ -590,9 +599,2 @@ | ||
// TODO: Disable MSAA for WebGL backend for now | ||
if ( renderer.backend.isWebGLBackend === true ) { | ||
this.renderTarget.samples = 0; | ||
} | ||
this.renderTarget.texture.type = renderer.getColorBufferType(); | ||
@@ -599,0 +601,0 @@ |
@@ -261,27 +261,1 @@ import Node from '../core/Node.js'; | ||
}, 'vec2' ).once() )(); | ||
/** | ||
* @tsl | ||
* @deprecated since r168. Use {@link screenUV} instead. | ||
* @type {Node<vec2>} | ||
*/ | ||
export const viewportTopLeft = /*@__PURE__*/ ( Fn( () => { // @deprecated, r168 | ||
console.warn( 'THREE.TSL: "viewportTopLeft" is deprecated. Use "screenUV" instead.' ); | ||
return screenUV; | ||
}, 'vec2' ).once() )(); | ||
/** | ||
* @tsl | ||
* @deprecated since r168. Use `screenUV.flipY()` instead. | ||
* @type {Node<vec2>} | ||
*/ | ||
export const viewportBottomLeft = /*@__PURE__*/ ( Fn( () => { // @deprecated, r168 | ||
console.warn( 'THREE.TSL: "viewportBottomLeft" is deprecated. Use "screenUV.flipY()" instead.' ); | ||
return screenUV.flipY(); | ||
}, 'vec2' ).once() )(); |
@@ -6,3 +6,3 @@ import F_Schlick from './F_Schlick.js'; | ||
import D_GGX_Anisotropic from './D_GGX_Anisotropic.js'; | ||
import { transformedNormalView } from '../../accessors/Normal.js'; | ||
import { normalView as NormalView } from '../../accessors/Normal.js'; | ||
import { positionViewDirection } from '../../accessors/Position.js'; | ||
@@ -13,8 +13,4 @@ import { iridescence, alphaT, anisotropyT, anisotropyB } from '../../core/PropertyNode.js'; | ||
// GGX Distribution, Schlick Fresnel, GGX_SmithCorrelated Visibility | ||
const BRDF_GGX = /*@__PURE__*/ Fn( ( inputs ) => { | ||
const BRDF_GGX = /*@__PURE__*/ Fn( ( { lightDirection, f0, f90, roughness, f, normalView = NormalView, USE_IRIDESCENCE, USE_ANISOTROPY } ) => { | ||
const { lightDirection, f0, f90, roughness, f, USE_IRIDESCENCE, USE_ANISOTROPY } = inputs; | ||
const normalView = inputs.normalView || transformedNormalView; | ||
const alpha = roughness.pow2(); // UE4's roughness | ||
@@ -21,0 +17,0 @@ |
@@ -1,2 +0,2 @@ | ||
import { transformedNormalView } from '../../accessors/Normal.js'; | ||
import { normalView } from '../../accessors/Normal.js'; | ||
import { positionViewDirection } from '../../accessors/Position.js'; | ||
@@ -46,5 +46,5 @@ import { sheen, sheenRoughness } from '../../core/PropertyNode.js'; | ||
const dotNL = transformedNormalView.dot( lightDirection ).clamp(); | ||
const dotNV = transformedNormalView.dot( positionViewDirection ).clamp(); | ||
const dotNH = transformedNormalView.dot( halfDir ).clamp(); | ||
const dotNL = normalView.dot( lightDirection ).clamp(); | ||
const dotNV = normalView.dot( positionViewDirection ).clamp(); | ||
const dotNH = normalView.dot( halfDir ).clamp(); | ||
@@ -51,0 +51,0 @@ const D = D_Charlie( { roughness: sheenRoughness, dotNH } ); |
@@ -1,2 +0,2 @@ | ||
import { normalView } from '../../accessors/Normal.js'; | ||
import { normalViewGeometry } from '../../accessors/Normal.js'; | ||
import { float, Fn } from '../../tsl/TSLBase.js'; | ||
@@ -12,3 +12,3 @@ | ||
const dxy = normalView.dFdx().abs().max( normalView.dFdy().abs() ); | ||
const dxy = normalViewGeometry.dFdx().abs().max( normalViewGeometry.dFdy().abs() ); | ||
const geometryRoughness = dxy.x.max( dxy.y ).max( dxy.z ); | ||
@@ -15,0 +15,0 @@ |
@@ -5,3 +5,3 @@ import BasicLightingModel from './BasicLightingModel.js'; | ||
import { diffuseColor, shininess, specularColor } from '../core/PropertyNode.js'; | ||
import { transformedNormalView } from '../accessors/Normal.js'; | ||
import { normalView } from '../accessors/Normal.js'; | ||
import { materialSpecularStrength } from '../accessors/MaterialNode.js'; | ||
@@ -23,3 +23,3 @@ import { positionViewDirection } from '../accessors/Position.js'; | ||
const dotNH = transformedNormalView.dot( halfDir ).clamp(); | ||
const dotNH = normalView.dot( halfDir ).clamp(); | ||
const dotVH = positionViewDirection.dot( halfDir ).clamp(); | ||
@@ -71,3 +71,3 @@ | ||
const dotNL = transformedNormalView.dot( lightDirection ).clamp(); | ||
const dotNL = normalView.dot( lightDirection ).clamp(); | ||
const irradiance = dotNL.mul( lightColor ); | ||
@@ -74,0 +74,0 @@ |
@@ -11,3 +11,3 @@ import BRDF_Lambert from './BSDF/BRDF_Lambert.js'; | ||
import { diffuseColor, specularColor, specularF90, roughness, clearcoat, clearcoatRoughness, sheen, sheenRoughness, iridescence, iridescenceIOR, iridescenceThickness, ior, thickness, transmission, attenuationDistance, attenuationColor, dispersion } from '../core/PropertyNode.js'; | ||
import { transformedNormalView, transformedClearcoatNormalView, transformedNormalWorld } from '../accessors/Normal.js'; | ||
import { normalView, clearcoatNormalView, normalWorld } from '../accessors/Normal.js'; | ||
import { positionViewDirection, positionView, positionWorld } from '../accessors/Position.js'; | ||
@@ -22,3 +22,3 @@ import { Fn, float, vec2, vec3, vec4, mat3, If } from '../tsl/TSLBase.js'; | ||
import { viewportMipTexture } from '../display/ViewportTextureNode.js'; | ||
import { textureBicubic } from '../accessors/TextureBicubic.js'; | ||
import { textureBicubicLevel } from '../accessors/TextureBicubic.js'; | ||
import { Loop } from '../utils/LoopNode.js'; | ||
@@ -85,3 +85,3 @@ import { BackSide } from '../../constants.js'; | ||
return textureBicubic( transmissionSample, lod ); | ||
return textureBicubicLevel( transmissionSample, lod ); | ||
@@ -500,3 +500,3 @@ } ); | ||
const dotNVi = transformedNormalView.dot( positionViewDirection ).clamp(); | ||
const dotNVi = normalView.dot( positionViewDirection ).clamp(); | ||
@@ -519,3 +519,3 @@ this.iridescenceFresnel = evalIridescence( { | ||
const v = cameraPosition.sub( positionWorld ).normalize(); // TODO: Create Node for this, same issue in MaterialX | ||
const n = transformedNormalWorld; | ||
const n = normalWorld; | ||
@@ -558,3 +558,3 @@ const context = builder.context; | ||
const dotNV = transformedNormalView.dot( positionViewDirection ).clamp(); // @ TODO: Move to core dotNV | ||
const dotNV = normalView.dot( positionViewDirection ).clamp(); // @ TODO: Move to core dotNV | ||
@@ -586,3 +586,3 @@ const fab = DFGApprox( { roughness, dotNV } ); | ||
const dotNL = transformedNormalView.dot( lightDirection ).clamp(); | ||
const dotNL = normalView.dot( lightDirection ).clamp(); | ||
const irradiance = dotNL.mul( lightColor ); | ||
@@ -598,6 +598,6 @@ | ||
const dotNLcc = transformedClearcoatNormalView.dot( lightDirection ).clamp(); | ||
const dotNLcc = clearcoatNormalView.dot( lightDirection ).clamp(); | ||
const ccIrradiance = dotNLcc.mul( lightColor ); | ||
this.clearcoatSpecularDirect.addAssign( ccIrradiance.mul( BRDF_GGX( { lightDirection, f0: clearcoatF0, f90: clearcoatF90, roughness: clearcoatRoughness, normalView: transformedClearcoatNormalView } ) ) ); | ||
this.clearcoatSpecularDirect.addAssign( ccIrradiance.mul( BRDF_GGX( { lightDirection, f0: clearcoatF0, f90: clearcoatF90, roughness: clearcoatRoughness, normalView: clearcoatNormalView } ) ) ); | ||
@@ -626,3 +626,3 @@ } | ||
const N = transformedNormalView; | ||
const N = normalView; | ||
const V = positionViewDirection; | ||
@@ -692,3 +692,3 @@ const P = positionView.toVar(); | ||
IBLSheenBRDF( { | ||
normal: transformedNormalView, | ||
normal: normalView, | ||
viewDir: positionViewDirection, | ||
@@ -703,3 +703,3 @@ roughness: sheenRoughness | ||
const dotNVcc = transformedClearcoatNormalView.dot( positionViewDirection ).clamp(); | ||
const dotNVcc = clearcoatNormalView.dot( positionViewDirection ).clamp(); | ||
@@ -745,3 +745,3 @@ const clearcoatEnv = EnvironmentBRDF( { | ||
const dotNV = transformedNormalView.dot( positionViewDirection ).clamp(); // @ TODO: Move to core dotNV | ||
const dotNV = normalView.dot( positionViewDirection ).clamp(); // @ TODO: Move to core dotNV | ||
@@ -781,3 +781,3 @@ const aoNV = dotNV.add( ambientOcclusion ); | ||
const dotNVcc = transformedClearcoatNormalView.dot( positionViewDirection ).clamp(); | ||
const dotNVcc = clearcoatNormalView.dot( positionViewDirection ).clamp(); | ||
@@ -784,0 +784,0 @@ const Fcc = F_Schlick( { |
@@ -5,6 +5,6 @@ import LightingNode from './LightingNode.js'; | ||
import { cameraViewMatrix } from '../accessors/Camera.js'; | ||
import { transformedClearcoatNormalView, transformedNormalView, transformedNormalWorld } from '../accessors/Normal.js'; | ||
import { normalView, clearcoatNormalView, normalWorld } from '../accessors/Normal.js'; | ||
import { positionViewDirection } from '../accessors/Position.js'; | ||
import { float } from '../tsl/TSLBase.js'; | ||
import { transformedBentNormalView } from '../accessors/AccessorsUtils.js'; | ||
import { bentNormalView } from '../accessors/AccessorsUtils.js'; | ||
import { pmremTexture } from '../pmrem/PMREMNode.js'; | ||
@@ -76,6 +76,6 @@ import { materialEnvIntensity } from '../accessors/MaterialProperties.js'; | ||
const useAnisotropy = material.useAnisotropy === true || material.anisotropy > 0; | ||
const radianceNormalView = useAnisotropy ? transformedBentNormalView : transformedNormalView; | ||
const radianceNormalView = useAnisotropy ? bentNormalView : normalView; | ||
const radiance = envNode.context( createRadianceContext( roughness, radianceNormalView ) ).mul( materialEnvIntensity ); | ||
const irradiance = envNode.context( createIrradianceContext( transformedNormalWorld ) ).mul( Math.PI ).mul( materialEnvIntensity ); | ||
const irradiance = envNode.context( createIrradianceContext( normalWorld ) ).mul( Math.PI ).mul( materialEnvIntensity ); | ||
@@ -97,3 +97,3 @@ const isolateRadiance = cache( radiance ); | ||
const clearcoatRadianceContext = envNode.context( createRadianceContext( clearcoatRoughness, transformedClearcoatNormalView ) ).mul( materialEnvIntensity ); | ||
const clearcoatRadianceContext = envNode.context( createRadianceContext( clearcoatRoughness, clearcoatNormalView ) ).mul( materialEnvIntensity ); | ||
const isolateClearcoatRadiance = cache( clearcoatRadianceContext ); | ||
@@ -100,0 +100,0 @@ |
import Node from '../core/Node.js'; | ||
import { nodeObject, vec3 } from '../tsl/TSLBase.js'; | ||
import { nodeObject, property, vec3 } from '../tsl/TSLBase.js'; | ||
import { hashArray } from '../core/NodeUtils.js'; | ||
@@ -57,3 +57,3 @@ | ||
*/ | ||
this.totalDiffuseNode = vec3().toVar(); | ||
this.totalDiffuseNode = property( 'vec3', 'totalDiffuse' ); | ||
@@ -65,3 +65,3 @@ /** | ||
*/ | ||
this.totalSpecularNode = vec3().toVar(); | ||
this.totalSpecularNode = property( 'vec3', 'totalSpecular' ); | ||
@@ -73,3 +73,3 @@ /** | ||
*/ | ||
this.outgoingLightNode = vec3().toVar(); | ||
this.outgoingLightNode = property( 'vec3', 'outgoingLight' ); | ||
@@ -76,0 +76,0 @@ /** |
@@ -5,3 +5,3 @@ import ShadowBaseNode, { shadowPositionWorld } from './ShadowBaseNode.js'; | ||
import { texture } from '../accessors/TextureNode.js'; | ||
import { transformedNormalWorld } from '../accessors/Normal.js'; | ||
import { normalWorld } from '../accessors/Normal.js'; | ||
import { mix, sqrt } from '../math/MathNode.js'; | ||
@@ -488,3 +488,3 @@ import { add } from '../math/OperatorNode.js'; | ||
const shadowPosition = lightShadowMatrix( light ).mul( shadowPositionWorld.add( transformedNormalWorld.mul( normalBias ) ) ); | ||
const shadowPosition = lightShadowMatrix( light ).mul( shadowPositionWorld.add( normalWorld.mul( normalBias ) ) ); | ||
const shadowCoord = this.setupShadowCoord( builder, shadowPosition ); | ||
@@ -491,0 +491,0 @@ |
@@ -229,20 +229,1 @@ import Node from '../core/Node.js'; | ||
addMethodChaining( 'select', select ); | ||
// Deprecated | ||
/** | ||
* @tsl | ||
* @function | ||
* @deprecated since r168. Use {@link select} instead. | ||
* | ||
* @param {...any} params | ||
* @returns {ConditionalNode} | ||
*/ | ||
export const cond = ( ...params ) => { // @deprecated, r168 | ||
console.warn( 'THREE.TSL: cond() has been renamed to select().' ); | ||
return select( ...params ); | ||
}; | ||
addMethodChaining( 'cond', cond ); |
@@ -1046,2 +1046,13 @@ import TempNode from '../core/TempNode.js'; | ||
/** | ||
* Alias for `step()` with a different parameter order. | ||
* | ||
* @tsl | ||
* @function | ||
* @param {Node | number} x - The source value for interpolation. | ||
* @param {Node | number} edge - The edge value. | ||
* @returns {Node} | ||
*/ | ||
export const stepElement = ( x, edge ) => step( edge, x ); | ||
/** | ||
* Returns the arc-tangent of the quotient of its parameters. | ||
@@ -1108,3 +1119,3 @@ * | ||
addMethodChaining( 'max', max ); | ||
addMethodChaining( 'step', step ); | ||
addMethodChaining( 'step', stepElement ); | ||
addMethodChaining( 'reflect', reflect ); | ||
@@ -1111,0 +1122,0 @@ addMethodChaining( 'distance', distance ); |
@@ -736,18 +736,2 @@ import { WebGLCoordinateSystem } from '../../constants.js'; | ||
* @function | ||
* @deprecated since r168. Use {@link mod} instead. | ||
* | ||
* @param {Node} a - The first input. | ||
* @param {Node} b - The second input. | ||
* @returns {OperatorNode} | ||
*/ | ||
export const remainder = ( a, b ) => { // @deprecated, r168 | ||
console.warn( 'THREE.TSL: "remainder()" is deprecated. Use "mod( int( ... ) )" instead.' ); | ||
return mod( a, b ); | ||
}; | ||
/** | ||
* @tsl | ||
* @function | ||
* @deprecated since r175. Use {@link mod} instead. | ||
@@ -766,3 +750,2 @@ * | ||
addMethodChaining( 'remainder', remainder ); | ||
addMethodChaining( 'modInt', modInt ); |
@@ -36,2 +36,3 @@ // constants | ||
export { default as MRTNode } from './core/MRTNode.js'; | ||
export { default as SubBuildNode } from './core/SubBuildNode.js'; | ||
@@ -44,7 +45,5 @@ import * as NodeUtils from './core/NodeUtils.js'; | ||
export { default as ConvertNode } from './utils/ConvertNode.js'; | ||
export { default as EquirectUVNode } from './utils/EquirectUVNode.js'; | ||
export { default as FunctionOverloadingNode } from './utils/FunctionOverloadingNode.js'; | ||
export { default as JoinNode } from './utils/JoinNode.js'; | ||
export { default as LoopNode } from './utils/LoopNode.js'; | ||
export { default as MatcapUVNode } from './utils/MatcapUVNode.js'; | ||
export { default as MaxMipLevelNode } from './utils/MaxMipLevelNode.js'; | ||
@@ -57,3 +56,2 @@ export { default as RemapNode } from './utils/RemapNode.js'; | ||
export { default as StorageArrayElementNode } from './utils/StorageArrayElementNode.js'; | ||
export { default as TriplanarTexturesNode } from './utils/TriplanarTexturesNode.js'; | ||
export { default as ReflectorNode } from './utils/ReflectorNode.js'; | ||
@@ -60,0 +58,0 @@ export { default as RTTNode } from './utils/RTTNode.js'; |
@@ -27,6 +27,6 @@ // constants | ||
// utils | ||
export * from './utils/EquirectUVNode.js'; | ||
export * from './utils/EquirectUV.js'; | ||
export * from './utils/FunctionOverloadingNode.js'; | ||
export * from './utils/LoopNode.js'; | ||
export * from './utils/MatcapUVNode.js'; | ||
export * from './utils/MatcapUV.js'; | ||
export * from './utils/MaxMipLevelNode.js'; | ||
@@ -42,6 +42,7 @@ export * from './utils/Oscillators.js'; | ||
export * from './utils/Timer.js'; | ||
export * from './utils/TriplanarTexturesNode.js'; | ||
export * from './utils/TriplanarTextures.js'; | ||
export * from './utils/ReflectorNode.js'; | ||
export * from './utils/RTTNode.js'; | ||
export * from './utils/PostProcessingUtils.js'; | ||
export * from './utils/SampleNode.js'; | ||
@@ -48,0 +49,0 @@ // three.js shading language |
@@ -27,2 +27,3 @@ // Non-PURE exports list, side-effects are required here. | ||
export * from '../utils/DebugNode.js'; // debug() | ||
export * from '../core/SubBuildNode.js'; // subBuild() | ||
@@ -29,0 +30,0 @@ export function addNodeElement( name/*, nodeElement*/ ) { |
@@ -178,3 +178,3 @@ import Node from '../core/Node.js'; | ||
return Fn( obj ); | ||
return obj.isFn ? obj : Fn( obj ); | ||
@@ -329,8 +329,10 @@ } | ||
const properties = builder.getNodeProperties( shaderNode ); | ||
const onceNS = shaderNode.namespace && shaderNode.namespace === builder.namespace ? builder.getNamespace( 'once' ) : 'once'; | ||
if ( properties[ onceNS ] ) { | ||
const subBuild = builder.getClosestSubBuild( shaderNode.subBuilds ) || ''; | ||
const subBuildProperty = subBuild || 'default'; | ||
return properties[ onceNS ]; | ||
if ( properties[ subBuildProperty ] ) { | ||
return properties[ subBuildProperty ]; | ||
} | ||
@@ -340,2 +342,6 @@ | ||
const previousSubBuildFn = builder.subBuildFn; | ||
builder.subBuildFn = subBuild; | ||
let result = null; | ||
@@ -378,5 +384,7 @@ | ||
builder.subBuildFn = previousSubBuildFn; | ||
if ( shaderNode.once ) { | ||
properties[ onceNS ] = result; | ||
properties[ subBuildProperty ] = result; | ||
@@ -402,7 +410,8 @@ } | ||
const properties = builder.getNodeProperties( this ); | ||
const outputNamespace = builder.getOutputNamespace(); | ||
const subBuildOutput = builder.getSubBuildOutput( this ); | ||
properties[ outputNamespace ] = properties[ outputNamespace ] || this.setupOutput( builder ); | ||
properties[ subBuildOutput ] = properties[ subBuildOutput ] || this.setupOutput( builder ); | ||
properties[ subBuildOutput ].subBuild = builder.getClosestSubBuild( this ); | ||
return properties[ outputNamespace ]; | ||
return properties[ subBuildOutput ]; | ||
@@ -418,3 +427,3 @@ } | ||
const outputNamespace = builder.getOutputNamespace(); | ||
const subBuildOutput = builder.getSubBuildOutput( this ); | ||
const outputNode = this.getOutputNode( builder ); | ||
@@ -424,14 +433,36 @@ | ||
const initializedNamespace = builder.getNamespace( 'initialized' ); | ||
const subBuildInitialized = builder.getSubBuildProperty( 'initialized', this ); | ||
if ( properties[ initializedNamespace ] !== true ) { | ||
if ( properties[ subBuildInitialized ] !== true ) { | ||
properties[ initializedNamespace ] = true; | ||
properties[ subBuildInitialized ] = true; | ||
properties[ outputNamespace ] = this.getOutputNode( builder ); | ||
properties[ outputNamespace ].build( builder ); | ||
properties[ subBuildOutput ] = this.getOutputNode( builder ); | ||
properties[ subBuildOutput ].build( builder ); | ||
// If the shaderNode has subBuilds, add them to the chaining nodes | ||
// so they can be built later in the build process. | ||
if ( this.shaderNode.subBuilds ) { | ||
for ( const node of builder.chaining ) { | ||
const nodeData = builder.getDataFromNode( node, 'any' ); | ||
nodeData.subBuilds = nodeData.subBuilds || new Set(); | ||
for ( const subBuild of this.shaderNode.subBuilds ) { | ||
nodeData.subBuilds.add( subBuild ); | ||
} | ||
//builder.getDataFromNode( node ).subBuilds = nodeData.subBuilds; | ||
} | ||
} | ||
} | ||
result = properties[ outputNamespace ]; | ||
result = properties[ subBuildOutput ]; | ||
@@ -466,3 +497,2 @@ } else if ( buildStage === 'analyze' ) { | ||
this.once = false; | ||
this.namespace = null; | ||
@@ -535,16 +565,2 @@ } | ||
const safeGetNodeType = ( node ) => { | ||
try { | ||
return node.getNodeType(); | ||
} catch ( _ ) { | ||
return undefined; | ||
} | ||
}; | ||
const ConvertType = function ( type, cacheMap = null ) { | ||
@@ -569,3 +585,3 @@ | ||
const node = getConstNode( params[ 0 ], type ); | ||
if ( safeGetNodeType( node ) === type ) return nodeObject( node ); | ||
if ( node.nodeType === type ) return nodeObject( node ); | ||
return nodeObject( new ConvertNode( node, type ) ); | ||
@@ -665,2 +681,4 @@ | ||
fn.isFn = true; | ||
fn.getNodeType = ( ...params ) => shaderNode.getNodeType( ...params ); | ||
@@ -677,6 +695,6 @@ fn.getCacheKey = ( ...params ) => shaderNode.getCacheKey( ...params ); | ||
fn.once = ( namespace = null ) => { | ||
fn.once = ( subBuilds = null ) => { | ||
shaderNode.once = true; | ||
shaderNode.namespace = namespace; | ||
shaderNode.subBuilds = subBuilds; | ||
@@ -868,15 +886,1 @@ return fn; | ||
/** | ||
* @tsl | ||
* @function | ||
* @deprecated since r168. Use {@link Fn} instead. | ||
* | ||
* @param {...any} params | ||
* @returns {Function} | ||
*/ | ||
export const tslFn = ( ...params ) => { // @deprecated, r168 | ||
console.warn( 'THREE.TSL: tslFn() has been renamed to Fn().' ); | ||
return Fn( ...params ); | ||
}; |
@@ -354,18 +354,1 @@ import Node from '../core/Node.js'; | ||
export const Break = () => expression( 'break' ).toStack(); | ||
// Deprecated | ||
/** | ||
* @tsl | ||
* @function | ||
* @deprecated since r168. Use {@link Loop} instead. | ||
* | ||
* @param {...any} params | ||
* @returns {LoopNode} | ||
*/ | ||
export const loop = ( ...params ) => { // @deprecated, r168 | ||
console.warn( 'THREE.TSL: loop() has been renamed to Loop().' ); | ||
return Loop( ...params ); | ||
}; |
@@ -157,6 +157,13 @@ import Node from '../core/Node.js'; | ||
const texture = new this.constructor( this.reflectorNode ); | ||
texture._reflectorBaseNode = this._reflectorBaseNode; | ||
const newNode = new this.constructor( this.reflectorNode ); | ||
newNode.uvNode = this.uvNode; | ||
newNode.levelNode = this.levelNode; | ||
newNode.biasNode = this.biasNode; | ||
newNode.sampler = this.sampler; | ||
newNode.depthNode = this.depthNode; | ||
newNode.compareNode = this.compareNode; | ||
newNode.gradNode = this.gradNode; | ||
newNode._reflectorBaseNode = this._reflectorBaseNode; | ||
return texture; | ||
return newNode; | ||
@@ -163,0 +170,0 @@ } |
@@ -134,3 +134,3 @@ import { nodeObject } from '../tsl/TSLCore.js'; | ||
*/ | ||
get autoSize() { | ||
get autoResize() { | ||
@@ -192,10 +192,18 @@ return this.width === null; | ||
if ( this.autoSize === true ) { | ||
if ( this.autoResize === true ) { | ||
this.pixelRatio = renderer.getPixelRatio(); | ||
const pixelRatio = renderer.getPixelRatio(); | ||
const size = renderer.getSize( _size ); | ||
this.setSize( size.width, size.height ); | ||
const effectiveWidth = size.width * pixelRatio; | ||
const effectiveHeight = size.height * pixelRatio; | ||
if ( effectiveWidth !== this.renderTarget.width || effectiveHeight !== this.renderTarget.height ) { | ||
this.renderTarget.setSize( effectiveWidth, effectiveHeight ); | ||
this.textureNeedsUpdate = true; | ||
} | ||
} | ||
@@ -202,0 +210,0 @@ |
import DataMap from './DataMap.js'; | ||
import Color4 from './Color4.js'; | ||
import { vec4, context, normalWorld, backgroundBlurriness, backgroundIntensity, backgroundRotation, modelViewProjection } from '../../nodes/TSL.js'; | ||
import { vec4, context, normalWorldGeometry, backgroundBlurriness, backgroundIntensity, backgroundRotation, modelViewProjection } from '../../nodes/TSL.js'; | ||
import NodeMaterial from '../../materials/nodes/NodeMaterial.js'; | ||
@@ -92,3 +92,3 @@ | ||
// @TODO: Add Texture2D support using node context | ||
getUV: () => backgroundRotation.mul( normalWorld ), | ||
getUV: () => backgroundRotation.mul( normalWorldGeometry ), | ||
getTextureLevel: () => backgroundBlurriness | ||
@@ -95,0 +95,0 @@ } ); |
@@ -1,2 +0,2 @@ | ||
import { equirectUV } from '../../nodes/utils/EquirectUVNode.js'; | ||
import { equirectUV } from '../../nodes/utils/EquirectUV.js'; | ||
import { texture as TSL_Texture } from '../../nodes/accessors/TextureNode.js'; | ||
@@ -3,0 +3,0 @@ import { positionWorldDirection } from '../../nodes/accessors/Position.js'; |
import NodeMaterial from '../../../materials/nodes/NodeMaterial.js'; | ||
import { getDirection, blur } from '../../../nodes/pmrem/PMREMUtils.js'; | ||
import { equirectUV } from '../../../nodes/utils/EquirectUVNode.js'; | ||
import { equirectUV } from '../../../nodes/utils/EquirectUV.js'; | ||
import { uniform } from '../../../nodes/core/UniformNode.js'; | ||
@@ -5,0 +5,0 @@ import { uniformArray } from '../../../nodes/accessors/UniformArrayNode.js'; |
@@ -175,2 +175,12 @@ import { hash, hashString } from '../../nodes/core/NodeUtils.js'; | ||
/** | ||
* An object holding the version of the | ||
* attributes. The keys are the attribute names | ||
* and the values are the attribute versions. | ||
* | ||
* @type {?Object<string, number>} | ||
* @default null | ||
*/ | ||
this.attributesId = null; | ||
/** | ||
* A reference to a render pipeline the render | ||
@@ -294,3 +304,3 @@ * object is processed with. | ||
* An event listener which is executed when `dispose()` is called on | ||
* the render object's material. | ||
* the material of this render object. | ||
* | ||
@@ -305,3 +315,19 @@ * @method | ||
/** | ||
* An event listener which is executed when `dispose()` is called on | ||
* the geometry of this render object. | ||
* | ||
* @method | ||
*/ | ||
this.onGeometryDispose = () => { | ||
// clear geometry cache attributes | ||
this.attributes = null; | ||
this.attributesId = null; | ||
}; | ||
this.material.addEventListener( 'dispose', this.onMaterialDispose ); | ||
this.geometry.addEventListener( 'dispose', this.onGeometryDispose ); | ||
@@ -445,2 +471,3 @@ } | ||
this.attributes = null; | ||
this.attributesId = null; | ||
@@ -465,6 +492,22 @@ } | ||
const attributesId = {}; | ||
for ( const nodeAttribute of nodeAttributes ) { | ||
const attribute = nodeAttribute.node && nodeAttribute.node.attribute ? nodeAttribute.node.attribute : geometry.getAttribute( nodeAttribute.name ); | ||
let attribute; | ||
if ( nodeAttribute.node && nodeAttribute.node.attribute ) { | ||
// node attribute | ||
attribute = nodeAttribute.node.attribute; | ||
} else { | ||
// geometry attribute | ||
attribute = geometry.getAttribute( nodeAttribute.name ); | ||
attributesId[ nodeAttribute.name ] = attribute.version; | ||
} | ||
if ( attribute === undefined ) continue; | ||
@@ -480,2 +523,3 @@ | ||
this.attributes = attributes; | ||
this.attributesId = attributesId; | ||
this.vertexBuffers = Array.from( vertexBuffers.values() ); | ||
@@ -745,4 +789,24 @@ | ||
return this.geometry.id !== this.object.geometry.id; | ||
if ( this.geometry.id !== this.object.geometry.id ) return true; | ||
if ( this.attributes !== null ) { | ||
const attributesId = this.attributesId; | ||
for ( const name in attributesId ) { | ||
const attribute = this.geometry.getAttribute( name ); | ||
if ( attribute === undefined || attributesId[ name ] !== attribute.id ) { | ||
return true; | ||
} | ||
} | ||
} | ||
return false; | ||
} | ||
@@ -824,2 +888,3 @@ | ||
this.material.removeEventListener( 'dispose', this.onMaterialDispose ); | ||
this.geometry.removeEventListener( 'dispose', this.onGeometryDispose ); | ||
@@ -826,0 +891,0 @@ this.onDispose(); |
@@ -644,3 +644,3 @@ import { ArrayCamera } from '../../cameras/ArrayCamera.js'; | ||
renderTarget.autoAllocateDepthBuffer = true; | ||
renderTarget._autoAllocateDepthBuffer = true; | ||
@@ -736,3 +736,3 @@ const material = new MeshBasicMaterial( { color: 0xffffff, side: FrontSide } ); | ||
renderTarget.autoAllocateDepthBuffer = true; | ||
renderTarget._autoAllocateDepthBuffer = true; | ||
@@ -811,3 +811,3 @@ const material = new MeshBasicMaterial( { color: 0xffffff, side: BackSide } ); | ||
layer.renderTarget.isXRRenderTarget = this._session !== null; | ||
layer.renderTarget.hasExternalTextures = layer.renderTarget.isXRRenderTarget; | ||
layer.renderTarget._hasExternalTextures = layer.renderTarget.isXRRenderTarget; | ||
@@ -980,3 +980,3 @@ if ( layer.renderTarget.isXRRenderTarget && this._supportsLayers ) { | ||
this._xrRenderTarget.hasExternalTextures = true; | ||
this._xrRenderTarget._hasExternalTextures = true; | ||
this._xrRenderTarget.depth = this._useMultiview ? 2 : 1; | ||
@@ -1043,2 +1043,3 @@ | ||
this._xrRenderTarget._isOpaqueFramebuffer = true; | ||
this._referenceSpace = await session.requestReferenceSpace( this.getReferenceSpaceType() ); | ||
@@ -1045,0 +1046,0 @@ |
@@ -37,6 +37,7 @@ import { RenderTarget } from '../../core/RenderTarget.js'; | ||
* | ||
* @private | ||
* @type {boolean} | ||
* @default false | ||
*/ | ||
this.hasExternalTextures = false; | ||
this._hasExternalTextures = false; | ||
@@ -54,7 +55,22 @@ /** | ||
* | ||
* @private | ||
* @type {boolean} | ||
* @default true | ||
*/ | ||
this.autoAllocateDepthBuffer = true; | ||
this._autoAllocateDepthBuffer = true; | ||
/** | ||
* Whether this render target is associated with a XRWebGLLayer. | ||
* | ||
* A XRWebGLLayer points to an opaque framebuffer. Basically, | ||
* this means that you don't have access to its bound color, | ||
* stencil and depth buffers. We need to handle this framebuffer | ||
* differently since its textures are always bound. | ||
* | ||
* @private | ||
* @type {boolean} | ||
* @default false | ||
* */ | ||
this._isOpaqueFramebuffer = false; | ||
} | ||
@@ -66,4 +82,5 @@ | ||
this.hasExternalTextures = source.hasExternalTextures; | ||
this.autoAllocateDepthBuffer = source.autoAllocateDepthBuffer; | ||
this._hasExternalTextures = source._hasExternalTextures; | ||
this._autoAllocateDepthBuffer = source._autoAllocateDepthBuffer; | ||
this._isOpaqueFramebuffer = source._isOpaqueFramebuffer; | ||
@@ -70,0 +87,0 @@ return this; |
@@ -33,5 +33,3 @@ import { GLSLNodeParser, NodeBuilder, TextureNode, vectorComponents } from '../../../nodes/Nodes.js'; | ||
const interpolationModeMap = { | ||
'centroid': 'centroid', | ||
'flat first': 'flat', | ||
'flat either': 'flat' | ||
'centroid': 'centroid' | ||
}; | ||
@@ -38,0 +36,0 @@ |
@@ -117,2 +117,6 @@ import { IntType } from '../../../constants.js'; | ||
} else if ( typeof Float16Array !== 'undefined' && array instanceof Float16Array ) { | ||
type = gl.HALF_FLOAT; | ||
} else if ( array instanceof Uint16Array ) { | ||
@@ -119,0 +123,0 @@ |
@@ -342,3 +342,3 @@ import { | ||
case MultiplyBlending: | ||
gl.blendFuncSeparate( gl.ZERO, gl.SRC_COLOR, gl.ZERO, gl.SRC_ALPHA ); | ||
gl.blendFuncSeparate( gl.DST_COLOR, gl.ONE_MINUS_SRC_ALPHA, gl.ZERO, gl.ONE ); | ||
break; | ||
@@ -361,11 +361,11 @@ | ||
case AdditiveBlending: | ||
gl.blendFunc( gl.SRC_ALPHA, gl.ONE ); | ||
gl.blendFuncSeparate( gl.SRC_ALPHA, gl.ONE, gl.ONE, gl.ONE ); | ||
break; | ||
case SubtractiveBlending: | ||
gl.blendFuncSeparate( gl.ZERO, gl.ONE_MINUS_SRC_COLOR, gl.ZERO, gl.ONE ); | ||
console.error( 'THREE.WebGLState: SubtractiveBlending requires material.premultipliedAlpha = true' ); | ||
break; | ||
case MultiplyBlending: | ||
gl.blendFunc( gl.ZERO, gl.SRC_COLOR ); | ||
console.error( 'THREE.WebGLState: MultiplyBlending requires material.premultipliedAlpha = true' ); | ||
break; | ||
@@ -372,0 +372,0 @@ |
@@ -1024,2 +1024,4 @@ import { LinearFilter, LinearMipmapLinearFilter, LinearMipmapNearestFilter, NearestFilter, NearestMipmapLinearFilter, NearestMipmapNearestFilter, FloatType, MirroredRepeatWrapping, ClampToEdgeWrapping, RepeatWrapping, NeverCompare, AlwaysCompare, LessCompare, LessEqualCompare, EqualCompare, GreaterEqualCompare, GreaterCompare, NotEqualCompare, NoColorSpace, LinearTransfer, SRGBTransfer } from '../../../constants.js'; | ||
gl.bindRenderbuffer( gl.RENDERBUFFER, null ); | ||
} | ||
@@ -1026,0 +1028,0 @@ |
@@ -24,2 +24,6 @@ function WebGLAttributes( gl ) { | ||
} else if ( typeof Float16Array !== 'undefined' && array instanceof Float16Array ) { | ||
type = gl.HALF_FLOAT; | ||
} else if ( array instanceof Uint16Array ) { | ||
@@ -26,0 +30,0 @@ |
@@ -305,3 +305,3 @@ import { BackSide, DoubleSide, CubeUVReflectionMapping, ObjectSpaceNormalMap, TangentSpaceNormalMap, NoToneMapping, NormalBlending, LinearSRGBColorSpace, SRGBTransfer } from '../../constants.js'; | ||
flatShading: material.flatShading === true, | ||
flatShading: ( material.flatShading === true && material.wireframe === false ), | ||
@@ -519,2 +519,4 @@ sizeAttenuation: material.sizeAttenuation === true, | ||
_programLayers.enable( 21 ); | ||
if ( parameters.gradientMap ) | ||
_programLayers.enable( 22 ); | ||
@@ -521,0 +523,0 @@ array.push( _programLayers.mask ); |
@@ -670,3 +670,3 @@ import { NotEqualDepth, GreaterDepth, GreaterEqualDepth, EqualDepth, LessEqualDepth, LessDepth, AlwaysDepth, NeverDepth, CullFaceFront, CullFaceBack, CullFaceNone, DoubleSide, BackSide, CustomBlending, MultiplyBlending, SubtractiveBlending, AdditiveBlending, NoBlending, NormalBlending, AddEquation, SubtractEquation, ReverseSubtractEquation, MinEquation, MaxEquation, ZeroFactor, OneFactor, SrcColorFactor, SrcAlphaFactor, SrcAlphaSaturateFactor, DstColorFactor, DstAlphaFactor, OneMinusSrcColorFactor, OneMinusSrcAlphaFactor, OneMinusDstColorFactor, OneMinusDstAlphaFactor, ConstantColorFactor, OneMinusConstantColorFactor, ConstantAlphaFactor, OneMinusConstantAlphaFactor } from '../../constants.js'; | ||
case MultiplyBlending: | ||
gl.blendFuncSeparate( gl.ZERO, gl.SRC_COLOR, gl.ZERO, gl.SRC_ALPHA ); | ||
gl.blendFuncSeparate( gl.DST_COLOR, gl.ONE_MINUS_SRC_ALPHA, gl.ZERO, gl.ONE ); | ||
break; | ||
@@ -689,11 +689,11 @@ | ||
case AdditiveBlending: | ||
gl.blendFunc( gl.SRC_ALPHA, gl.ONE ); | ||
gl.blendFuncSeparate( gl.SRC_ALPHA, gl.ONE, gl.ONE, gl.ONE ); | ||
break; | ||
case SubtractiveBlending: | ||
gl.blendFuncSeparate( gl.ZERO, gl.ONE_MINUS_SRC_COLOR, gl.ZERO, gl.ONE ); | ||
console.error( 'THREE.WebGLState: SubtractiveBlending requires material.premultipliedAlpha = true' ); | ||
break; | ||
case MultiplyBlending: | ||
gl.blendFunc( gl.ZERO, gl.SRC_COLOR ); | ||
console.error( 'THREE.WebGLState: MultiplyBlending requires material.premultipliedAlpha = true' ); | ||
break; | ||
@@ -700,0 +700,0 @@ |
@@ -1704,2 +1704,14 @@ import NodeUniformsGroup from '../../common/nodes/NodeUniformsGroup.js'; | ||
} else if ( uniform.node.isStorageTextureNode === true ) { | ||
const format = getFormat( texture ); | ||
const access = this.getStorageAccess( uniform.node, shaderStage ); | ||
const is3D = uniform.node.value.is3DTexture; | ||
const isArrayTexture = uniform.node.value.isArrayTexture; | ||
const dimension = is3D ? '3d' : `2d${ isArrayTexture ? '_array' : '' }`; | ||
textureType = `texture_storage_${ dimension }<${ format }, ${ access }>`; | ||
} else if ( texture.isArrayTexture === true || texture.isDataArrayTexture === true || texture.isCompressedArrayTexture === true ) { | ||
@@ -1709,17 +1721,10 @@ | ||
} else if ( texture.isVideoTexture === true ) { | ||
} else if ( texture.is3DTexture === true || texture.isData3DTexture === true ) { | ||
textureType = 'texture_external'; | ||
} else if ( texture.isData3DTexture === true ) { | ||
textureType = 'texture_3d<f32>'; | ||
} else if ( uniform.node.isStorageTextureNode === true ) { | ||
} else if ( texture.isVideoTexture === true ) { | ||
const format = getFormat( texture ); | ||
const access = this.getStorageAccess( uniform.node, shaderStage ); | ||
textureType = 'texture_external'; | ||
textureType = `texture_storage_2d<${ format }, ${ access }>`; | ||
} else { | ||
@@ -1726,0 +1731,0 @@ |
@@ -15,2 +15,8 @@ import { GPUInputStepMode } from './WebGPUConstants.js'; | ||
if ( typeof Float16Array !== 'undefined' ) { | ||
typedArraysToVertexFormatPrefix.set( Float16Array, [ 'float16' ] ); | ||
} | ||
const typedAttributeToVertexFormatPrefix = new Map( [ | ||
@@ -17,0 +23,0 @@ [ Float16BufferAttribute, [ 'float16', ]], |
@@ -141,2 +141,12 @@ import { | ||
if ( binding.texture.isArrayTexture ) { | ||
storageTexture.viewDimension = GPUTextureViewDimension.TwoDArray; | ||
} else if ( binding.texture.is3DTexture ) { | ||
storageTexture.viewDimension = GPUTextureViewDimension.ThreeD; | ||
} | ||
bindingGPU.storageTexture = storageTexture; | ||
@@ -143,0 +153,0 @@ |
@@ -319,7 +319,10 @@ export const GPUPrimitiveTopology = { | ||
export const GPUFeatureName = { | ||
CoreFeaturesAndLimits: 'core-features-and-limits', | ||
DepthClipControl: 'depth-clip-control', | ||
Depth32FloatStencil8: 'depth32float-stencil8', | ||
TextureCompressionBC: 'texture-compression-bc', | ||
TextureCompressionBCSliced3D: 'texture-compression-bc-sliced-3d', | ||
TextureCompressionETC2: 'texture-compression-etc2', | ||
TextureCompressionASTC: 'texture-compression-astc', | ||
TextureCompressionASTCSliced3D: 'texture-compression-astc-sliced-3d', | ||
TimestampQuery: 'timestamp-query', | ||
@@ -331,5 +334,8 @@ IndirectFirstInstance: 'indirect-first-instance', | ||
Float32Filterable: 'float32-filterable', | ||
Float32Blendable: 'float32-blendable', | ||
ClipDistances: 'clip-distances', | ||
DualSourceBlending: 'dual-source-blending', | ||
Subgroups: 'subgroups' | ||
Subgroups: 'subgroups', | ||
TextureFormatsTier1: 'texture-formats-tier1', | ||
TextureFormatsTier2: 'texture-formats-tier2' | ||
}; |
@@ -392,3 +392,3 @@ import { BlendColorFactor, OneMinusBlendColorFactor, } from '../../common/Constants.js'; | ||
case MultiplyBlending: | ||
setBlend( GPUBlendFactor.Zero, GPUBlendFactor.Src, GPUBlendFactor.Zero, GPUBlendFactor.SrcAlpha ); | ||
setBlend( GPUBlendFactor.Dst, GPUBlendFactor.OneMinusSrcAlpha, GPUBlendFactor.Zero, GPUBlendFactor.One ); | ||
break; | ||
@@ -407,11 +407,11 @@ | ||
case AdditiveBlending: | ||
setBlend( GPUBlendFactor.SrcAlpha, GPUBlendFactor.One, GPUBlendFactor.SrcAlpha, GPUBlendFactor.One ); | ||
setBlend( GPUBlendFactor.SrcAlpha, GPUBlendFactor.One, GPUBlendFactor.One, GPUBlendFactor.One ); | ||
break; | ||
case SubtractiveBlending: | ||
setBlend( GPUBlendFactor.Zero, GPUBlendFactor.OneMinusSrc, GPUBlendFactor.Zero, GPUBlendFactor.One ); | ||
console.error( 'THREE.WebGPURenderer: SubtractiveBlending requires material.premultipliedAlpha = true' ); | ||
break; | ||
case MultiplyBlending: | ||
setBlend( GPUBlendFactor.Zero, GPUBlendFactor.Src, GPUBlendFactor.Zero, GPUBlendFactor.Src ); | ||
console.error( 'THREE.WebGPURenderer: MultiplyBlending requires material.premultipliedAlpha = true' ); | ||
break; | ||
@@ -418,0 +418,0 @@ |
@@ -1081,3 +1081,3 @@ import { | ||
if ( texture.isData3DTexture ) { | ||
if ( texture.is3DTexture || texture.isData3DTexture ) { | ||
@@ -1084,0 +1084,0 @@ dimension = GPUTextureDimension.ThreeD; |
@@ -2095,4 +2095,12 @@ /*// debugger tools | ||
this.attributeUtils.createAttribute( attribute, GPUBufferUsage.INDEX | GPUBufferUsage.COPY_SRC | GPUBufferUsage.COPY_DST ); | ||
let usage = GPUBufferUsage.INDEX | GPUBufferUsage.COPY_SRC | GPUBufferUsage.COPY_DST; | ||
if ( attribute.isStorageBufferAttribute || attribute.isStorageInstancedBufferAttribute ) { | ||
usage |= GPUBufferUsage.STORAGE; | ||
} | ||
this.attributeUtils.createAttribute( attribute, usage ); | ||
} | ||
@@ -2099,0 +2107,0 @@ |
@@ -71,2 +71,3 @@ import { TSL } from 'three/webgpu'; | ||
export const batch = TSL.batch; | ||
export const bentNormalView = TSL.bentNormalView; | ||
export const billboarding = TSL.billboarding; | ||
@@ -331,3 +332,2 @@ export const bitAnd = TSL.bitAnd; | ||
export const mx_worley_noise_vec3 = TSL.mx_worley_noise_vec3; | ||
export const namespace = TSL.namespace; | ||
export const negate = TSL.negate; | ||
@@ -345,3 +345,5 @@ export const neutralToneMapping = TSL.neutralToneMapping; | ||
export const normalView = TSL.normalView; | ||
export const normalViewGeometry = TSL.normalViewGeometry; | ||
export const normalWorld = TSL.normalWorld; | ||
export const normalWorldGeometry = TSL.normalWorldGeometry; | ||
export const normalize = TSL.normalize; | ||
@@ -392,3 +394,3 @@ export const not = TSL.not; | ||
export const pow4 = TSL.pow4; | ||
export const premult = TSL.premult; | ||
export const premultiplyAlpha = TSL.premultiplyAlpha; | ||
export const property = TSL.property; | ||
@@ -425,2 +427,3 @@ export const radians = TSL.radians; | ||
export const sRGBTransferOETF = TSL.sRGBTransferOETF; | ||
export const sample = TSL.sample; | ||
export const sampler = TSL.sampler; | ||
@@ -470,2 +473,3 @@ export const samplerComparison = TSL.samplerComparison; | ||
export const sub = TSL.sub; | ||
export const subBuild = TSL.subBuild; | ||
export const subgroupIndex = TSL.subgroupIndex; | ||
@@ -483,2 +487,3 @@ export const subgroupSize = TSL.subgroupSize; | ||
export const textureBicubic = TSL.textureBicubic; | ||
export const textureBicubicLevel = TSL.textureBicubicLevel; | ||
export const textureCubeUV = TSL.textureCubeUV; | ||
@@ -499,10 +504,5 @@ export const textureLoad = TSL.textureLoad; | ||
export const transformNormalToView = TSL.transformNormalToView; | ||
export const transformedBentNormalView = TSL.transformedBentNormalView; | ||
export const transformedBitangentView = TSL.transformedBitangentView; | ||
export const transformedBitangentWorld = TSL.transformedBitangentWorld; | ||
export const transformedClearcoatNormalView = TSL.transformedClearcoatNormalView; | ||
export const transformedNormalView = TSL.transformedNormalView; | ||
export const transformedNormalWorld = TSL.transformedNormalWorld; | ||
export const transformedTangentView = TSL.transformedTangentView; | ||
export const transformedTangentWorld = TSL.transformedTangentWorld; | ||
export const transmission = TSL.transmission; | ||
@@ -522,3 +522,3 @@ export const transpose = TSL.transpose; | ||
export const uniforms = TSL.uniforms; | ||
export const unpremult = TSL.unpremult; | ||
export const unpremultiplyAlpha = TSL.unpremultiplyAlpha; | ||
export const userData = TSL.userData; | ||
@@ -525,0 +525,0 @@ export const uv = TSL.uv; |
@@ -13,2 +13,4 @@ export * from './Three.Core.js'; | ||
export { default as StorageTexture } from './renderers/common/StorageTexture.js'; | ||
export { default as Storage3DTexture } from './renderers/common/Storage3DTexture.js'; | ||
export { default as StorageArrayTexture } from './renderers/common/StorageArrayTexture.js'; | ||
export { default as StorageBufferAttribute } from './renderers/common/StorageBufferAttribute.js'; | ||
@@ -15,0 +17,0 @@ export { default as StorageInstancedBufferAttribute } from './renderers/common/StorageInstancedBufferAttribute.js'; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
30385046
0.28%1108
0.82%481191
0.47%14
40%