super-three 0.177.0 → 0.181.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/build/three.cjs +1994 -749
- package/build/three.core.js +1358 -506
- package/build/three.core.min.js +1 -1
- package/build/three.module.js +631 -247
- package/build/three.module.min.js +1 -1
- package/build/three.tsl.js +113 -33
- package/build/three.tsl.min.js +1 -1
- package/build/three.webgpu.js +9571 -3424
- package/build/three.webgpu.min.js +1 -1
- package/build/three.webgpu.nodes.js +9397 -3426
- package/build/three.webgpu.nodes.min.js +1 -1
- package/examples/fonts/MPLUSRounded1c/MPLUSRounded1c-Regular.typeface.json.zip +0 -0
- package/examples/fonts/MPLUSRounded1c/OFL.txt +91 -0
- package/examples/jsm/Addons.js +2 -3
- package/examples/jsm/animation/CCDIKSolver.js +1 -1
- package/examples/jsm/capabilities/WebGL.js +0 -27
- package/examples/jsm/capabilities/WebGPU.js +1 -1
- package/examples/jsm/controls/ArcballControls.js +9 -9
- package/examples/jsm/controls/DragControls.js +7 -57
- package/examples/jsm/controls/FirstPersonControls.js +3 -3
- package/examples/jsm/controls/FlyControls.js +1 -1
- package/examples/jsm/controls/OrbitControls.js +2 -2
- package/examples/jsm/controls/PointerLockControls.js +2 -10
- package/examples/jsm/controls/TrackballControls.js +1 -1
- package/examples/jsm/controls/TransformControls.js +62 -15
- package/examples/jsm/csm/CSMShadowNode.js +4 -4
- package/examples/jsm/effects/AsciiEffect.js +8 -8
- package/examples/jsm/environments/RoomEnvironment.js +8 -3
- package/examples/jsm/exporters/DRACOExporter.js +2 -2
- package/examples/jsm/exporters/EXRExporter.js +1 -1
- package/examples/jsm/exporters/GLTFExporter.js +33 -25
- package/examples/jsm/exporters/KTX2Exporter.js +4 -2
- package/examples/jsm/exporters/PLYExporter.js +1 -1
- package/examples/jsm/exporters/USDZExporter.js +683 -299
- package/examples/jsm/geometries/DecalGeometry.js +2 -2
- package/examples/jsm/geometries/ParametricGeometry.js +1 -1
- package/examples/jsm/geometries/RoundedBoxGeometry.js +47 -8
- package/examples/jsm/geometries/TeapotGeometry.js +2 -2
- package/examples/jsm/geometries/TextGeometry.js +3 -2
- package/examples/jsm/gpgpu/BitonicSort.js +715 -0
- package/examples/jsm/helpers/ViewHelper.js +43 -5
- package/examples/jsm/inspector/Inspector.js +427 -0
- package/examples/jsm/inspector/RendererInspector.js +415 -0
- package/examples/jsm/inspector/tabs/Console.js +204 -0
- package/examples/jsm/inspector/tabs/Parameters.js +332 -0
- package/examples/jsm/inspector/tabs/Performance.js +268 -0
- package/examples/jsm/inspector/tabs/Viewer.js +166 -0
- package/examples/jsm/inspector/ui/Graph.js +95 -0
- package/examples/jsm/inspector/ui/Item.js +170 -0
- package/examples/jsm/inspector/ui/List.js +75 -0
- package/examples/jsm/inspector/ui/Profiler.js +170 -0
- package/examples/jsm/inspector/ui/Style.js +654 -0
- package/examples/jsm/inspector/ui/Tab.js +46 -0
- package/examples/jsm/inspector/ui/Values.js +423 -0
- package/examples/jsm/inspector/ui/utils.js +56 -0
- package/examples/jsm/interactive/HTMLMesh.js +11 -13
- package/examples/jsm/interactive/InteractiveGroup.js +1 -1
- package/examples/jsm/interactive/SelectionBox.js +30 -0
- package/examples/jsm/libs/ktx-parse.module.js +1 -1
- package/examples/jsm/libs/meshopt_decoder.module.js +75 -58
- package/examples/jsm/lights/LightProbeGenerator.js +14 -3
- package/examples/jsm/lights/RectAreaLightTexturesLib.js +1 -1
- package/examples/jsm/lines/Line2.js +3 -3
- package/examples/jsm/lines/LineGeometry.js +1 -1
- package/examples/jsm/lines/LineSegments2.js +2 -2
- package/examples/jsm/lines/Wireframe.js +2 -2
- package/examples/jsm/lines/WireframeGeometry2.js +1 -1
- package/examples/jsm/lines/webgpu/LineSegments2.js +1 -1
- package/examples/jsm/lines/webgpu/Wireframe.js +1 -1
- package/examples/jsm/loaders/3MFLoader.js +1 -1
- package/examples/jsm/loaders/ColladaLoader.js +4 -4
- package/examples/jsm/loaders/DDSLoader.js +1 -1
- package/examples/jsm/loaders/DRACOLoader.js +73 -22
- package/examples/jsm/loaders/EXRLoader.js +210 -22
- package/examples/jsm/loaders/FBXLoader.js +4 -4
- package/examples/jsm/loaders/FontLoader.js +23 -5
- package/examples/jsm/loaders/GLTFLoader.js +14 -8
- package/examples/jsm/loaders/HDRCubeTextureLoader.js +5 -5
- package/examples/jsm/loaders/HDRLoader.js +486 -0
- package/examples/jsm/loaders/KTX2Loader.js +136 -49
- package/examples/jsm/loaders/KTXLoader.js +2 -2
- package/examples/jsm/loaders/LDrawLoader.js +1 -1
- package/examples/jsm/loaders/LUT3dlLoader.js +2 -2
- package/examples/jsm/loaders/LUTCubeLoader.js +1 -1
- package/examples/jsm/loaders/LWOLoader.js +2 -2
- package/examples/jsm/loaders/MaterialXLoader.js +233 -34
- package/examples/jsm/loaders/OBJLoader.js +1 -1
- package/examples/jsm/loaders/PDBLoader.js +1 -1
- package/examples/jsm/loaders/RGBELoader.js +7 -473
- package/examples/jsm/loaders/SVGLoader.js +2 -2
- package/examples/jsm/loaders/TTFLoader.js +13 -1
- package/examples/jsm/loaders/USDLoader.js +219 -0
- package/examples/jsm/loaders/USDZLoader.js +4 -892
- package/examples/jsm/loaders/UltraHDRLoader.js +2 -2
- package/examples/jsm/loaders/lwo/IFFParser.js +1 -1
- package/examples/jsm/loaders/usd/USDAParser.js +741 -0
- package/examples/jsm/loaders/usd/USDCParser.js +17 -0
- package/examples/jsm/materials/WoodNodeMaterial.js +533 -0
- package/examples/jsm/math/ColorSpaces.js +19 -1
- package/examples/jsm/math/ConvexHull.js +3 -3
- package/examples/jsm/math/ImprovedNoise.js +1 -1
- package/examples/jsm/math/Lut.js +2 -2
- package/examples/jsm/math/SimplexNoise.js +1 -1
- package/examples/jsm/misc/MD2CharacterComplex.js +1 -1
- package/examples/jsm/misc/ProgressiveLightMap.js +9 -3
- package/examples/jsm/misc/ProgressiveLightMapGPU.js +7 -1
- package/examples/jsm/misc/TubePainter.js +383 -40
- package/examples/jsm/misc/Volume.js +1 -1
- package/examples/jsm/modifiers/SimplifyModifier.js +1 -1
- package/examples/jsm/objects/LensflareMesh.js +3 -3
- package/examples/jsm/objects/ReflectorForSSRPass.js +1 -0
- package/examples/jsm/objects/Sky.js +1 -1
- package/examples/jsm/objects/SkyMesh.js +3 -3
- package/examples/jsm/objects/Water.js +3 -3
- package/examples/jsm/objects/WaterMesh.js +6 -6
- package/examples/jsm/physics/RapierPhysics.js +95 -16
- package/examples/jsm/postprocessing/GTAOPass.js +10 -9
- package/examples/jsm/postprocessing/GlitchPass.js +2 -2
- package/examples/jsm/postprocessing/OutlinePass.js +17 -17
- package/examples/jsm/postprocessing/SSAOPass.js +10 -9
- package/examples/jsm/postprocessing/SSRPass.js +37 -8
- package/examples/jsm/postprocessing/UnrealBloomPass.js +8 -6
- package/examples/jsm/renderers/CSS2DRenderer.js +16 -5
- package/examples/jsm/renderers/CSS3DRenderer.js +7 -6
- package/examples/jsm/renderers/SVGRenderer.js +1 -1
- package/examples/jsm/shaders/ACESFilmicToneMappingShader.js +1 -1
- package/examples/jsm/shaders/AfterimageShader.js +1 -1
- package/examples/jsm/shaders/BleachBypassShader.js +1 -1
- package/examples/jsm/shaders/BokehShader.js +1 -1
- package/examples/jsm/shaders/BokehShader2.js +1 -1
- package/examples/jsm/shaders/DotScreenShader.js +1 -1
- package/examples/jsm/shaders/FocusShader.js +1 -1
- package/examples/jsm/shaders/GTAOShader.js +2 -2
- package/examples/jsm/shaders/GodRaysShader.js +1 -1
- package/examples/jsm/shaders/KaleidoShader.js +1 -1
- package/examples/jsm/shaders/PoissonDenoiseShader.js +2 -2
- package/examples/jsm/shaders/SSRShader.js +1 -1
- package/examples/jsm/shaders/SepiaShader.js +1 -1
- package/examples/jsm/shaders/SubsurfaceScatteringShader.js +1 -1
- package/examples/jsm/shaders/TriangleBlurShader.js +1 -1
- package/examples/jsm/shaders/UnpackDepthRGBAShader.js +11 -2
- package/examples/jsm/shaders/VignetteShader.js +1 -1
- package/examples/jsm/transpiler/AST.js +381 -30
- package/examples/jsm/transpiler/GLSLDecoder.js +247 -104
- package/examples/jsm/transpiler/Linker.js +327 -0
- package/examples/jsm/transpiler/TSLEncoder.js +196 -92
- package/examples/jsm/transpiler/Transpiler.js +17 -1
- package/examples/jsm/transpiler/TranspilerUtils.js +29 -0
- package/examples/jsm/transpiler/WGSLEncoder.js +812 -0
- package/examples/jsm/tsl/display/AfterImageNode.js +26 -24
- package/examples/jsm/tsl/display/AnamorphicNode.js +28 -4
- package/examples/jsm/tsl/display/BloomNode.js +11 -6
- package/examples/jsm/tsl/display/ChromaticAberrationNode.js +207 -0
- package/examples/jsm/tsl/display/DenoiseNode.js +2 -0
- package/examples/jsm/tsl/display/DepthOfFieldNode.js +446 -90
- package/examples/jsm/tsl/display/GTAONode.js +53 -5
- package/examples/jsm/tsl/display/GaussianBlurNode.js +55 -43
- package/examples/jsm/tsl/display/OutlineNode.js +13 -2
- package/examples/jsm/tsl/display/SSAAPassNode.js +2 -2
- package/examples/jsm/tsl/display/SSGINode.js +654 -0
- package/examples/jsm/tsl/display/SSRNode.js +182 -65
- package/examples/jsm/tsl/display/SSSNode.js +488 -0
- package/examples/jsm/tsl/display/TRAANode.js +578 -0
- package/examples/jsm/tsl/display/boxBlur.js +65 -0
- package/examples/jsm/tsl/display/hashBlur.js +18 -20
- package/examples/jsm/tsl/lighting/TiledLightsNode.js +22 -2
- package/examples/jsm/utils/BufferGeometryUtils.js +1 -1
- package/examples/jsm/utils/ShadowMapViewerGPU.js +12 -5
- package/examples/jsm/webxr/OculusHandModel.js +1 -1
- package/examples/jsm/webxr/XRControllerModelFactory.js +1 -1
- package/examples/jsm/webxr/XRHandModelFactory.js +2 -6
- package/package.json +5 -10
- package/src/Three.Core.js +5 -2
- package/src/Three.TSL.js +112 -32
- package/src/Three.WebGPU.Nodes.js +2 -0
- package/src/Three.WebGPU.js +4 -0
- package/src/animation/AnimationClip.js +20 -4
- package/src/animation/AnimationMixer.js +3 -3
- package/src/animation/AnimationObjectGroup.js +2 -1
- package/src/animation/KeyframeTrack.js +8 -7
- package/src/animation/PropertyBinding.js +12 -11
- package/src/animation/tracks/BooleanKeyframeTrack.js +1 -1
- package/src/animation/tracks/StringKeyframeTrack.js +1 -1
- package/src/audio/Audio.js +10 -9
- package/src/audio/PositionalAudio.js +1 -1
- package/src/cameras/Camera.js +14 -0
- package/src/cameras/OrthographicCamera.js +2 -2
- package/src/cameras/PerspectiveCamera.js +2 -2
- package/src/cameras/StereoCamera.js +2 -2
- package/src/constants.js +13 -5
- package/src/core/BufferAttribute.js +3 -3
- package/src/core/BufferGeometry.js +10 -10
- package/src/core/Clock.js +2 -8
- package/src/core/EventDispatcher.js +1 -1
- package/src/core/GLBufferAttribute.js +13 -1
- package/src/core/InterleavedBuffer.js +1 -1
- package/src/core/InterleavedBufferAttribute.js +3 -2
- package/src/core/Object3D.js +4 -3
- package/src/core/Raycaster.js +2 -1
- package/src/core/RenderTarget.js +10 -1
- package/{examples/jsm/misc → src/core}/Timer.js +4 -42
- package/src/extras/Controls.js +5 -4
- package/src/extras/DataUtils.js +2 -1
- package/src/extras/Earcut.js +6 -0
- package/src/extras/ImageUtils.js +2 -2
- package/src/extras/PMREMGenerator.js +279 -55
- package/src/extras/TextureUtils.js +2 -1
- package/src/extras/core/Curve.js +2 -1
- package/src/extras/core/Interpolations.js +7 -1
- package/src/extras/core/Path.js +22 -22
- package/src/extras/core/ShapePath.js +4 -4
- package/src/extras/lib/earcut.js +8 -8
- package/src/geometries/BoxGeometry.js +1 -0
- package/src/geometries/CapsuleGeometry.js +1 -0
- package/src/geometries/CircleGeometry.js +1 -0
- package/src/geometries/ConeGeometry.js +1 -0
- package/src/geometries/CylinderGeometry.js +1 -0
- package/src/geometries/DodecahedronGeometry.js +1 -0
- package/src/geometries/ExtrudeGeometry.js +8 -6
- package/src/geometries/IcosahedronGeometry.js +1 -0
- package/src/geometries/LatheGeometry.js +1 -0
- package/src/geometries/OctahedronGeometry.js +1 -0
- package/src/geometries/PlaneGeometry.js +1 -0
- package/src/geometries/RingGeometry.js +1 -0
- package/src/geometries/ShapeGeometry.js +1 -0
- package/src/geometries/SphereGeometry.js +1 -0
- package/src/geometries/TetrahedronGeometry.js +1 -0
- package/src/geometries/TorusGeometry.js +1 -0
- package/src/geometries/TorusKnotGeometry.js +1 -0
- package/src/geometries/TubeGeometry.js +1 -0
- package/src/helpers/CameraHelper.js +42 -12
- package/src/helpers/SkeletonHelper.js +35 -6
- package/src/lights/LightShadow.js +21 -8
- package/src/lights/PointLightShadow.js +1 -1
- package/src/lights/webgpu/ProjectorLight.js +1 -1
- package/src/loaders/AnimationLoader.js +2 -1
- package/src/loaders/AudioLoader.js +2 -1
- package/src/loaders/BufferGeometryLoader.js +2 -2
- package/src/loaders/Cache.js +2 -2
- package/src/loaders/DataTextureLoader.js +1 -1
- package/src/loaders/FileLoader.js +29 -5
- package/src/loaders/ImageBitmapLoader.js +32 -8
- package/src/loaders/ImageLoader.js +56 -9
- package/src/loaders/Loader.js +17 -3
- package/src/loaders/LoadingManager.js +45 -0
- package/src/loaders/MaterialLoader.js +3 -2
- package/src/loaders/ObjectLoader.js +13 -13
- package/src/loaders/TextureLoader.js +1 -1
- package/src/loaders/nodes/NodeLoader.js +3 -2
- package/src/materials/Material.js +16 -3
- package/src/materials/MeshBasicMaterial.js +2 -1
- package/src/materials/MeshDepthMaterial.js +1 -0
- package/src/materials/MeshDistanceMaterial.js +1 -1
- package/src/materials/MeshLambertMaterial.js +2 -1
- package/src/materials/MeshMatcapMaterial.js +22 -0
- package/src/materials/MeshNormalMaterial.js +1 -0
- package/src/materials/MeshPhongMaterial.js +2 -1
- package/src/materials/MeshPhysicalMaterial.js +2 -1
- package/src/materials/MeshStandardMaterial.js +8 -7
- package/src/materials/MeshToonMaterial.js +1 -0
- package/src/materials/PointsMaterial.js +1 -1
- package/src/materials/ShaderMaterial.js +2 -2
- package/src/materials/nodes/Line2NodeMaterial.js +2 -10
- package/src/materials/nodes/MeshBasicNodeMaterial.js +4 -3
- package/src/materials/nodes/MeshMatcapNodeMaterial.js +1 -1
- package/src/materials/nodes/MeshNormalNodeMaterial.js +2 -2
- package/src/materials/nodes/MeshPhysicalNodeMaterial.js +2 -1
- package/src/materials/nodes/MeshSSSNodeMaterial.js +3 -3
- package/src/materials/nodes/NodeMaterial.js +90 -27
- package/src/materials/nodes/PointsNodeMaterial.js +86 -28
- package/src/materials/nodes/SpriteNodeMaterial.js +3 -15
- package/src/materials/nodes/manager/NodeMaterialObserver.js +89 -3
- package/src/math/Color.js +6 -5
- package/src/math/ColorManagement.js +9 -3
- package/src/math/Cylindrical.js +1 -1
- package/src/math/Euler.js +2 -1
- package/src/math/Frustum.js +25 -9
- package/src/math/FrustumArray.js +10 -5
- package/src/math/Line3.js +129 -2
- package/src/math/MathUtils.js +13 -11
- package/src/math/Matrix2.js +1 -1
- package/src/math/Matrix3.js +2 -2
- package/src/math/Matrix4.js +55 -34
- package/src/math/Plane.js +1 -1
- package/src/math/Quaternion.js +69 -67
- package/src/math/Spherical.js +3 -3
- package/src/nodes/Nodes.js +6 -4
- package/src/nodes/TSL.js +9 -4
- package/src/nodes/accessors/AccessorsUtils.js +7 -8
- package/src/nodes/accessors/Bitangent.js +31 -25
- package/src/nodes/accessors/BufferNode.js +1 -1
- package/src/nodes/accessors/Camera.js +142 -16
- package/src/nodes/accessors/ClippingNode.js +6 -5
- package/src/nodes/accessors/CubeTextureNode.js +5 -4
- package/src/nodes/accessors/InstanceNode.js +25 -5
- package/src/nodes/accessors/Lights.js +10 -0
- package/src/nodes/accessors/Normal.js +97 -30
- package/src/nodes/accessors/Object3DNode.js +2 -2
- package/src/nodes/accessors/Position.js +25 -9
- package/src/nodes/accessors/ReferenceBaseNode.js +1 -1
- package/src/nodes/accessors/ReferenceNode.js +20 -4
- package/src/nodes/accessors/ReflectVector.js +3 -3
- package/src/nodes/accessors/SceneNode.js +3 -2
- package/src/nodes/accessors/StorageBufferNode.js +2 -1
- package/src/nodes/accessors/StorageTextureNode.js +23 -1
- package/src/nodes/accessors/Tangent.js +25 -17
- package/src/nodes/accessors/TangentUtils.js +46 -0
- package/src/nodes/accessors/Texture3DNode.js +14 -1
- package/src/nodes/accessors/TextureBicubic.js +21 -3
- package/src/nodes/accessors/TextureNode.js +142 -44
- package/src/nodes/accessors/UniformArrayNode.js +0 -16
- package/src/nodes/code/FunctionCallNode.js +24 -4
- package/src/nodes/code/FunctionNode.js +23 -0
- package/src/nodes/core/ArrayNode.js +13 -0
- package/src/nodes/core/AssignNode.js +6 -2
- package/src/nodes/core/AttributeNode.js +2 -1
- package/src/nodes/core/ContextNode.js +48 -10
- package/src/nodes/core/IndexNode.js +2 -2
- package/src/nodes/core/InputNode.js +2 -1
- package/src/nodes/core/InspectorNode.js +128 -0
- package/src/nodes/core/{CacheNode.js → IsolateNode.js} +36 -17
- package/src/nodes/core/Node.js +167 -34
- package/src/nodes/core/NodeBuilder.js +404 -120
- package/src/nodes/core/NodeFrame.js +21 -21
- package/src/nodes/core/NodeFunction.js +2 -1
- package/src/nodes/core/NodeParser.js +2 -1
- package/src/nodes/core/NodeUniform.js +1 -1
- package/src/nodes/core/NodeUtils.js +17 -88
- package/src/nodes/core/ParameterNode.js +31 -0
- package/src/nodes/core/PropertyNode.js +7 -0
- package/src/nodes/core/StackNode.js +77 -30
- package/src/nodes/core/StructNode.js +5 -5
- package/src/nodes/core/StructTypeNode.js +1 -0
- package/src/nodes/core/SubBuildNode.js +89 -0
- package/src/nodes/core/UniformNode.js +80 -14
- package/src/nodes/core/VarNode.js +142 -16
- package/src/nodes/core/VaryingNode.js +9 -6
- package/src/nodes/display/BlendModes.js +7 -6
- package/src/nodes/display/BumpMapNode.js +1 -1
- package/src/nodes/display/ColorAdjustment.js +1 -1
- package/src/nodes/display/FrontFacingNode.js +35 -7
- package/src/nodes/display/NormalMapNode.js +20 -50
- package/src/nodes/display/PassNode.js +206 -17
- package/src/nodes/display/RenderOutputNode.js +28 -2
- package/src/nodes/display/ScreenNode.js +44 -40
- package/src/nodes/display/ToneMappingNode.js +31 -4
- package/src/nodes/display/ToonOutlinePassNode.js +8 -0
- package/src/nodes/display/ViewportDepthTextureNode.js +16 -4
- package/src/nodes/display/ViewportSharedTextureNode.js +12 -0
- package/src/nodes/display/ViewportTextureNode.js +94 -4
- package/src/nodes/fog/Fog.js +3 -2
- package/src/nodes/functions/BSDF/BRDF_GGX.js +2 -6
- package/src/nodes/functions/BSDF/BRDF_GGX_Multiscatter.js +52 -0
- package/src/nodes/functions/BSDF/BRDF_Sheen.js +4 -4
- package/src/nodes/functions/BSDF/DFGApprox.js +60 -19
- package/src/nodes/functions/BasicLightingModel.js +2 -1
- package/src/nodes/functions/PhongLightingModel.js +3 -3
- package/src/nodes/functions/PhysicalLightingModel.js +19 -18
- package/src/nodes/functions/VolumetricLightingModel.js +5 -5
- package/src/nodes/functions/material/getGeometryRoughness.js +2 -2
- package/src/nodes/geometry/RangeNode.js +40 -4
- package/src/nodes/gpgpu/AtomicFunctionNode.js +1 -1
- package/src/nodes/gpgpu/ComputeBuiltinNode.js +2 -1
- package/src/nodes/gpgpu/ComputeNode.js +81 -25
- package/src/nodes/gpgpu/SubgroupFunctionNode.js +455 -0
- package/src/nodes/gpgpu/WorkgroupInfoNode.js +29 -3
- package/src/nodes/lighting/EnvironmentNode.js +11 -11
- package/src/nodes/lighting/LightsNode.js +7 -8
- package/src/nodes/lighting/PointShadowNode.js +6 -0
- package/src/nodes/lighting/ProjectorLightNode.js +19 -6
- package/src/nodes/lighting/ShadowFilterNode.js +3 -1
- package/src/nodes/lighting/ShadowNode.js +77 -10
- package/src/nodes/materialx/MaterialXNodes.js +131 -2
- package/src/nodes/materialx/lib/mx_noise.js +165 -1
- package/src/nodes/math/BitcastNode.js +156 -0
- package/src/nodes/math/ConditionalNode.js +25 -27
- package/src/nodes/math/MathNode.js +106 -65
- package/src/nodes/math/OperatorNode.js +28 -43
- package/src/nodes/pmrem/PMREMUtils.js +117 -2
- package/src/nodes/shapes/Shapes.js +1 -1
- package/src/nodes/tsl/TSLBase.js +6 -2
- package/src/nodes/tsl/TSLCore.js +546 -186
- package/src/nodes/utils/DebugNode.js +3 -2
- package/src/nodes/utils/EquirectUV.js +27 -0
- package/src/nodes/utils/EventNode.js +119 -0
- package/src/nodes/utils/FunctionOverloadingNode.js +37 -19
- package/src/nodes/utils/JoinNode.js +6 -3
- package/src/nodes/utils/LoopNode.js +20 -41
- package/src/nodes/utils/MatcapUV.js +22 -0
- package/src/nodes/utils/MemberNode.js +59 -7
- package/src/nodes/utils/PostProcessingUtils.js +28 -1
- package/src/nodes/utils/RTTNode.js +33 -6
- package/src/nodes/utils/ReflectorNode.js +68 -10
- package/src/nodes/utils/SampleNode.js +91 -0
- package/src/nodes/utils/SplitNode.js +11 -0
- package/src/nodes/utils/Timer.js +0 -47
- package/src/nodes/utils/TriplanarTextures.js +65 -0
- package/src/objects/BatchedMesh.js +6 -4
- package/src/objects/LOD.js +1 -1
- package/src/objects/Line.js +2 -1
- package/src/objects/LineSegments.js +2 -1
- package/src/objects/Skeleton.js +3 -2
- package/src/objects/SkinnedMesh.js +3 -1
- package/src/objects/Sprite.js +4 -3
- package/src/renderers/WebGLRenderer.js +77 -66
- package/src/renderers/common/Animation.js +13 -1
- package/src/renderers/common/Attributes.js +1 -1
- package/src/renderers/common/Backend.js +108 -27
- package/src/renderers/common/Background.js +4 -3
- package/src/renderers/common/Bindings.js +76 -19
- package/src/renderers/common/CanvasTarget.js +341 -0
- package/src/renderers/common/ChainMap.js +1 -1
- package/src/renderers/common/Color4.js +2 -2
- package/src/renderers/common/CubeRenderTarget.js +1 -1
- package/src/renderers/common/DataMap.js +1 -1
- package/src/renderers/common/Geometries.js +26 -0
- package/src/renderers/common/Info.js +4 -2
- package/src/renderers/common/InspectorBase.js +146 -0
- package/src/renderers/common/Pipelines.js +1 -1
- package/src/renderers/common/PostProcessing.js +61 -25
- package/src/renderers/common/QuadMesh.js +7 -1
- package/src/renderers/common/RenderContext.js +2 -2
- package/src/renderers/common/RenderList.js +7 -3
- package/src/renderers/common/RenderObject.js +84 -5
- package/src/renderers/common/RenderObjects.js +1 -1
- package/src/renderers/common/Renderer.js +486 -255
- package/src/renderers/common/RendererUtils.js +9 -0
- package/src/renderers/common/SampledTexture.js +8 -68
- package/src/renderers/common/Sampler.js +117 -0
- package/src/renderers/common/Storage3DTexture.js +100 -0
- package/src/renderers/common/StorageArrayTexture.js +84 -0
- package/src/renderers/common/StorageTexture.js +27 -0
- package/src/renderers/common/Textures.js +138 -46
- package/src/renderers/common/TimestampQueryPool.js +65 -3
- package/src/renderers/common/UniformsGroup.js +2 -1
- package/src/renderers/common/XRManager.js +63 -24
- package/src/renderers/common/XRRenderTarget.js +21 -4
- package/src/renderers/common/extras/PMREMGenerator.js +161 -66
- package/src/renderers/common/nodes/NodeBuilderState.js +1 -1
- package/src/renderers/common/nodes/NodeLibrary.js +9 -7
- package/src/renderers/common/nodes/NodeSampledTexture.js +0 -12
- package/src/renderers/common/nodes/NodeSampler.js +13 -1
- package/src/renderers/common/nodes/Nodes.js +38 -16
- package/src/renderers/shaders/DFGLUTData.js +64 -0
- package/src/renderers/shaders/ShaderChunk/common.glsl.js +0 -12
- package/src/renderers/shaders/ShaderChunk/envmap_common_pars_fragment.glsl.js +1 -1
- package/src/renderers/shaders/ShaderChunk/envmap_physical_pars_fragment.glsl.js +1 -1
- package/src/renderers/shaders/ShaderChunk/lights_physical_pars_fragment.glsl.js +52 -18
- package/src/renderers/shaders/ShaderChunk/logdepthbuf_fragment.glsl.js +1 -1
- package/src/renderers/shaders/ShaderChunk/logdepthbuf_pars_fragment.glsl.js +1 -1
- package/src/renderers/shaders/ShaderChunk/logdepthbuf_pars_vertex.glsl.js +1 -1
- package/src/renderers/shaders/ShaderChunk/logdepthbuf_vertex.glsl.js +1 -1
- package/src/renderers/shaders/ShaderChunk/shadowmap_pars_fragment.glsl.js +21 -11
- package/src/renderers/shaders/ShaderLib/depth.glsl.js +11 -2
- package/src/renderers/shaders/UniformsLib.js +1 -0
- package/src/renderers/shaders/UniformsUtils.js +25 -4
- package/src/renderers/webgl/WebGLAttributes.js +4 -0
- package/src/renderers/webgl/WebGLCapabilities.js +4 -3
- package/src/renderers/webgl/WebGLExtensions.js +2 -25
- package/src/renderers/webgl/WebGLInfo.js +3 -1
- package/src/renderers/webgl/WebGLProgram.js +25 -18
- package/src/renderers/webgl/WebGLPrograms.js +9 -6
- package/src/renderers/webgl/WebGLShadowMap.js +13 -2
- package/src/renderers/webgl/WebGLState.js +17 -16
- package/src/renderers/webgl/WebGLTextures.js +38 -21
- package/src/renderers/webgl/WebGLUniformsGroups.js +5 -3
- package/src/renderers/webgl/WebGLUtils.js +3 -2
- package/src/renderers/webgl-fallback/WebGLBackend.js +245 -182
- package/src/renderers/webgl-fallback/nodes/GLSLNodeBuilder.js +184 -30
- package/src/renderers/webgl-fallback/utils/WebGLAttributeUtils.js +4 -0
- package/src/renderers/webgl-fallback/utils/WebGLConstants.js +2 -3
- package/src/renderers/webgl-fallback/utils/WebGLState.js +9 -8
- package/src/renderers/webgl-fallback/utils/WebGLTextureUtils.js +171 -19
- package/src/renderers/webgl-fallback/utils/WebGLTimestampQueryPool.js +51 -22
- package/src/renderers/webgl-fallback/utils/WebGLUtils.js +3 -2
- package/src/renderers/webgpu/WebGPUBackend.js +205 -128
- package/src/renderers/webgpu/WebGPURenderer.Nodes.js +2 -1
- package/src/renderers/webgpu/WebGPURenderer.js +3 -2
- package/src/renderers/webgpu/nodes/WGSLNodeBuilder.js +198 -121
- package/src/renderers/webgpu/utils/WebGPUAttributeUtils.js +8 -1
- package/src/renderers/webgpu/utils/WebGPUBindingUtils.js +49 -33
- package/src/renderers/webgpu/utils/WebGPUConstants.js +14 -3
- package/src/renderers/webgpu/utils/WebGPUPipelineUtils.js +56 -37
- package/src/renderers/webgpu/utils/WebGPUTexturePassUtils.js +6 -8
- package/src/renderers/webgpu/utils/WebGPUTextureUtils.js +266 -158
- package/src/renderers/webgpu/utils/WebGPUTimestampQueryPool.js +32 -9
- package/src/renderers/webgpu/utils/WebGPUUtils.js +24 -19
- package/src/renderers/webxr/WebXRDepthSensing.js +6 -10
- package/src/renderers/webxr/WebXRManager.js +89 -13
- package/src/textures/ExternalTexture.js +56 -0
- package/src/textures/FramebufferTexture.js +2 -2
- package/src/textures/Source.js +14 -3
- package/src/textures/Texture.js +3 -2
- package/src/textures/VideoTexture.js +29 -2
- package/src/utils.js +67 -3
- package/examples/jsm/loaders/RGBMLoader.js +0 -1148
- package/examples/jsm/tsl/display/TRAAPassNode.js +0 -452
- package/src/nodes/utils/EquirectUVNode.js +0 -65
- package/src/nodes/utils/MatcapUVNode.js +0 -49
- package/src/nodes/utils/TriplanarTexturesNode.js +0 -148
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Precomputed DFG LUT for Image-Based Lighting
|
|
3
|
+
* Resolution: 32x32
|
|
4
|
+
* Samples: 4096 per texel
|
|
5
|
+
* Format: RG16F (2 half floats per texel: scale, bias)
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { DataTexture } from '../../textures/DataTexture.js';
|
|
9
|
+
import { RGFormat, HalfFloatType, LinearFilter, ClampToEdgeWrapping } from '../../constants.js';
|
|
10
|
+
|
|
11
|
+
const DATA = new Uint16Array( [
|
|
12
|
+
0x2cd9, 0x3b64, 0x2d0e, 0x3b43, 0x2e20, 0x3aa7, 0x3061, 0x39fb, 0x325e, 0x397c, 0x3454, 0x3908, 0x357d, 0x3893, 0x3698, 0x381e, 0x379d, 0x375b, 0x3845, 0x3689, 0x38af, 0x35ca, 0x390d, 0x351e, 0x395f, 0x3484, 0x39a8, 0x33f9, 0x39e6, 0x330a, 0x3a1c, 0x3239, 0x3a4b, 0x3183, 0x3a73, 0x30e5, 0x3a95, 0x305b, 0x3ab1, 0x2fc6, 0x3ac9, 0x2ef7, 0x3ade, 0x2e43, 0x3aee, 0x2da7, 0x3afc, 0x2d1f, 0x3b07, 0x2ca9, 0x3b10, 0x2c42, 0x3b17, 0x2bd1, 0x3b1c, 0x2b34, 0x3b1f, 0x2aaa, 0x3b22, 0x2a31, 0x3b23, 0x29c7, 0x3b23, 0x2968,
|
|
13
|
+
0x32d4, 0x3a4b, 0x32dc, 0x3a45, 0x3308, 0x3a26, 0x3378, 0x39d0, 0x3425, 0x394a, 0x34c9, 0x38be, 0x359c, 0x383e, 0x3688, 0x3796, 0x3778, 0x36c4, 0x382f, 0x3603, 0x3898, 0x3553, 0x38f7, 0x34b3, 0x394b, 0x3424, 0x3994, 0x334c, 0x39d3, 0x326c, 0x3a08, 0x31a9, 0x3a35, 0x30fe, 0x3a5a, 0x306a, 0x3a78, 0x2fd1, 0x3a90, 0x2ef1, 0x3aa2, 0x2e2e, 0x3ab0, 0x2d86, 0x3aba, 0x2cf3, 0x3ac1, 0x2c74, 0x3ac4, 0x2c05, 0x3ac4, 0x2b49, 0x3ac2, 0x2aa1, 0x3abd, 0x2a0c, 0x3ab7, 0x298b, 0x3aaf, 0x2918, 0x3aa6, 0x28b3, 0x3a9b, 0x285a,
|
|
14
|
+
0x3559, 0x3954, 0x355a, 0x3951, 0x3566, 0x3944, 0x3582, 0x391e, 0x35b6, 0x38d3, 0x360a, 0x386a, 0x3684, 0x37ed, 0x3720, 0x370d, 0x37d3, 0x3641, 0x3847, 0x3588, 0x38a3, 0x34e2, 0x38fa, 0x344d, 0x3948, 0x3391, 0x398d, 0x32a6, 0x39c8, 0x31d6, 0x39fa, 0x3121, 0x3a22, 0x3082, 0x3a43, 0x2ff0, 0x3a5c, 0x2f01, 0x3a6f, 0x2e32, 0x3a7c, 0x2d7e, 0x3a84, 0x2ce2, 0x3a87, 0x2c5b, 0x3a87, 0x2bcc, 0x3a83, 0x2b00, 0x3a7b, 0x2a4e, 0x3a71, 0x29b3, 0x3a66, 0x292c, 0x3a58, 0x28b4, 0x3a4b, 0x284b, 0x3a3d, 0x27dc, 0x3a2e, 0x2739,
|
|
15
|
+
0x3709, 0x387c, 0x370a, 0x387b, 0x3710, 0x3874, 0x3720, 0x385f, 0x373d, 0x3834, 0x376a, 0x37e1, 0x37ac, 0x3732, 0x3805, 0x3675, 0x383f, 0x35bc, 0x3883, 0x3511, 0x38cb, 0x3476, 0x3912, 0x33d8, 0x3955, 0x32e2, 0x3991, 0x3208, 0x39c6, 0x3149, 0x39f1, 0x30a1, 0x3a15, 0x300f, 0x3a30, 0x2f21, 0x3a44, 0x2e45, 0x3a51, 0x2d87, 0x3a59, 0x2ce2, 0x3a5b, 0x2c53, 0x3a58, 0x2bb0, 0x3a52, 0x2ada, 0x3a49, 0x2a1f, 0x3a40, 0x297d, 0x3a34, 0x28f0, 0x3a25, 0x2874, 0x3a13, 0x2807, 0x3a00, 0x274e, 0x39eb, 0x26a6, 0x39d5, 0x2611,
|
|
16
|
+
0x3840, 0x3780, 0x3840, 0x377e, 0x3842, 0x3776, 0x3846, 0x375e, 0x384f, 0x372a, 0x385b, 0x36d3, 0x386c, 0x3659, 0x3885, 0x35c7, 0x38a8, 0x352d, 0x38d4, 0x3497, 0x3906, 0x340c, 0x393b, 0x331a, 0x3970, 0x323a, 0x39a0, 0x3172, 0x39cb, 0x30c3, 0x39ef, 0x302a, 0x3a0c, 0x2f4a, 0x3a21, 0x2e63, 0x3a2f, 0x2d9b, 0x3a37, 0x2ced, 0x3a39, 0x2c57, 0x3a37, 0x2baa, 0x3a34, 0x2ac9, 0x3a2c, 0x2a05, 0x3a20, 0x295d, 0x3a11, 0x28ca, 0x39ff, 0x2849, 0x39eb, 0x27b2, 0x39d5, 0x26ed, 0x39be, 0x2640, 0x39a5, 0x25aa, 0x398b, 0x2523,
|
|
17
|
+
0x38e2, 0x363b, 0x38e2, 0x363b, 0x38e3, 0x3635, 0x38e6, 0x3626, 0x38ea, 0x3606, 0x38f0, 0x35cd, 0x38f8, 0x3579, 0x3903, 0x350e, 0x3915, 0x3495, 0x392d, 0x3418, 0x394c, 0x3340, 0x3970, 0x3261, 0x3995, 0x3197, 0x39b8, 0x30e4, 0x39d8, 0x3046, 0x39f3, 0x2f76, 0x3a08, 0x2e86, 0x3a16, 0x2db5, 0x3a1e, 0x2cff, 0x3a22, 0x2c61, 0x3a24, 0x2bb3, 0x3a20, 0x2ac7, 0x3a17, 0x29fc, 0x3a0a, 0x294c, 0x39fa, 0x28b2, 0x39e7, 0x282e, 0x39d1, 0x2773, 0x39b9, 0x26a9, 0x399f, 0x25fa, 0x3985, 0x255f, 0x3968, 0x24d6, 0x394a, 0x245d,
|
|
18
|
+
0x396e, 0x3524, 0x396e, 0x3524, 0x396e, 0x3520, 0x396f, 0x3517, 0x3971, 0x3502, 0x3973, 0x34dd, 0x3975, 0x34a5, 0x3978, 0x3458, 0x397e, 0x33f9, 0x3987, 0x3332, 0x3997, 0x326b, 0x39aa, 0x31ac, 0x39c0, 0x30fb, 0x39d7, 0x305c, 0x39eb, 0x2f9e, 0x39fc, 0x2ea7, 0x3a07, 0x2dcf, 0x3a0f, 0x2d13, 0x3a16, 0x2c70, 0x3a17, 0x2bc4, 0x3a14, 0x2ad0, 0x3a0a, 0x29fc, 0x39fd, 0x2945, 0x39ed, 0x28a6, 0x39d9, 0x281d, 0x39c2, 0x274a, 0x39a9, 0x267c, 0x398e, 0x25c7, 0x3971, 0x2528, 0x3952, 0x249e, 0x3931, 0x2425, 0x3910, 0x2374,
|
|
19
|
+
0x39e5, 0x3436, 0x39e5, 0x3435, 0x39e5, 0x3434, 0x39e5, 0x342e, 0x39e5, 0x3420, 0x39e5, 0x3408, 0x39e3, 0x33c4, 0x39e1, 0x3359, 0x39df, 0x32d3, 0x39de, 0x323a, 0x39e1, 0x319a, 0x39e7, 0x30fb, 0x39f0, 0x3065, 0x39f9, 0x2fb6, 0x3a02, 0x2ec0, 0x3a08, 0x2de6, 0x3a0d, 0x2d26, 0x3a12, 0x2c7e, 0x3a13, 0x2bda, 0x3a0e, 0x2adc, 0x3a05, 0x2a02, 0x39f8, 0x2945, 0x39e7, 0x28a1, 0x39d3, 0x2813, 0x39bc, 0x2730, 0x39a2, 0x265c, 0x3985, 0x25a3, 0x3966, 0x2501, 0x3945, 0x2475, 0x3923, 0x23f3, 0x3901, 0x231c, 0x38dd, 0x225e,
|
|
20
|
+
0x3a4b, 0x32d6, 0x3a4a, 0x32d6, 0x3a4a, 0x32d4, 0x3a4a, 0x32cc, 0x3a48, 0x32bb, 0x3a47, 0x329d, 0x3a43, 0x326b, 0x3a3d, 0x3222, 0x3a36, 0x31c2, 0x3a2e, 0x314f, 0x3a28, 0x30d2, 0x3a23, 0x3052, 0x3a20, 0x2fab, 0x3a1e, 0x2ec2, 0x3a1b, 0x2def, 0x3a19, 0x2d31, 0x3a1a, 0x2c89, 0x3a18, 0x2beb, 0x3a11, 0x2aea, 0x3a07, 0x2a0a, 0x39fa, 0x2948, 0x39e9, 0x28a1, 0x39d4, 0x280f, 0x39bd, 0x2721, 0x39a2, 0x2647, 0x3985, 0x258b, 0x3964, 0x24e5, 0x3942, 0x2455, 0x391f, 0x23b3, 0x38fb, 0x22d8, 0x38d4, 0x2219, 0x38ad, 0x2172,
|
|
21
|
+
0x3aa0, 0x3180, 0x3aa0, 0x3180, 0x3aa0, 0x317f, 0x3a9f, 0x317b, 0x3a9d, 0x3170, 0x3a99, 0x315d, 0x3a95, 0x313d, 0x3a8d, 0x310c, 0x3a82, 0x30ca, 0x3a76, 0x3077, 0x3a69, 0x3019, 0x3a5c, 0x2f68, 0x3a4f, 0x2e9e, 0x3a42, 0x2dde, 0x3a37, 0x2d2b, 0x3a30, 0x2c89, 0x3a29, 0x2bef, 0x3a1f, 0x2af0, 0x3a12, 0x2a0f, 0x3a03, 0x294a, 0x39f1, 0x28a0, 0x39dc, 0x280c, 0x39c5, 0x2717, 0x39a9, 0x2638, 0x398b, 0x2578, 0x396a, 0x24d0, 0x3947, 0x243f, 0x3923, 0x2380, 0x38fc, 0x22a4, 0x38d4, 0x21e4, 0x38ac, 0x213c, 0x3883, 0x20a8,
|
|
22
|
+
0x3ae8, 0x3062, 0x3ae8, 0x3062, 0x3ae7, 0x3061, 0x3ae6, 0x305f, 0x3ae4, 0x305a, 0x3ae0, 0x304f, 0x3ada, 0x303b, 0x3ad1, 0x301b, 0x3ac5, 0x2fdd, 0x3ab6, 0x2f6a, 0x3aa4, 0x2ede, 0x3a91, 0x2e45, 0x3a7c, 0x2da5, 0x3a67, 0x2d0a, 0x3a57, 0x2c77, 0x3a48, 0x2bdc, 0x3a38, 0x2ae5, 0x3a27, 0x2a0a, 0x3a16, 0x2947, 0x3a02, 0x289d, 0x39eb, 0x2808, 0x39d3, 0x270d, 0x39b6, 0x262b, 0x3997, 0x256a, 0x3976, 0x24bf, 0x3952, 0x242b, 0x392d, 0x2358, 0x3904, 0x227a, 0x38db, 0x21b8, 0x38b2, 0x2110, 0x3887, 0x207d, 0x385b, 0x1ff6,
|
|
23
|
+
0x3b23, 0x2ee8, 0x3b23, 0x2ee8, 0x3b22, 0x2ee8, 0x3b21, 0x2ee7, 0x3b1f, 0x2ee3, 0x3b1a, 0x2ed6, 0x3b14, 0x2ec1, 0x3b0b, 0x2e99, 0x3afe, 0x2e60, 0x3aee, 0x2e12, 0x3ad8, 0x2dad, 0x3ac1, 0x2d3d, 0x3aa5, 0x2cc3, 0x3a8b, 0x2c48, 0x3a76, 0x2ba2, 0x3a60, 0x2ac0, 0x3a49, 0x29f2, 0x3a32, 0x2938, 0x3a1b, 0x2893, 0x3a02, 0x27ff, 0x39e8, 0x26ff, 0x39ca, 0x261e, 0x39aa, 0x255b, 0x3988, 0x24b0, 0x3964, 0x241c, 0x393d, 0x2336, 0x3913, 0x2257, 0x38e9, 0x2195, 0x38be, 0x20eb, 0x3891, 0x2059, 0x3864, 0x1fae, 0x3837, 0x1ecd,
|
|
24
|
+
0x3b54, 0x2d61, 0x3b54, 0x2d61, 0x3b53, 0x2d61, 0x3b52, 0x2d62, 0x3b4f, 0x2d61, 0x3b4b, 0x2d5c, 0x3b45, 0x2d51, 0x3b3b, 0x2d3d, 0x3b2e, 0x2d1a, 0x3b1d, 0x2ce7, 0x3b06, 0x2ca3, 0x3aeb, 0x2c52, 0x3acb, 0x2bee, 0x3ab0, 0x2b31, 0x3a94, 0x2a74, 0x3a77, 0x29bf, 0x3a5a, 0x2915, 0x3a3f, 0x287a, 0x3a22, 0x27de, 0x3a05, 0x26e4, 0x39e5, 0x2609, 0x39c3, 0x2547, 0x39a0, 0x249f, 0x397b, 0x240c, 0x3953, 0x2314, 0x3928, 0x2238, 0x38fd, 0x2175, 0x38d0, 0x20cb, 0x38a2, 0x2038, 0x3873, 0x1f71, 0x3844, 0x1e90, 0x3815, 0x1dce,
|
|
25
|
+
0x3b7c, 0x2c22, 0x3b7c, 0x2c22, 0x3b7b, 0x2c23, 0x3b7a, 0x2c25, 0x3b77, 0x2c27, 0x3b73, 0x2c26, 0x3b6d, 0x2c23, 0x3b64, 0x2c1a, 0x3b57, 0x2c07, 0x3b46, 0x2bd1, 0x3b2e, 0x2b79, 0x3b0f, 0x2b07, 0x3aef, 0x2a86, 0x3ad1, 0x29f8, 0x3ab0, 0x2967, 0x3a8e, 0x28d7, 0x3a6d, 0x284e, 0x3a4c, 0x279f, 0x3a2b, 0x26b7, 0x3a08, 0x25e5, 0x39e4, 0x252c, 0x39be, 0x2488, 0x3998, 0x23f0, 0x396f, 0x22f2, 0x3943, 0x2215, 0x3917, 0x2155, 0x38e8, 0x20ae, 0x38b9, 0x201c, 0x3888, 0x1f38, 0x3857, 0x1e5a, 0x3826, 0x1d9a, 0x37eb, 0x1cf0,
|
|
26
|
+
0x3b9c, 0x2a43, 0x3b9c, 0x2a43, 0x3b9b, 0x2a46, 0x3b9a, 0x2a4a, 0x3b98, 0x2a50, 0x3b93, 0x2a54, 0x3b8e, 0x2a59, 0x3b85, 0x2a56, 0x3b79, 0x2a45, 0x3b67, 0x2a24, 0x3b4f, 0x29ee, 0x3b2f, 0x29a4, 0x3b10, 0x294b, 0x3aef, 0x28e5, 0x3ac9, 0x2877, 0x3aa4, 0x2809, 0x3a7e, 0x2739, 0x3a59, 0x266d, 0x3a34, 0x25af, 0x3a0c, 0x2503, 0x39e4, 0x2468, 0x39bb, 0x23bb, 0x3990, 0x22c6, 0x3963, 0x21f0, 0x3936, 0x2133, 0x3906, 0x208f, 0x38d5, 0x1ffd, 0x38a3, 0x1f04, 0x3870, 0x1e28, 0x383d, 0x1d69, 0x380b, 0x1cc3, 0x37b0, 0x1c32,
|
|
27
|
+
0x3bb5, 0x28aa, 0x3bb5, 0x28ab, 0x3bb5, 0x28ad, 0x3bb4, 0x28b2, 0x3bb2, 0x28b9, 0x3bae, 0x28c2, 0x3ba8, 0x28ca, 0x3ba0, 0x28d1, 0x3b94, 0x28cd, 0x3b83, 0x28c1, 0x3b6a, 0x28a3, 0x3b4b, 0x2876, 0x3b2d, 0x283d, 0x3b09, 0x27ea, 0x3ae1, 0x274b, 0x3ab9, 0x26a6, 0x3a8f, 0x25fe, 0x3a67, 0x255d, 0x3a3d, 0x24c5, 0x3a11, 0x2439, 0x39e6, 0x2371, 0x39b9, 0x228d, 0x398a, 0x21c1, 0x395a, 0x210b, 0x3929, 0x206c, 0x38f7, 0x1fc1, 0x38c3, 0x1ecb, 0x388f, 0x1df6, 0x385a, 0x1d3a, 0x3825, 0x1c99, 0x37e1, 0x1c08, 0x3779, 0x1b1b,
|
|
28
|
+
0x3bc9, 0x26d3, 0x3bc9, 0x26d4, 0x3bc9, 0x26d9, 0x3bc8, 0x26e3, 0x3bc6, 0x26ef, 0x3bc2, 0x2705, 0x3bbd, 0x271a, 0x3bb6, 0x2731, 0x3baa, 0x273c, 0x3b9a, 0x273d, 0x3b81, 0x2726, 0x3b65, 0x26f7, 0x3b46, 0x26af, 0x3b20, 0x2650, 0x3af7, 0x25e1, 0x3acd, 0x256a, 0x3aa1, 0x24eb, 0x3a75, 0x246f, 0x3a46, 0x23ee, 0x3a17, 0x230d, 0x39e9, 0x223e, 0x39b7, 0x2183, 0x3985, 0x20d8, 0x3953, 0x2043, 0x391e, 0x1f7a, 0x38e9, 0x1e8d, 0x38b3, 0x1dbf, 0x387c, 0x1d0b, 0x3845, 0x1c6c, 0x380e, 0x1bc4, 0x37b0, 0x1ad2, 0x3745, 0x19fd,
|
|
29
|
+
0x3bd9, 0x24e4, 0x3bd9, 0x24e5, 0x3bd9, 0x24e8, 0x3bd8, 0x24f2, 0x3bd5, 0x24fe, 0x3bd2, 0x2512, 0x3bce, 0x252b, 0x3bc6, 0x2544, 0x3bbc, 0x255a, 0x3bac, 0x256b, 0x3b93, 0x2569, 0x3b7a, 0x2557, 0x3b5b, 0x252f, 0x3b34, 0x24f7, 0x3b0c, 0x24ad, 0x3adf, 0x2458, 0x3ab1, 0x23f8, 0x3a82, 0x233f, 0x3a4f, 0x2286, 0x3a1e, 0x21d5, 0x39eb, 0x2130, 0x39b6, 0x2098, 0x3982, 0x200e, 0x394b, 0x1f25, 0x3914, 0x1e45, 0x38dc, 0x1d83, 0x38a3, 0x1cd6, 0x386b, 0x1c3d, 0x3831, 0x1b71, 0x37f2, 0x1a87, 0x3782, 0x19bc, 0x3714, 0x1909,
|
|
30
|
+
0x3be5, 0x22d8, 0x3be5, 0x22d9, 0x3be4, 0x22df, 0x3be4, 0x22ef, 0x3be1, 0x2305, 0x3bde, 0x232a, 0x3bda, 0x2358, 0x3bd4, 0x2392, 0x3bcb, 0x23ca, 0x3bbb, 0x23f4, 0x3ba3, 0x2405, 0x3b8c, 0x2405, 0x3b6c, 0x23ec, 0x3b47, 0x23ae, 0x3b1d, 0x2353, 0x3af0, 0x22e2, 0x3ac0, 0x2261, 0x3a8e, 0x21d9, 0x3a5a, 0x214e, 0x3a26, 0x20c7, 0x39ee, 0x2045, 0x39b7, 0x1f97, 0x397f, 0x1eba, 0x3945, 0x1df0, 0x390b, 0x1d3a, 0x38d0, 0x1c9a, 0x3895, 0x1c0a, 0x385a, 0x1b18, 0x381f, 0x1a39, 0x37c9, 0x1975, 0x3756, 0x18cc, 0x36e6, 0x1836,
|
|
31
|
+
0x3bed, 0x20a8, 0x3bed, 0x20a9, 0x3bed, 0x20ae, 0x3bed, 0x20bb, 0x3beb, 0x20cf, 0x3be8, 0x20ef, 0x3be4, 0x2119, 0x3bde, 0x214f, 0x3bd6, 0x2189, 0x3bc6, 0x21b8, 0x3bb1, 0x21de, 0x3b9a, 0x21f2, 0x3b7b, 0x21f2, 0x3b57, 0x21d8, 0x3b2d, 0x21a4, 0x3b00, 0x215f, 0x3acf, 0x2108, 0x3a99, 0x20a8, 0x3a64, 0x2043, 0x3a2c, 0x1fba, 0x39f2, 0x1ef3, 0x39b8, 0x1e36, 0x397c, 0x1d86, 0x3940, 0x1ce5, 0x3903, 0x1c52, 0x38c6, 0x1b9e, 0x3888, 0x1ab3, 0x384a, 0x19e4, 0x380e, 0x192b, 0x37a3, 0x188b, 0x372d, 0x17f7, 0x36ba, 0x1701,
|
|
32
|
+
0x3bf4, 0x1e23, 0x3bf4, 0x1e25, 0x3bf4, 0x1e2d, 0x3bf3, 0x1e41, 0x3bf1, 0x1e64, 0x3bef, 0x1e9c, 0x3beb, 0x1ee1, 0x3be6, 0x1f40, 0x3bde, 0x1fa7, 0x3bce, 0x2001, 0x3bbd, 0x202f, 0x3ba6, 0x204e, 0x3b88, 0x205f, 0x3b64, 0x205b, 0x3b3b, 0x2044, 0x3b0e, 0x201f, 0x3adb, 0x1fcf, 0x3aa6, 0x1f4e, 0x3a6e, 0x1ec1, 0x3a33, 0x1e2b, 0x39f7, 0x1d95, 0x39ba, 0x1d06, 0x397b, 0x1c7d, 0x393c, 0x1bfc, 0x38fc, 0x1b13, 0x38bc, 0x1a40, 0x387c, 0x1983, 0x383c, 0x18da, 0x37fa, 0x1842, 0x377f, 0x177f, 0x3706, 0x1695, 0x3691, 0x15c8,
|
|
33
|
+
0x3bf8, 0x1bca, 0x3bf8, 0x1bcc, 0x3bf8, 0x1bd8, 0x3bf8, 0x1bf7, 0x3bf6, 0x1c1b, 0x3bf4, 0x1c45, 0x3bf1, 0x1c83, 0x3bec, 0x1cce, 0x3be4, 0x1d21, 0x3bd5, 0x1d78, 0x3bc5, 0x1dd1, 0x3bb0, 0x1e17, 0x3b93, 0x1e4a, 0x3b70, 0x1e5f, 0x3b48, 0x1e57, 0x3b1b, 0x1e35, 0x3ae7, 0x1df6, 0x3ab2, 0x1da4, 0x3a77, 0x1d44, 0x3a3a, 0x1cdb, 0x39fc, 0x1c6e, 0x39bb, 0x1c03, 0x397a, 0x1b35, 0x3938, 0x1a72, 0x38f5, 0x19bb, 0x38b3, 0x1914, 0x3870, 0x187d, 0x382e, 0x17eb, 0x37db, 0x16f9, 0x375c, 0x1621, 0x36e1, 0x1565, 0x3669, 0x14be,
|
|
34
|
+
0x3bfb, 0x18b9, 0x3bfb, 0x18ba, 0x3bfb, 0x18c3, 0x3bfb, 0x18da, 0x3bf9, 0x190a, 0x3bf7, 0x1948, 0x3bf5, 0x19ac, 0x3bf0, 0x1a20, 0x3be9, 0x1ab3, 0x3bdb, 0x1b49, 0x3bcd, 0x1be6, 0x3bb7, 0x1c34, 0x3b9c, 0x1c6d, 0x3b7a, 0x1c8e, 0x3b54, 0x1c9e, 0x3b26, 0x1c96, 0x3af2, 0x1c75, 0x3abc, 0x1c47, 0x3a80, 0x1c09, 0x3a42, 0x1b85, 0x3a01, 0x1aec, 0x39be, 0x1a50, 0x397a, 0x19b5, 0x3935, 0x1921, 0x38f0, 0x1895, 0x38aa, 0x1814, 0x3866, 0x173a, 0x3821, 0x1665, 0x37be, 0x15a4, 0x373c, 0x14f9, 0x36be, 0x1460, 0x3644, 0x13b3,
|
|
35
|
+
0x3bfd, 0x156b, 0x3bfd, 0x156c, 0x3bfd, 0x1578, 0x3bfd, 0x1598, 0x3bfc, 0x15dd, 0x3bfa, 0x163c, 0x3bf7, 0x16cb, 0x3bf3, 0x177b, 0x3beb, 0x1833, 0x3be0, 0x18ad, 0x3bd2, 0x192e, 0x3bbd, 0x19a6, 0x3ba4, 0x1a0c, 0x3b83, 0x1a5a, 0x3b5d, 0x1a8c, 0x3b30, 0x1a9b, 0x3afd, 0x1a86, 0x3ac6, 0x1a5c, 0x3a89, 0x1a11, 0x3a49, 0x19b7, 0x3a06, 0x194f, 0x39c1, 0x18e3, 0x397a, 0x1873, 0x3933, 0x1805, 0x38eb, 0x173a, 0x38a3, 0x1676, 0x385c, 0x15bf, 0x3816, 0x1519, 0x37a2, 0x1482, 0x371d, 0x13f7, 0x369c, 0x1306, 0x3620, 0x1231,
|
|
36
|
+
0x3bff, 0x11cb, 0x3bff, 0x11cd, 0x3bfe, 0x11dd, 0x3bfe, 0x1219, 0x3bfd, 0x126b, 0x3bfb, 0x12e9, 0x3bf9, 0x13c5, 0x3bf5, 0x1460, 0x3bee, 0x150f, 0x3be3, 0x15c9, 0x3bd6, 0x168a, 0x3bc3, 0x174f, 0x3baa, 0x1806, 0x3b8b, 0x184f, 0x3b66, 0x1888, 0x3b39, 0x18a6, 0x3b07, 0x18ad, 0x3acf, 0x189c, 0x3a92, 0x1876, 0x3a50, 0x1840, 0x3a0c, 0x17fd, 0x39c4, 0x176a, 0x397b, 0x16ce, 0x3931, 0x1634, 0x38e6, 0x1599, 0x389c, 0x1508, 0x3852, 0x147f, 0x380a, 0x1401, 0x3788, 0x131c, 0x36ff, 0x124a, 0x367c, 0x1190, 0x35fe, 0x10ea,
|
|
37
|
+
0x3bff, 0x0daa, 0x3bff, 0x0dad, 0x3bff, 0x0dc0, 0x3bff, 0x0e0e, 0x3bfe, 0x0e87, 0x3bfc, 0x0f14, 0x3bfb, 0x1029, 0x3bf7, 0x10d1, 0x3bf0, 0x11d3, 0x3be6, 0x12c9, 0x3bd9, 0x13fc, 0x3bc7, 0x1499, 0x3bb0, 0x152a, 0x3b92, 0x15ab, 0x3b6e, 0x1615, 0x3b42, 0x165a, 0x3b10, 0x1681, 0x3ad8, 0x1683, 0x3a9a, 0x1665, 0x3a57, 0x1629, 0x3a11, 0x15dd, 0x39c8, 0x1580, 0x397c, 0x1518, 0x3930, 0x14ae, 0x38e3, 0x1441, 0x3896, 0x13b1, 0x384a, 0x12e9, 0x37ff, 0x122f, 0x376f, 0x1182, 0x36e3, 0x10e5, 0x365e, 0x1057, 0x35de, 0x0fac,
|
|
38
|
+
0x3c00, 0x08ea, 0x3c00, 0x08ed, 0x3c00, 0x0902, 0x3c00, 0x0961, 0x3bff, 0x09f3, 0x3bfd, 0x0abc, 0x3bfb, 0x0c1f, 0x3bf8, 0x0d15, 0x3bf1, 0x0e5b, 0x3be8, 0x0fb4, 0x3bdc, 0x10b0, 0x3bcb, 0x1190, 0x3bb5, 0x126c, 0x3b97, 0x132c, 0x3b74, 0x13de, 0x3b4a, 0x1432, 0x3b18, 0x145e, 0x3ae0, 0x1472, 0x3aa2, 0x146f, 0x3a5f, 0x1456, 0x3a17, 0x142e, 0x39cc, 0x13ee, 0x397e, 0x136b, 0x392f, 0x12e1, 0x38df, 0x124f, 0x3890, 0x11bd, 0x3842, 0x1131, 0x37eb, 0x10ac, 0x3757, 0x102e, 0x36c9, 0x0f76, 0x3640, 0x0ea3, 0x35bf, 0x0de4,
|
|
39
|
+
0x3c00, 0x039b, 0x3c00, 0x039d, 0x3c00, 0x03b2, 0x3c00, 0x041c, 0x3bff, 0x04be, 0x3bfd, 0x05d6, 0x3bfc, 0x0764, 0x3bf8, 0x08e2, 0x3bf2, 0x0a67, 0x3bea, 0x0c1b, 0x3bde, 0x0d41, 0x3bcd, 0x0e5f, 0x3bb8, 0x0f8c, 0x3b9c, 0x1057, 0x3b7a, 0x10e5, 0x3b51, 0x1155, 0x3b20, 0x11a5, 0x3ae8, 0x11da, 0x3aaa, 0x11ef, 0x3a66, 0x11e5, 0x3a1d, 0x11c1, 0x39d0, 0x1185, 0x3980, 0x113b, 0x392e, 0x10e5, 0x38dc, 0x1087, 0x388b, 0x1028, 0x383b, 0x0f94, 0x37d9, 0x0edb, 0x3741, 0x0e2c, 0x36af, 0x0d89, 0x3625, 0x0cf2, 0x35a1, 0x0c69,
|
|
40
|
+
0x3c00, 0x0107, 0x3c00, 0x0108, 0x3c00, 0x0110, 0x3c00, 0x0145, 0x3bff, 0x0197, 0x3bfe, 0x0224, 0x3bfc, 0x030c, 0x3bf8, 0x0478, 0x3bf3, 0x062c, 0x3beb, 0x0833, 0x3be0, 0x0979, 0x3bd0, 0x0aeb, 0x3bbc, 0x0c3d, 0x3ba0, 0x0d01, 0x3b80, 0x0dbd, 0x3b57, 0x0e69, 0x3b27, 0x0eeb, 0x3af0, 0x0f53, 0x3ab1, 0x0f8a, 0x3a6c, 0x0f9f, 0x3a22, 0x0f8b, 0x39d4, 0x0f5b, 0x3982, 0x0f0f, 0x392f, 0x0eac, 0x38da, 0x0e3d, 0x3886, 0x0dc9, 0x3834, 0x0d51, 0x37c7, 0x0cd9, 0x372c, 0x0c65, 0x3697, 0x0bef, 0x360a, 0x0b20, 0x3585, 0x0a62,
|
|
41
|
+
0x3c00, 0x0031, 0x3c00, 0x0031, 0x3c00, 0x0034, 0x3c00, 0x004b, 0x3bff, 0x006f, 0x3bfe, 0x00c9, 0x3bfc, 0x011b, 0x3bf9, 0x0207, 0x3bf4, 0x02d6, 0x3bec, 0x0415, 0x3be1, 0x0587, 0x3bd2, 0x0703, 0x3bbf, 0x087d, 0x3ba5, 0x096a, 0x3b85, 0x0a59, 0x3b5d, 0x0b32, 0x3b2e, 0x0bee, 0x3af7, 0x0c44, 0x3ab8, 0x0c7c, 0x3a73, 0x0c9c, 0x3a28, 0x0ca4, 0x39d8, 0x0c98, 0x3985, 0x0c77, 0x392f, 0x0c4a, 0x38d9, 0x0c10, 0x3882, 0x0ba0, 0x382e, 0x0b14, 0x37b6, 0x0a84, 0x3717, 0x09f5, 0x3680, 0x0969, 0x35f0, 0x08e6, 0x356a, 0x086a,
|
|
42
|
+
0x3c00, 0x0004, 0x3c00, 0x0004, 0x3c00, 0x0004, 0x3c00, 0x000d, 0x3bff, 0x0021, 0x3bfe, 0x003b, 0x3bfd, 0x0070, 0x3bf9, 0x00c7, 0x3bf4, 0x012e, 0x3bed, 0x01c8, 0x3be3, 0x0274, 0x3bd4, 0x033b, 0x3bc1, 0x043a, 0x3ba8, 0x0534, 0x3b89, 0x0641, 0x3b62, 0x073b, 0x3b34, 0x0815, 0x3afd, 0x087c, 0x3abf, 0x08d0, 0x3a7a, 0x090a, 0x3a2e, 0x092c, 0x39dd, 0x0936, 0x3988, 0x0928, 0x3930, 0x0907, 0x38d7, 0x08d7, 0x387f, 0x089b, 0x3828, 0x0855, 0x37a7, 0x080b, 0x3704, 0x077b, 0x366a, 0x06e1, 0x35d8, 0x0649, 0x3550, 0x05b8,
|
|
43
|
+
0x3c00, 0x0000, 0x3c00, 0x0000, 0x3c00, 0x0000, 0x3c00, 0x0003, 0x3bff, 0x0012, 0x3bfe, 0x001a, 0x3bfd, 0x0035, 0x3bfa, 0x0050, 0x3bf4, 0x0061, 0x3bed, 0x00a5, 0x3be4, 0x00ee, 0x3bd6, 0x0146, 0x3bc3, 0x01ab, 0x3bab, 0x0211, 0x3b8d, 0x028e, 0x3b67, 0x0303, 0x3b39, 0x0375, 0x3b04, 0x03e2, 0x3ac6, 0x0441, 0x3a80, 0x0492, 0x3a34, 0x04cd, 0x39e1, 0x04f2, 0x398b, 0x0504, 0x3931, 0x0502, 0x38d6, 0x04ec, 0x387c, 0x04c7, 0x3822, 0x0496, 0x3798, 0x045c, 0x36f2, 0x041a, 0x3655, 0x03d5, 0x35c1, 0x038e, 0x3537, 0x0347
|
|
44
|
+
] );
|
|
45
|
+
|
|
46
|
+
let lut = null;
|
|
47
|
+
|
|
48
|
+
export function getDFGLUT() {
|
|
49
|
+
|
|
50
|
+
if ( lut === null ) {
|
|
51
|
+
|
|
52
|
+
lut = new DataTexture( DATA, 32, 32, RGFormat, HalfFloatType );
|
|
53
|
+
lut.minFilter = LinearFilter;
|
|
54
|
+
lut.magFilter = LinearFilter;
|
|
55
|
+
lut.wrapS = ClampToEdgeWrapping;
|
|
56
|
+
lut.wrapT = ClampToEdgeWrapping;
|
|
57
|
+
lut.generateMipmaps = false;
|
|
58
|
+
lut.needsUpdate = true;
|
|
59
|
+
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
return lut;
|
|
63
|
+
|
|
64
|
+
}
|
|
@@ -73,18 +73,6 @@ vec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {
|
|
|
73
73
|
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
-
mat3 transposeMat3( const in mat3 m ) {
|
|
77
|
-
|
|
78
|
-
mat3 tmp;
|
|
79
|
-
|
|
80
|
-
tmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );
|
|
81
|
-
tmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );
|
|
82
|
-
tmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );
|
|
83
|
-
|
|
84
|
-
return tmp;
|
|
85
|
-
|
|
86
|
-
}
|
|
87
|
-
|
|
88
76
|
bool isPerspectiveMatrix( mat4 m ) {
|
|
89
77
|
|
|
90
78
|
return m[ 2 ][ 3 ] == - 1.0;
|
|
@@ -26,7 +26,7 @@ export default /* glsl */`
|
|
|
26
26
|
vec3 reflectVec = reflect( - viewDir, normal );
|
|
27
27
|
|
|
28
28
|
// Mixing the reflection with the normal is more accurate and keeps rough objects from gathering light from behind their tangent plane.
|
|
29
|
-
reflectVec = normalize( mix( reflectVec, normal, roughness
|
|
29
|
+
reflectVec = normalize( mix( reflectVec, normal, pow4( roughness ) ) );
|
|
30
30
|
|
|
31
31
|
reflectVec = inverseTransformDirection( reflectVec, viewMatrix );
|
|
32
32
|
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export default /* glsl */`
|
|
2
2
|
|
|
3
|
+
uniform sampler2D dfgLUT;
|
|
4
|
+
|
|
3
5
|
struct PhysicalMaterial {
|
|
4
6
|
|
|
5
7
|
vec3 diffuseColor;
|
|
@@ -260,7 +262,7 @@ vec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in m
|
|
|
260
262
|
T2 = - cross( N, T1 ); // negated from paper; possibly due to a different handedness of world coordinate system
|
|
261
263
|
|
|
262
264
|
// compute transform
|
|
263
|
-
mat3 mat = mInv *
|
|
265
|
+
mat3 mat = mInv * transpose( mat3( T1, T2, N ) );
|
|
264
266
|
|
|
265
267
|
// transform rect
|
|
266
268
|
vec3 coords[ 4 ];
|
|
@@ -370,25 +372,15 @@ float IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float
|
|
|
370
372
|
|
|
371
373
|
}
|
|
372
374
|
|
|
373
|
-
//
|
|
374
|
-
//
|
|
375
|
-
//
|
|
376
|
-
//
|
|
375
|
+
// DFG LUT sampling for physically-based rendering.
|
|
376
|
+
// Uses a precomputed lookup table for the split-sum approximation
|
|
377
|
+
// used in indirect specular lighting.
|
|
378
|
+
// Reference: "Real Shading in Unreal Engine 4" by Brian Karis
|
|
377
379
|
vec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {
|
|
378
380
|
|
|
379
381
|
float dotNV = saturate( dot( normal, viewDir ) );
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
const vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );
|
|
384
|
-
|
|
385
|
-
vec4 r = roughness * c0 + c1;
|
|
386
|
-
|
|
387
|
-
float a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;
|
|
388
|
-
|
|
389
|
-
vec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw;
|
|
390
|
-
|
|
391
|
-
return fab;
|
|
382
|
+
vec2 uv = vec2( roughness, dotNV );
|
|
383
|
+
return texture2D( dfgLUT, uv ).rg;
|
|
392
384
|
|
|
393
385
|
}
|
|
394
386
|
|
|
@@ -434,6 +426,48 @@ void computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const
|
|
|
434
426
|
|
|
435
427
|
}
|
|
436
428
|
|
|
429
|
+
// GGX BRDF with multi-scattering energy compensation for direct lighting
|
|
430
|
+
// Based on "Practical Multiple Scattering Compensation for Microfacet Models"
|
|
431
|
+
// https://blog.selfshadow.com/publications/turquin/ms_comp_final.pdf
|
|
432
|
+
vec3 BRDF_GGX_Multiscatter( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {
|
|
433
|
+
|
|
434
|
+
// Single-scattering BRDF (standard GGX)
|
|
435
|
+
vec3 singleScatter = BRDF_GGX( lightDir, viewDir, normal, material );
|
|
436
|
+
|
|
437
|
+
// Multi-scattering compensation
|
|
438
|
+
float dotNL = saturate( dot( normal, lightDir ) );
|
|
439
|
+
float dotNV = saturate( dot( normal, viewDir ) );
|
|
440
|
+
|
|
441
|
+
// Precomputed DFG values for view and light directions
|
|
442
|
+
vec2 dfgV = DFGApprox( vec3(0.0, 0.0, 1.0), vec3(sqrt(1.0 - dotNV * dotNV), 0.0, dotNV), material.roughness );
|
|
443
|
+
vec2 dfgL = DFGApprox( vec3(0.0, 0.0, 1.0), vec3(sqrt(1.0 - dotNL * dotNL), 0.0, dotNL), material.roughness );
|
|
444
|
+
|
|
445
|
+
// Single-scattering energy for view and light
|
|
446
|
+
vec3 FssEss_V = material.specularColor * dfgV.x + material.specularF90 * dfgV.y;
|
|
447
|
+
vec3 FssEss_L = material.specularColor * dfgL.x + material.specularF90 * dfgL.y;
|
|
448
|
+
|
|
449
|
+
float Ess_V = dfgV.x + dfgV.y;
|
|
450
|
+
float Ess_L = dfgL.x + dfgL.y;
|
|
451
|
+
|
|
452
|
+
// Energy lost to multiple scattering
|
|
453
|
+
float Ems_V = 1.0 - Ess_V;
|
|
454
|
+
float Ems_L = 1.0 - Ess_L;
|
|
455
|
+
|
|
456
|
+
// Average Fresnel reflectance
|
|
457
|
+
vec3 Favg = material.specularColor + ( 1.0 - material.specularColor ) * 0.047619; // 1/21
|
|
458
|
+
|
|
459
|
+
// Multiple scattering contribution
|
|
460
|
+
vec3 Fms = FssEss_V * FssEss_L * Favg / ( 1.0 - Ems_V * Ems_L * Favg * Favg + EPSILON );
|
|
461
|
+
|
|
462
|
+
// Energy compensation factor
|
|
463
|
+
float compensationFactor = Ems_V * Ems_L;
|
|
464
|
+
|
|
465
|
+
vec3 multiScatter = Fms * compensationFactor;
|
|
466
|
+
|
|
467
|
+
return singleScatter + multiScatter;
|
|
468
|
+
|
|
469
|
+
}
|
|
470
|
+
|
|
437
471
|
#if NUM_RECT_AREA_LIGHTS > 0
|
|
438
472
|
|
|
439
473
|
void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {
|
|
@@ -498,7 +532,7 @@ void RE_Direct_Physical( const in IncidentLight directLight, const in vec3 geome
|
|
|
498
532
|
|
|
499
533
|
#endif
|
|
500
534
|
|
|
501
|
-
reflectedLight.directSpecular += irradiance *
|
|
535
|
+
reflectedLight.directSpecular += irradiance * BRDF_GGX_Multiscatter( directLight.direction, geometryViewDir, geometryNormal, material );
|
|
502
536
|
|
|
503
537
|
reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
|
|
504
538
|
}
|
|
@@ -65,17 +65,19 @@ export default /* glsl */`
|
|
|
65
65
|
|
|
66
66
|
#endif
|
|
67
67
|
|
|
68
|
-
|
|
69
|
-
#if NUM_RECT_AREA_LIGHTS > 0
|
|
68
|
+
float texture2DCompare( sampler2D depths, vec2 uv, float compare ) {
|
|
70
69
|
|
|
71
|
-
|
|
70
|
+
float depth = unpackRGBAToDepth( texture2D( depths, uv ) );
|
|
72
71
|
|
|
73
|
-
|
|
74
|
-
*/
|
|
72
|
+
#ifdef USE_REVERSED_DEPTH_BUFFER
|
|
75
73
|
|
|
76
|
-
|
|
74
|
+
return step( depth, compare );
|
|
77
75
|
|
|
78
|
-
|
|
76
|
+
#else
|
|
77
|
+
|
|
78
|
+
return step( compare, depth );
|
|
79
|
+
|
|
80
|
+
#endif
|
|
79
81
|
|
|
80
82
|
}
|
|
81
83
|
|
|
@@ -85,17 +87,25 @@ export default /* glsl */`
|
|
|
85
87
|
|
|
86
88
|
}
|
|
87
89
|
|
|
88
|
-
float VSMShadow
|
|
90
|
+
float VSMShadow( sampler2D shadow, vec2 uv, float compare ) {
|
|
89
91
|
|
|
90
92
|
float occlusion = 1.0;
|
|
91
93
|
|
|
92
94
|
vec2 distribution = texture2DDistribution( shadow, uv );
|
|
93
95
|
|
|
94
|
-
|
|
96
|
+
#ifdef USE_REVERSED_DEPTH_BUFFER
|
|
97
|
+
|
|
98
|
+
float hard_shadow = step( distribution.x, compare );
|
|
99
|
+
|
|
100
|
+
#else
|
|
101
|
+
|
|
102
|
+
float hard_shadow = step( compare, distribution.x );
|
|
103
|
+
|
|
104
|
+
#endif
|
|
95
105
|
|
|
96
|
-
if (hard_shadow != 1.0 ) {
|
|
106
|
+
if ( hard_shadow != 1.0 ) {
|
|
97
107
|
|
|
98
|
-
float distance = compare - distribution.x
|
|
108
|
+
float distance = compare - distribution.x;
|
|
99
109
|
float variance = max( 0.00000, distribution.y * distribution.y );
|
|
100
110
|
float softness_probability = variance / (variance + distance * distance ); // Chebeyshevs inequality
|
|
101
111
|
softness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 ); // 0.3 reduces light bleed
|
|
@@ -80,8 +80,17 @@ void main() {
|
|
|
80
80
|
|
|
81
81
|
#include <logdepthbuf_fragment>
|
|
82
82
|
|
|
83
|
-
// Higher precision equivalent of gl_FragCoord.z
|
|
84
|
-
|
|
83
|
+
// Higher precision equivalent of gl_FragCoord.z
|
|
84
|
+
|
|
85
|
+
#ifdef USE_REVERSED_DEPTH_BUFFER
|
|
86
|
+
|
|
87
|
+
float fragCoordZ = vHighPrecisionZW[ 0 ] / vHighPrecisionZW[ 1 ];
|
|
88
|
+
|
|
89
|
+
#else
|
|
90
|
+
|
|
91
|
+
float fragCoordZ = 0.5 * vHighPrecisionZW[ 0 ] / vHighPrecisionZW[ 1 ] + 0.5;
|
|
92
|
+
|
|
93
|
+
#endif
|
|
85
94
|
|
|
86
95
|
#if DEPTH_PACKING == 3200
|
|
87
96
|
|
|
@@ -1,7 +1,20 @@
|
|
|
1
1
|
import { ColorManagement } from '../../math/ColorManagement.js';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import { warn } from '../../utils.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Provides utility functions for managing uniforms.
|
|
6
|
+
*
|
|
7
|
+
* @module UniformsUtils
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Clones the given uniform definitions by performing a deep-copy. That means
|
|
12
|
+
* if the value of a uniform refers to an object like a Vector3 or Texture,
|
|
13
|
+
* the cloned uniform will refer to a new object reference.
|
|
14
|
+
*
|
|
15
|
+
* @param {Object} src - An object representing uniform definitions.
|
|
16
|
+
* @return {Object} The cloned uniforms.
|
|
17
|
+
*/
|
|
5
18
|
export function cloneUniforms( src ) {
|
|
6
19
|
|
|
7
20
|
const dst = {};
|
|
@@ -21,7 +34,7 @@ export function cloneUniforms( src ) {
|
|
|
21
34
|
|
|
22
35
|
if ( property.isRenderTargetTexture ) {
|
|
23
36
|
|
|
24
|
-
|
|
37
|
+
warn( 'UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms().' );
|
|
25
38
|
dst[ u ][ p ] = null;
|
|
26
39
|
|
|
27
40
|
} else {
|
|
@@ -48,6 +61,14 @@ export function cloneUniforms( src ) {
|
|
|
48
61
|
|
|
49
62
|
}
|
|
50
63
|
|
|
64
|
+
/**
|
|
65
|
+
* Merges the given uniform definitions into a single object. Since the
|
|
66
|
+
* method internally uses cloneUniforms(), it performs a deep-copy when
|
|
67
|
+
* producing the merged uniform definitions.
|
|
68
|
+
*
|
|
69
|
+
* @param {Array} uniforms - An array of objects containing uniform definitions.
|
|
70
|
+
* @return {Object} The merged uniforms.
|
|
71
|
+
*/
|
|
51
72
|
export function mergeUniforms( uniforms ) {
|
|
52
73
|
|
|
53
74
|
const merged = {};
|
|
@@ -21,6 +21,10 @@ function WebGLAttributes( gl ) {
|
|
|
21
21
|
|
|
22
22
|
type = gl.FLOAT;
|
|
23
23
|
|
|
24
|
+
} else if ( typeof Float16Array !== 'undefined' && array instanceof Float16Array ) {
|
|
25
|
+
|
|
26
|
+
type = gl.HALF_FLOAT;
|
|
27
|
+
|
|
24
28
|
} else if ( array instanceof Uint16Array ) {
|
|
25
29
|
|
|
26
30
|
if ( attribute.isFloat16BufferAttribute ) {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { FloatType, HalfFloatType, RGBAFormat, UnsignedByteType } from '../../constants.js';
|
|
2
|
+
import { warn } from '../../utils.js';
|
|
2
3
|
|
|
3
4
|
function WebGLCapabilities( gl, extensions, parameters, utils ) {
|
|
4
5
|
|
|
@@ -86,13 +87,13 @@ function WebGLCapabilities( gl, extensions, parameters, utils ) {
|
|
|
86
87
|
|
|
87
88
|
if ( maxPrecision !== precision ) {
|
|
88
89
|
|
|
89
|
-
|
|
90
|
+
warn( 'WebGLRenderer:', precision, 'not supported, using', maxPrecision, 'instead.' );
|
|
90
91
|
precision = maxPrecision;
|
|
91
92
|
|
|
92
93
|
}
|
|
93
94
|
|
|
94
95
|
const logarithmicDepthBuffer = parameters.logarithmicDepthBuffer === true;
|
|
95
|
-
const
|
|
96
|
+
const reversedDepthBuffer = parameters.reversedDepthBuffer === true && extensions.has( 'EXT_clip_control' );
|
|
96
97
|
|
|
97
98
|
const maxTextures = gl.getParameter( gl.MAX_TEXTURE_IMAGE_UNITS );
|
|
98
99
|
const maxVertexTextures = gl.getParameter( gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS );
|
|
@@ -120,7 +121,7 @@ function WebGLCapabilities( gl, extensions, parameters, utils ) {
|
|
|
120
121
|
|
|
121
122
|
precision: precision,
|
|
122
123
|
logarithmicDepthBuffer: logarithmicDepthBuffer,
|
|
123
|
-
|
|
124
|
+
reversedDepthBuffer: reversedDepthBuffer,
|
|
124
125
|
|
|
125
126
|
maxTextures: maxTextures,
|
|
126
127
|
maxVertexTextures: maxVertexTextures,
|
|
@@ -12,30 +12,7 @@ function WebGLExtensions( gl ) {
|
|
|
12
12
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
switch ( name ) {
|
|
18
|
-
|
|
19
|
-
case 'WEBGL_depth_texture':
|
|
20
|
-
extension = gl.getExtension( 'WEBGL_depth_texture' ) || gl.getExtension( 'MOZ_WEBGL_depth_texture' ) || gl.getExtension( 'WEBKIT_WEBGL_depth_texture' );
|
|
21
|
-
break;
|
|
22
|
-
|
|
23
|
-
case 'EXT_texture_filter_anisotropic':
|
|
24
|
-
extension = gl.getExtension( 'EXT_texture_filter_anisotropic' ) || gl.getExtension( 'MOZ_EXT_texture_filter_anisotropic' ) || gl.getExtension( 'WEBKIT_EXT_texture_filter_anisotropic' );
|
|
25
|
-
break;
|
|
26
|
-
|
|
27
|
-
case 'WEBGL_compressed_texture_s3tc':
|
|
28
|
-
extension = gl.getExtension( 'WEBGL_compressed_texture_s3tc' ) || gl.getExtension( 'MOZ_WEBGL_compressed_texture_s3tc' ) || gl.getExtension( 'WEBKIT_WEBGL_compressed_texture_s3tc' );
|
|
29
|
-
break;
|
|
30
|
-
|
|
31
|
-
case 'WEBGL_compressed_texture_pvrtc':
|
|
32
|
-
extension = gl.getExtension( 'WEBGL_compressed_texture_pvrtc' ) || gl.getExtension( 'WEBKIT_WEBGL_compressed_texture_pvrtc' );
|
|
33
|
-
break;
|
|
34
|
-
|
|
35
|
-
default:
|
|
36
|
-
extension = gl.getExtension( name );
|
|
37
|
-
|
|
38
|
-
}
|
|
15
|
+
const extension = gl.getExtension( name );
|
|
39
16
|
|
|
40
17
|
extensions[ name ] = extension;
|
|
41
18
|
|
|
@@ -68,7 +45,7 @@ function WebGLExtensions( gl ) {
|
|
|
68
45
|
|
|
69
46
|
if ( extension === null ) {
|
|
70
47
|
|
|
71
|
-
warnOnce( '
|
|
48
|
+
warnOnce( 'WebGLRenderer: ' + name + ' extension not supported.' );
|
|
72
49
|
|
|
73
50
|
}
|
|
74
51
|
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { error } from '../../utils.js';
|
|
2
|
+
|
|
1
3
|
function WebGLInfo( gl ) {
|
|
2
4
|
|
|
3
5
|
const memory = {
|
|
@@ -40,7 +42,7 @@ function WebGLInfo( gl ) {
|
|
|
40
42
|
break;
|
|
41
43
|
|
|
42
44
|
default:
|
|
43
|
-
|
|
45
|
+
error( 'WebGLInfo: Unknown draw mode:', mode );
|
|
44
46
|
break;
|
|
45
47
|
|
|
46
48
|
}
|
|
@@ -5,6 +5,7 @@ import { NoToneMapping, AddOperation, MixOperation, MultiplyOperation, CubeRefra
|
|
|
5
5
|
import { ColorManagement } from '../../math/ColorManagement.js';
|
|
6
6
|
import { Vector3 } from '../../math/Vector3.js';
|
|
7
7
|
import { Matrix3 } from '../../math/Matrix3.js';
|
|
8
|
+
import { warn, error } from '../../utils.js';
|
|
8
9
|
|
|
9
10
|
// From https://www.khronos.org/registry/webgl/extensions/KHR_parallel_shader_compile/
|
|
10
11
|
const COMPLETION_STATUS_KHR = 0x91B1;
|
|
@@ -47,7 +48,7 @@ function getEncodingComponents( colorSpace ) {
|
|
|
47
48
|
return [ encodingMatrix, 'sRGBTransferOETF' ];
|
|
48
49
|
|
|
49
50
|
default:
|
|
50
|
-
|
|
51
|
+
warn( 'WebGLProgram: Unsupported color space: ', colorSpace );
|
|
51
52
|
return [ encodingMatrix, 'LinearTransferOETF' ];
|
|
52
53
|
|
|
53
54
|
}
|
|
@@ -57,7 +58,9 @@ function getEncodingComponents( colorSpace ) {
|
|
|
57
58
|
function getShaderErrors( gl, shader, type ) {
|
|
58
59
|
|
|
59
60
|
const status = gl.getShaderParameter( shader, gl.COMPILE_STATUS );
|
|
60
|
-
|
|
61
|
+
|
|
62
|
+
const shaderInfoLog = gl.getShaderInfoLog( shader ) || '';
|
|
63
|
+
const errors = shaderInfoLog.trim();
|
|
61
64
|
|
|
62
65
|
if ( status && errors === '' ) return '';
|
|
63
66
|
|
|
@@ -65,7 +68,7 @@ function getShaderErrors( gl, shader, type ) {
|
|
|
65
68
|
if ( errorMatches ) {
|
|
66
69
|
|
|
67
70
|
// --enable-privileged-webgl-extension
|
|
68
|
-
//
|
|
71
|
+
// log( '**' + type + '**', gl.getExtension( 'WEBGL_debug_shaders' ).getTranslatedShaderSource( shader ) );
|
|
69
72
|
|
|
70
73
|
const errorLine = parseInt( errorMatches[ 1 ] );
|
|
71
74
|
return type.toUpperCase() + '\n\n' + errors + '\n\n' + handleSource( gl.getShaderSource( shader ), errorLine );
|
|
@@ -129,7 +132,7 @@ function getToneMappingFunction( functionName, toneMapping ) {
|
|
|
129
132
|
break;
|
|
130
133
|
|
|
131
134
|
default:
|
|
132
|
-
|
|
135
|
+
warn( 'WebGLProgram: Unsupported toneMapping:', toneMapping );
|
|
133
136
|
toneMappingName = 'Linear';
|
|
134
137
|
|
|
135
138
|
}
|
|
@@ -207,7 +210,7 @@ function fetchAttributeLocations( gl, program ) {
|
|
|
207
210
|
if ( info.type === gl.FLOAT_MAT3 ) locationSize = 3;
|
|
208
211
|
if ( info.type === gl.FLOAT_MAT4 ) locationSize = 4;
|
|
209
212
|
|
|
210
|
-
//
|
|
213
|
+
// log( 'WebGLProgram: ACTIVE VERTEX ATTRIBUTE:', name, i );
|
|
211
214
|
|
|
212
215
|
attributes[ name ] = {
|
|
213
216
|
type: info.type,
|
|
@@ -277,7 +280,7 @@ function includeReplacer( match, include ) {
|
|
|
277
280
|
if ( newInclude !== undefined ) {
|
|
278
281
|
|
|
279
282
|
string = ShaderChunk[ newInclude ];
|
|
280
|
-
|
|
283
|
+
warn( 'WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.', include, newInclude );
|
|
281
284
|
|
|
282
285
|
} else {
|
|
283
286
|
|
|
@@ -473,7 +476,7 @@ function generateCubeUVSize( parameters ) {
|
|
|
473
476
|
function WebGLProgram( renderer, cacheKey, parameters, bindingStates ) {
|
|
474
477
|
|
|
475
478
|
// TODO Send this event to Three.js DevTools
|
|
476
|
-
//
|
|
479
|
+
// log( 'WebGLProgram', cacheKey );
|
|
477
480
|
|
|
478
481
|
const gl = renderer.getContext();
|
|
479
482
|
|
|
@@ -653,8 +656,8 @@ function WebGLProgram( renderer, cacheKey, parameters, bindingStates ) {
|
|
|
653
656
|
|
|
654
657
|
parameters.numLightProbes > 0 ? '#define USE_LIGHT_PROBES' : '',
|
|
655
658
|
|
|
656
|
-
parameters.logarithmicDepthBuffer ? '#define
|
|
657
|
-
parameters.
|
|
659
|
+
parameters.logarithmicDepthBuffer ? '#define USE_LOGARITHMIC_DEPTH_BUFFER' : '',
|
|
660
|
+
parameters.reversedDepthBuffer ? '#define USE_REVERSED_DEPTH_BUFFER' : '',
|
|
658
661
|
|
|
659
662
|
'uniform mat4 modelMatrix;',
|
|
660
663
|
'uniform mat4 modelViewMatrix;',
|
|
@@ -820,8 +823,8 @@ function WebGLProgram( renderer, cacheKey, parameters, bindingStates ) {
|
|
|
820
823
|
parameters.decodeVideoTexture ? '#define DECODE_VIDEO_TEXTURE' : '',
|
|
821
824
|
parameters.decodeVideoTextureEmissive ? '#define DECODE_VIDEO_TEXTURE_EMISSIVE' : '',
|
|
822
825
|
|
|
823
|
-
parameters.logarithmicDepthBuffer ? '#define
|
|
824
|
-
parameters.
|
|
826
|
+
parameters.logarithmicDepthBuffer ? '#define USE_LOGARITHMIC_DEPTH_BUFFER' : '',
|
|
827
|
+
parameters.reversedDepthBuffer ? '#define USE_REVERSED_DEPTH_BUFFER' : '',
|
|
825
828
|
|
|
826
829
|
'uniform mat4 viewMatrix;',
|
|
827
830
|
'uniform vec3 cameraPosition;',
|
|
@@ -938,8 +941,8 @@ function WebGLProgram( renderer, cacheKey, parameters, bindingStates ) {
|
|
|
938
941
|
const vertexGlsl = versionString + prefixVertex + vertexShader;
|
|
939
942
|
const fragmentGlsl = versionString + prefixFragment + fragmentShader;
|
|
940
943
|
|
|
941
|
-
//
|
|
942
|
-
//
|
|
944
|
+
// log( '*VERTEX*', vertexGlsl );
|
|
945
|
+
// log( '*FRAGMENT*', fragmentGlsl );
|
|
943
946
|
|
|
944
947
|
const glVertexShader = WebGLShader( gl, gl.VERTEX_SHADER, vertexGlsl );
|
|
945
948
|
const glFragmentShader = WebGLShader( gl, gl.FRAGMENT_SHADER, fragmentGlsl );
|
|
@@ -967,9 +970,13 @@ function WebGLProgram( renderer, cacheKey, parameters, bindingStates ) {
|
|
|
967
970
|
// check for link errors
|
|
968
971
|
if ( renderer.debug.checkShaderErrors ) {
|
|
969
972
|
|
|
970
|
-
const
|
|
971
|
-
const
|
|
972
|
-
const
|
|
973
|
+
const programInfoLog = gl.getProgramInfoLog( program ) || '';
|
|
974
|
+
const vertexShaderInfoLog = gl.getShaderInfoLog( glVertexShader ) || '';
|
|
975
|
+
const fragmentShaderInfoLog = gl.getShaderInfoLog( glFragmentShader ) || '';
|
|
976
|
+
|
|
977
|
+
const programLog = programInfoLog.trim();
|
|
978
|
+
const vertexLog = vertexShaderInfoLog.trim();
|
|
979
|
+
const fragmentLog = fragmentShaderInfoLog.trim();
|
|
973
980
|
|
|
974
981
|
let runnable = true;
|
|
975
982
|
let haveDiagnostics = true;
|
|
@@ -989,7 +996,7 @@ function WebGLProgram( renderer, cacheKey, parameters, bindingStates ) {
|
|
|
989
996
|
const vertexErrors = getShaderErrors( gl, glVertexShader, 'vertex' );
|
|
990
997
|
const fragmentErrors = getShaderErrors( gl, glFragmentShader, 'fragment' );
|
|
991
998
|
|
|
992
|
-
|
|
999
|
+
error(
|
|
993
1000
|
'THREE.WebGLProgram: Shader Error ' + gl.getError() + ' - ' +
|
|
994
1001
|
'VALIDATE_STATUS ' + gl.getProgramParameter( program, gl.VALIDATE_STATUS ) + '\n\n' +
|
|
995
1002
|
'Material Name: ' + self.name + '\n' +
|
|
@@ -1003,7 +1010,7 @@ function WebGLProgram( renderer, cacheKey, parameters, bindingStates ) {
|
|
|
1003
1010
|
|
|
1004
1011
|
} else if ( programLog !== '' ) {
|
|
1005
1012
|
|
|
1006
|
-
|
|
1013
|
+
warn( 'WebGLProgram: Program Info Log:', programLog );
|
|
1007
1014
|
|
|
1008
1015
|
} else if ( vertexLog === '' || fragmentLog === '' ) {
|
|
1009
1016
|
|