angular-three-soba 2.0.0-beta.4 → 2.0.0-beta.41
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/abstractions/billboard/billboard.d.ts +12 -8
- package/abstractions/detailed/detailed.d.ts +26 -0
- package/abstractions/edges/edges.d.ts +24 -12
- package/abstractions/grid/grid.d.ts +42 -51
- package/abstractions/index.d.ts +1 -7
- package/abstractions/text/text.d.ts +10 -4
- package/abstractions/text-3d/text-3d.d.ts +51 -41
- package/cameras/camera/camera-content.d.ts +1 -1
- package/cameras/camera/camera.d.ts +16 -13
- package/cameras/cube-camera/cube-camera.d.ts +49 -23
- package/cameras/index.d.ts +0 -1
- package/cameras/orthographic-camera/orthographic-camera.d.ts +29 -18
- package/cameras/perspective-camera/perspective-camera.d.ts +10 -1
- package/controls/orbit-controls/orbit-controls.d.ts +34 -15
- package/esm2022/abstractions/billboard/billboard.mjs +36 -33
- package/esm2022/abstractions/detailed/detailed.mjs +64 -0
- package/esm2022/abstractions/edges/edges.mjs +58 -63
- package/esm2022/abstractions/grid/grid.mjs +140 -110
- package/esm2022/abstractions/index.mjs +2 -8
- package/esm2022/abstractions/text/text.mjs +123 -122
- package/esm2022/abstractions/text-3d/text-3d.mjs +120 -115
- package/esm2022/cameras/camera/camera-content.mjs +6 -6
- package/esm2022/cameras/camera/camera.mjs +48 -42
- package/esm2022/cameras/cube-camera/cube-camera.mjs +120 -100
- package/esm2022/cameras/index.mjs +1 -2
- package/esm2022/cameras/orthographic-camera/orthographic-camera.mjs +78 -75
- package/esm2022/cameras/perspective-camera/perspective-camera.mjs +25 -26
- package/esm2022/controls/orbit-controls/orbit-controls.mjs +109 -85
- package/esm2022/gizmos/angular-three-soba-gizmos.mjs +5 -0
- package/esm2022/gizmos/gizmo-helper/gizmo-helper.mjs +198 -0
- package/esm2022/gizmos/gizmo-helper/gizmo-viewcube/constants.mjs +31 -0
- package/esm2022/gizmos/gizmo-helper/gizmo-viewcube/gizmo-viewcube-edge.mjs +93 -0
- package/esm2022/gizmos/gizmo-helper/gizmo-viewcube/gizmo-viewcube-face.mjs +151 -0
- package/esm2022/gizmos/gizmo-helper/gizmo-viewcube/gizmo-viewcube-input.mjs +66 -0
- package/esm2022/gizmos/gizmo-helper/gizmo-viewcube/gizmo-viewcube.mjs +71 -0
- package/esm2022/gizmos/gizmo-helper/gizmo-viewport/gizmo-viewport-axis.mjs +195 -0
- package/esm2022/gizmos/gizmo-helper/gizmo-viewport/gizmo-viewport.mjs +272 -0
- package/esm2022/gizmos/index.mjs +4 -0
- package/esm2022/loaders/gltf-loader/gltf-loader.mjs +14 -9
- package/esm2022/loaders/loader/loader.mjs +92 -87
- package/esm2022/loaders/progress/progress.mjs +31 -30
- package/esm2022/loaders/texture-loader/texture-loader.mjs +20 -15
- package/esm2022/materials/index.mjs +2 -1
- package/esm2022/materials/mesh-distort-material/mesh-distort-material.mjs +60 -51
- package/esm2022/materials/mesh-reflector-material/mesh-reflector-material.mjs +239 -255
- package/esm2022/materials/mesh-refraction-material/mesh-refraction-material.mjs +99 -97
- package/esm2022/materials/mesh-transmission-material/mesh-transmission-material.mjs +164 -144
- package/esm2022/materials/mesh-wobble-material/mesh-wobble-material.mjs +44 -42
- package/esm2022/materials/point-material/point-material.mjs +50 -0
- package/esm2022/misc/animations/animations.mjs +28 -23
- package/esm2022/misc/bake-shadows/bake-shadows.mjs +13 -13
- package/esm2022/misc/caustics/caustics.mjs +387 -0
- package/esm2022/misc/decal/decal.mjs +187 -0
- package/esm2022/misc/depth-buffer/depth-buffer.mjs +41 -37
- package/esm2022/misc/example/example.mjs +161 -0
- package/esm2022/misc/fbo/fbo.mjs +42 -36
- package/esm2022/misc/html/html-wrapper.mjs +478 -0
- package/esm2022/misc/html/html.mjs +305 -0
- package/esm2022/misc/index.mjs +10 -1
- package/esm2022/misc/sampler/sampler.mjs +132 -0
- package/esm2022/misc/shadow/shadow.mjs +111 -0
- package/esm2022/misc/stats-gl/stats-gl.mjs +61 -0
- package/esm2022/misc/trail/trail.mjs +204 -0
- package/esm2022/misc/trail-texture/inject-trail-texture.mjs +17 -0
- package/esm2022/misc/trail-texture/trail-texture.mjs +106 -0
- package/esm2022/modifiers/angular-three-soba-modifiers.mjs +5 -0
- package/esm2022/modifiers/curve-modifier/curve-modifier.mjs +64 -0
- package/esm2022/modifiers/index.mjs +2 -0
- package/esm2022/performances/adaptive-dpr/adaptive-dpr.mjs +44 -0
- package/esm2022/performances/adaptive-events/adaptive-events.mjs +27 -0
- package/esm2022/performances/angular-three-soba-performances.mjs +5 -0
- package/esm2022/performances/index.mjs +8 -0
- package/esm2022/performances/instances/instances.mjs +221 -0
- package/esm2022/performances/instances/position-mesh.mjs +52 -0
- package/esm2022/performances/points/points-input.mjs +64 -0
- package/esm2022/performances/points/points.mjs +327 -0
- package/esm2022/performances/points/position-point.mjs +54 -0
- package/esm2022/performances/segments/segment-object.mjs +9 -0
- package/esm2022/performances/segments/segments.mjs +183 -0
- package/esm2022/shaders/blur-pass/blur-pass.mjs +2 -2
- package/esm2022/shaders/caustics/caustics-material.mjs +130 -0
- package/esm2022/shaders/caustics/caustics-projection-material.mjs +32 -0
- package/esm2022/shaders/convolution-material/convolution-material.mjs +3 -2
- package/esm2022/shaders/discard-material/discard-material.mjs +1 -1
- package/esm2022/shaders/grid-material/grid-material.mjs +30 -14
- package/esm2022/shaders/index.mjs +5 -3
- package/esm2022/shaders/mesh-distort-material/mesh-distort-material.mjs +42 -41
- package/esm2022/shaders/mesh-reflector-material/mesh-reflector-material.mjs +2 -2
- package/esm2022/shaders/mesh-refraction-material/mesh-refraction-material.mjs +3 -2
- package/esm2022/shaders/mesh-transmission-material/mesh-transmission-material.mjs +7 -4
- package/esm2022/shaders/mesh-wobble-material/mesh-wobble-material.mjs +1 -1
- package/esm2022/shaders/shader-material/shader-material.mjs +3 -5
- package/esm2022/shaders/soft-shadow-material/soft-shadow-material.mjs +18 -25
- package/esm2022/shaders/sparkles-material/sparkles-material.mjs +32 -46
- package/esm2022/shaders/spot-light-material/spot-light-material.mjs +8 -7
- package/esm2022/shaders/star-field-material/star-field-material.mjs +3 -2
- package/esm2022/shaders/wireframe-material/wireframe-material.mjs +247 -0
- package/esm2022/staging/accumulative-shadows/accumulative-shadows.mjs +161 -176
- package/esm2022/staging/accumulative-shadows/progressive-light-map.mjs +8 -8
- package/esm2022/staging/accumulative-shadows/randomized-lights.mjs +129 -129
- package/esm2022/staging/backdrop/backdrop.mjs +77 -0
- package/esm2022/staging/bb-anchor/bb-anchor.mjs +69 -0
- package/esm2022/staging/bounds/bounds.mjs +145 -143
- package/esm2022/staging/camera-shake/camera-shake.mjs +86 -80
- package/esm2022/staging/center/center.mjs +129 -112
- package/esm2022/staging/cloud/cloud.mjs +118 -124
- package/esm2022/staging/contact-shadows/contact-shadows.mjs +131 -136
- package/esm2022/staging/environment/assets.mjs +12 -12
- package/esm2022/staging/environment/environment-cube.mjs +28 -30
- package/esm2022/staging/environment/environment-ground.mjs +17 -19
- package/esm2022/staging/environment/environment-input.mjs +98 -85
- package/esm2022/staging/environment/environment-map.mjs +33 -33
- package/esm2022/staging/environment/environment-portal.mjs +75 -97
- package/esm2022/staging/environment/environment.mjs +34 -51
- package/esm2022/staging/environment/utils.mjs +40 -17
- package/esm2022/staging/float/float.mjs +70 -58
- package/esm2022/staging/index.mjs +7 -3
- package/esm2022/staging/matcap-texture/matcap-texture.mjs +64 -0
- package/esm2022/staging/normal-texture/normal-texture.mjs +53 -0
- package/esm2022/staging/sky/sky.mjs +85 -80
- package/esm2022/staging/sparkles/sparkles.mjs +108 -105
- package/esm2022/staging/spot-light/shadow-mesh-input.mjs +63 -0
- package/esm2022/staging/spot-light/shadow-mesh.mjs +267 -0
- package/esm2022/staging/spot-light/spot-light-input.mjs +67 -58
- package/esm2022/staging/spot-light/spot-light.mjs +51 -63
- package/esm2022/staging/spot-light/volumetric-mesh.mjs +67 -70
- package/esm2022/staging/stage/stage.mjs +305 -290
- package/esm2022/staging/stars/stars.mjs +101 -102
- package/esm2022/staging/wireframe/wireframe-input.mjs +191 -0
- package/esm2022/staging/wireframe/wireframe.mjs +228 -0
- package/esm2022/utils/angular-three-soba-utils.mjs +5 -0
- package/esm2022/utils/constants.mjs +3 -0
- package/esm2022/utils/content/content.mjs +15 -0
- package/esm2022/utils/index.mjs +3 -0
- package/fesm2022/angular-three-soba-abstractions.mjs +504 -2079
- package/fesm2022/angular-three-soba-abstractions.mjs.map +1 -1
- package/fesm2022/angular-three-soba-cameras.mjs +293 -260
- package/fesm2022/angular-three-soba-cameras.mjs.map +1 -1
- package/fesm2022/angular-three-soba-controls.mjs +108 -83
- package/fesm2022/angular-three-soba-controls.mjs.map +1 -1
- package/fesm2022/angular-three-soba-gizmos.mjs +1045 -0
- package/fesm2022/angular-three-soba-gizmos.mjs.map +1 -0
- package/fesm2022/angular-three-soba-loaders.mjs +148 -132
- package/fesm2022/angular-three-soba-loaders.mjs.map +1 -1
- package/fesm2022/angular-three-soba-materials.mjs +656 -588
- package/fesm2022/angular-three-soba-materials.mjs.map +1 -1
- package/fesm2022/angular-three-soba-misc.mjs +2202 -99
- package/fesm2022/angular-three-soba-misc.mjs.map +1 -1
- package/fesm2022/angular-three-soba-modifiers.mjs +71 -0
- package/fesm2022/angular-three-soba-modifiers.mjs.map +1 -0
- package/fesm2022/angular-three-soba-performances.mjs +957 -0
- package/fesm2022/angular-three-soba-performances.mjs.map +1 -0
- package/fesm2022/angular-three-soba-shaders.mjs +508 -269
- package/fesm2022/angular-three-soba-shaders.mjs.map +1 -1
- package/fesm2022/angular-three-soba-staging.mjs +2910 -2573
- package/fesm2022/angular-three-soba-staging.mjs.map +1 -1
- package/fesm2022/angular-three-soba-utils.mjs +25 -0
- package/fesm2022/angular-three-soba-utils.mjs.map +1 -0
- package/gizmos/README.md +3 -0
- package/gizmos/gizmo-helper/gizmo-helper.d.ts +73 -0
- package/gizmos/gizmo-helper/gizmo-viewcube/gizmo-viewcube-edge.d.ts +22 -0
- package/gizmos/gizmo-helper/gizmo-viewcube/gizmo-viewcube-face.d.ts +29 -0
- package/gizmos/gizmo-helper/gizmo-viewcube/gizmo-viewcube-input.d.ts +33 -0
- package/gizmos/gizmo-helper/gizmo-viewcube/gizmo-viewcube.d.ts +10 -0
- package/gizmos/gizmo-helper/gizmo-viewport/gizmo-viewport-axis.d.ts +40 -0
- package/gizmos/gizmo-helper/gizmo-viewport/gizmo-viewport.d.ts +30 -0
- package/gizmos/index.d.ts +3 -0
- package/loaders/gltf-loader/gltf-loader.d.ts +15 -4
- package/loaders/loader/loader.d.ts +19 -17
- package/loaders/progress/progress.d.ts +1 -1
- package/loaders/texture-loader/texture-loader.d.ts +8 -3
- package/materials/index.d.ts +1 -0
- package/materials/mesh-distort-material/mesh-distort-material.d.ts +25 -15
- package/materials/mesh-reflector-material/mesh-reflector-material.d.ts +74 -56
- package/materials/mesh-refraction-material/mesh-refraction-material.d.ts +33 -21
- package/materials/mesh-transmission-material/mesh-transmission-material.d.ts +55 -39
- package/materials/mesh-wobble-material/mesh-wobble-material.d.ts +19 -10
- package/materials/point-material/point-material.d.ts +24 -0
- package/metadata.json +1 -0
- package/misc/animations/animations.d.ts +6 -4
- package/misc/caustics/caustics.d.ts +87 -0
- package/misc/decal/decal.d.ts +49 -0
- package/misc/depth-buffer/depth-buffer.d.ts +2 -2
- package/misc/example/example.d.ts +85 -0
- package/misc/fbo/fbo.d.ts +2 -2
- package/misc/html/html-wrapper.d.ts +559 -0
- package/misc/html/html.d.ts +218 -0
- package/misc/index.d.ts +9 -0
- package/misc/sampler/sampler.d.ts +67 -0
- package/misc/shadow/shadow.d.ts +37 -0
- package/misc/stats-gl/stats-gl.d.ts +24 -0
- package/misc/trail/trail.d.ts +57 -0
- package/misc/trail-texture/inject-trail-texture.d.ts +9 -0
- package/misc/trail-texture/trail-texture.d.ts +50 -0
- package/modifiers/README.md +3 -0
- package/modifiers/curve-modifier/curve-modifier.d.ts +23 -0
- package/modifiers/index.d.ts +1 -0
- package/package.json +42 -24
- package/performances/README.md +3 -0
- package/performances/adaptive-dpr/adaptive-dpr.d.ts +14 -0
- package/{performance/adaptive → performances/adaptive-events}/adaptive-events.d.ts +3 -0
- package/performances/index.d.ts +7 -0
- package/performances/instances/instances.d.ts +83 -0
- package/{performance → performances}/instances/position-mesh.d.ts +1 -1
- package/performances/points/points-input.d.ts +32 -0
- package/performances/points/points.d.ts +96 -0
- package/performances/points/position-point.d.ts +11 -0
- package/performances/segments/segment-object.d.ts +7 -0
- package/performances/segments/segments.d.ts +128 -0
- package/shaders/grid-material/grid-material.d.ts +33 -0
- package/shaders/index.d.ts +4 -2
- package/shaders/mesh-distort-material/mesh-distort-material.d.ts +173 -6
- package/shaders/mesh-transmission-material/mesh-transmission-material.d.ts +1 -1
- package/shaders/shader-material/shader-material.d.ts +2 -2
- package/shaders/soft-shadow-material/soft-shadow-material.d.ts +10 -1
- package/shaders/sparkles-material/sparkles-material.d.ts +13 -0
- package/shaders/spot-light-material/spot-light-material.d.ts +11 -2
- package/shaders/star-field-material/star-field-material.d.ts +9 -0
- package/shaders/wireframe-material/wireframe-material.d.ts +58 -0
- package/staging/accumulative-shadows/accumulative-shadows.d.ts +93 -39
- package/staging/accumulative-shadows/randomized-lights.d.ts +41 -28
- package/staging/backdrop/backdrop.d.ts +30 -0
- package/staging/bb-anchor/bb-anchor.d.ts +27 -0
- package/staging/bounds/bounds.d.ts +105 -25
- package/staging/camera-shake/camera-shake.d.ts +30 -19
- package/staging/center/center.d.ts +43 -35
- package/staging/cloud/cloud.d.ts +27 -24
- package/staging/contact-shadows/contact-shadows.d.ts +43 -30
- package/staging/environment/assets.d.ts +9 -9
- package/staging/environment/environment-cube.d.ts +9 -5
- package/staging/environment/environment-ground.d.ts +7 -7
- package/staging/environment/environment-input.d.ts +38 -38
- package/staging/environment/environment-map.d.ts +10 -5
- package/staging/environment/environment-portal.d.ts +10 -5
- package/staging/environment/environment.d.ts +0 -4
- package/staging/environment/utils.d.ts +2 -2
- package/staging/float/float.d.ts +15 -11
- package/staging/index.d.ts +6 -2
- package/staging/matcap-texture/matcap-texture.d.ts +13 -0
- package/staging/normal-texture/normal-texture.d.ts +16 -0
- package/staging/sky/sky.d.ts +28 -21
- package/staging/sparkles/sparkles.d.ts +36 -22
- package/staging/spot-light/shadow-mesh-input.d.ts +29 -0
- package/staging/spot-light/shadow-mesh.d.ts +37 -0
- package/staging/spot-light/spot-light-input.d.ts +25 -25
- package/staging/spot-light/spot-light.d.ts +35 -15
- package/staging/spot-light/volumetric-mesh.d.ts +15 -9
- package/staging/stage/stage.d.ts +89 -65
- package/staging/stars/stars.d.ts +28 -17
- package/staging/wireframe/wireframe-input.d.ts +65 -0
- package/staging/wireframe/wireframe.d.ts +28 -0
- package/utils/README.md +3 -0
- package/utils/constants.d.ts +1 -0
- package/utils/content/content.d.ts +8 -0
- package/utils/index.d.ts +2 -0
- package/web-types.json +1 -0
- package/abstractions/catmull-rom-line/catmull-rom-line.d.ts +0 -25
- package/abstractions/cubic-bezier-line/cubic-bezier-line.d.ts +0 -25
- package/abstractions/gizmo-helper/gizmo-helper.d.ts +0 -34
- package/abstractions/gizmo-helper/gizmo-viewcube/gizmo-viewcube-edge.d.ts +0 -22
- package/abstractions/gizmo-helper/gizmo-viewcube/gizmo-viewcube-face.d.ts +0 -30
- package/abstractions/gizmo-helper/gizmo-viewcube/gizmo-viewcube-inputs.d.ts +0 -32
- package/abstractions/gizmo-helper/gizmo-viewcube/gizmo-viewcube.d.ts +0 -14
- package/abstractions/gizmo-helper/gizmo-viewport/gizmo-viewport-axis.d.ts +0 -47
- package/abstractions/gizmo-helper/gizmo-viewport/gizmo-viewport.d.ts +0 -40
- package/abstractions/line/line-input.d.ts +0 -42
- package/abstractions/line/line.d.ts +0 -35
- package/abstractions/quadratic-bezier-line/quadratic-bezier-line.d.ts +0 -23
- package/esm2022/abstractions/catmull-rom-line/catmull-rom-line.mjs +0 -131
- package/esm2022/abstractions/cubic-bezier-line/cubic-bezier-line.mjs +0 -113
- package/esm2022/abstractions/gizmo-helper/gizmo-helper.mjs +0 -210
- package/esm2022/abstractions/gizmo-helper/gizmo-viewcube/constants.mjs +0 -31
- package/esm2022/abstractions/gizmo-helper/gizmo-viewcube/gizmo-viewcube-edge.mjs +0 -95
- package/esm2022/abstractions/gizmo-helper/gizmo-viewcube/gizmo-viewcube-face.mjs +0 -155
- package/esm2022/abstractions/gizmo-helper/gizmo-viewcube/gizmo-viewcube-inputs.mjs +0 -62
- package/esm2022/abstractions/gizmo-helper/gizmo-viewcube/gizmo-viewcube.mjs +0 -80
- package/esm2022/abstractions/gizmo-helper/gizmo-viewport/gizmo-viewport-axis.mjs +0 -206
- package/esm2022/abstractions/gizmo-helper/gizmo-viewport/gizmo-viewport.mjs +0 -273
- package/esm2022/abstractions/line/line-input.mjs +0 -113
- package/esm2022/abstractions/line/line.mjs +0 -165
- package/esm2022/abstractions/quadratic-bezier-line/quadratic-bezier-line.mjs +0 -128
- package/esm2022/performance/adaptive/adaptive-dpr.mjs +0 -46
- package/esm2022/performance/adaptive/adaptive-events.mjs +0 -31
- package/esm2022/performance/angular-three-soba-performance.mjs +0 -5
- package/esm2022/performance/detailed/detailed.mjs +0 -61
- package/esm2022/performance/index.mjs +0 -7
- package/esm2022/performance/instances/instance.mjs +0 -48
- package/esm2022/performance/instances/instances.mjs +0 -189
- package/esm2022/performance/instances/position-mesh.mjs +0 -52
- package/esm2022/performance/stats/stats.mjs +0 -79
- package/esm2022/shaders/caustics-material/caustics-material.mjs +0 -128
- package/esm2022/shaders/caustics-material/caustics-projection-material.mjs +0 -33
- package/esm2022/staging/caustics/caustisc.mjs +0 -384
- package/esm2022/staging/spot-light/spot-light-shadow-mesh-input.mjs +0 -57
- package/esm2022/staging/spot-light/spot-light-shadow-mesh.mjs +0 -256
- package/fesm2022/angular-three-soba-performance.mjs +0 -487
- package/fesm2022/angular-three-soba-performance.mjs.map +0 -1
- package/performance/README.md +0 -3
- package/performance/adaptive/adaptive-dpr.d.ts +0 -8
- package/performance/detailed/detailed.d.ts +0 -20
- package/performance/index.d.ts +0 -6
- package/performance/instances/instance.d.ts +0 -9
- package/performance/instances/instances.d.ts +0 -35
- package/performance/stats/stats.d.ts +0 -18
- package/plugin/generators.json +0 -19
- package/plugin/libs/plugin/README.md +0 -11
- package/plugin/package.json +0 -9
- package/plugin/src/generators/init/compat.d.ts +0 -2
- package/plugin/src/generators/init/compat.js +0 -6
- package/plugin/src/generators/init/compat.js.map +0 -1
- package/plugin/src/generators/init/init.d.ts +0 -7
- package/plugin/src/generators/init/init.js +0 -28
- package/plugin/src/generators/init/init.js.map +0 -1
- package/plugin/src/generators/init/schema.json +0 -6
- package/plugin/src/index.d.ts +0 -1
- package/plugin/src/index.js +0 -6
- package/plugin/src/index.js.map +0 -1
- package/staging/caustics/caustisc.d.ts +0 -70
- package/staging/spot-light/spot-light-shadow-mesh-input.d.ts +0 -29
- package/staging/spot-light/spot-light-shadow-mesh.d.ts +0 -38
- /package/{abstractions → gizmos}/gizmo-helper/gizmo-viewcube/constants.d.ts +0 -0
- /package/shaders/{caustics-material → caustics}/caustics-material.d.ts +0 -0
- /package/shaders/{caustics-material → caustics}/caustics-projection-material.d.ts +0 -0
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import * as THREE from 'three';
|
|
2
|
-
import { ShaderMaterial, Uniform, Vector2, NoBlending, WebGLRenderTarget, LinearFilter, HalfFloatType, Scene, PerspectiveCamera, BufferGeometry, BufferAttribute, Mesh, MeshStandardMaterial
|
|
3
|
-
import {
|
|
2
|
+
import { ShaderMaterial, Uniform, Vector2, NoBlending, WebGLRenderTarget, LinearFilter, HalfFloatType, Scene, PerspectiveCamera, BufferGeometry, BufferAttribute, Mesh, MeshStandardMaterial } from 'three';
|
|
3
|
+
import { revision } from 'angular-three-soba/utils';
|
|
4
|
+
import { InjectionToken, inject, runInInjectionContext, computed, effect } from '@angular/core';
|
|
4
5
|
import { MeshBVHUniformStruct, shaderStructs, shaderIntersectFunction } from 'three-mesh-bvh';
|
|
6
|
+
import { assertInjector } from 'ngxtension/assert-injector';
|
|
5
7
|
|
|
6
8
|
class ConvolutionMaterial extends ShaderMaterial {
|
|
7
9
|
constructor(texelSize = new Vector2()) {
|
|
@@ -55,7 +57,7 @@ class ConvolutionMaterial extends ShaderMaterial {
|
|
|
55
57
|
|
|
56
58
|
#include <dithering_fragment>
|
|
57
59
|
#include <tonemapping_fragment>
|
|
58
|
-
#include
|
|
60
|
+
#include <${revision >= 154 ? 'colorspace_fragment' : 'encodings_fragment'}>
|
|
59
61
|
}`,
|
|
60
62
|
vertexShader: `uniform vec2 texelSize;
|
|
61
63
|
uniform vec2 halfTexelSize;
|
|
@@ -163,10 +165,8 @@ function shaderMaterial(uniforms, vertexShader, fragmentShader, onInit) {
|
|
|
163
165
|
super({
|
|
164
166
|
uniforms: entries.reduce((acc, [name, value]) => {
|
|
165
167
|
const uniform = THREE.UniformsUtils.clone({ [name]: { value } });
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
...uniform,
|
|
169
|
-
};
|
|
168
|
+
Object.assign(acc, uniform);
|
|
169
|
+
return acc;
|
|
170
170
|
}, {}),
|
|
171
171
|
vertexShader,
|
|
172
172
|
fragmentShader,
|
|
@@ -206,113 +206,115 @@ const CausticsMaterial = shaderMaterial({
|
|
|
206
206
|
size: 10,
|
|
207
207
|
intensity: 0.5,
|
|
208
208
|
},
|
|
209
|
-
/* glsl */ `
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
uniform
|
|
217
|
-
uniform
|
|
218
|
-
uniform
|
|
219
|
-
uniform
|
|
220
|
-
uniform float
|
|
221
|
-
uniform float
|
|
222
|
-
uniform float
|
|
223
|
-
uniform float
|
|
224
|
-
uniform float
|
|
225
|
-
uniform float
|
|
226
|
-
uniform float
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
uniform
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
// n must be normalized
|
|
244
|
-
return dot(p,n) + h;
|
|
245
|
-
}
|
|
246
|
-
float planeIntersect( vec3 ro, vec3 rd, vec4 p ) {
|
|
247
|
-
return -(dot(ro,p.xyz)+p.w)/dot(rd,p.xyz);
|
|
248
|
-
}
|
|
249
|
-
vec3 totalInternalReflection(vec3 ro, vec3 rd, vec3 pos, vec3 normal, float ior, out vec3 rayOrigin, out vec3 rayDirection) {
|
|
250
|
-
rayOrigin = ro;
|
|
251
|
-
rayDirection = rd;
|
|
252
|
-
rayDirection = refract(rayDirection, normal, 1.0 / ior);
|
|
253
|
-
rayOrigin = pos + rayDirection * 0.1;
|
|
254
|
-
return rayDirection;
|
|
255
|
-
}
|
|
256
|
-
void main() {
|
|
257
|
-
// Each sample consists of random offset in the x and y direction
|
|
258
|
-
float caustic = 0.0;
|
|
259
|
-
float causticTexelSize = (1.0 / resolution) * size * 2.0;
|
|
260
|
-
float texelsNeeded = worldRadius / causticTexelSize;
|
|
261
|
-
float sampleRadius = texelsNeeded / resolution;
|
|
262
|
-
float sum = 0.0;
|
|
263
|
-
if (texture2D(depthTexture, vUv).x == 1.0) {
|
|
264
|
-
gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);
|
|
265
|
-
return;
|
|
209
|
+
/* glsl */ `
|
|
210
|
+
varying vec2 vUv;
|
|
211
|
+
void main() {
|
|
212
|
+
vUv = uv;
|
|
213
|
+
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
|
|
214
|
+
}`,
|
|
215
|
+
/* glsl */ `
|
|
216
|
+
uniform mat4 cameraMatrixWorld;
|
|
217
|
+
uniform mat4 cameraProjectionMatrixInv;
|
|
218
|
+
uniform vec3 lightDir;
|
|
219
|
+
uniform vec3 lightPlaneNormal;
|
|
220
|
+
uniform float lightPlaneConstant;
|
|
221
|
+
uniform float near;
|
|
222
|
+
uniform float far;
|
|
223
|
+
uniform float time;
|
|
224
|
+
uniform float worldRadius;
|
|
225
|
+
uniform float resolution;
|
|
226
|
+
uniform float size;
|
|
227
|
+
uniform float intensity;
|
|
228
|
+
uniform float ior;
|
|
229
|
+
precision highp isampler2D;
|
|
230
|
+
precision highp usampler2D;
|
|
231
|
+
uniform sampler2D normalTexture;
|
|
232
|
+
uniform sampler2D depthTexture;
|
|
233
|
+
uniform float bounces;
|
|
234
|
+
varying vec2 vUv;
|
|
235
|
+
vec3 WorldPosFromDepth(float depth, vec2 coord) {
|
|
236
|
+
float z = depth * 2.0 - 1.0;
|
|
237
|
+
vec4 clipSpacePosition = vec4(coord * 2.0 - 1.0, z, 1.0);
|
|
238
|
+
vec4 viewSpacePosition = cameraProjectionMatrixInv * clipSpacePosition;
|
|
239
|
+
// Perspective division
|
|
240
|
+
viewSpacePosition /= viewSpacePosition.w;
|
|
241
|
+
vec4 worldSpacePosition = cameraMatrixWorld * viewSpacePosition;
|
|
242
|
+
return worldSpacePosition.xyz;
|
|
266
243
|
}
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
vec2 offset4 = vec2(0.5, -0.5);//vec2(rand() - 0.5, rand() - 0.5);
|
|
271
|
-
vec2 uv1 = vUv + offset1 * sampleRadius;
|
|
272
|
-
vec2 uv2 = vUv + offset2 * sampleRadius;
|
|
273
|
-
vec2 uv3 = vUv + offset3 * sampleRadius;
|
|
274
|
-
vec2 uv4 = vUv + offset4 * sampleRadius;
|
|
275
|
-
vec3 normal1 = texture2D(normalTexture, uv1, -10.0).rgb * 2.0 - 1.0;
|
|
276
|
-
vec3 normal2 = texture2D(normalTexture, uv2, -10.0).rgb * 2.0 - 1.0;
|
|
277
|
-
vec3 normal3 = texture2D(normalTexture, uv3, -10.0).rgb * 2.0 - 1.0;
|
|
278
|
-
vec3 normal4 = texture2D(normalTexture, uv4, -10.0).rgb * 2.0 - 1.0;
|
|
279
|
-
float depth1 = texture2D(depthTexture, uv1, -10.0).x;
|
|
280
|
-
float depth2 = texture2D(depthTexture, uv2, -10.0).x;
|
|
281
|
-
float depth3 = texture2D(depthTexture, uv3, -10.0).x;
|
|
282
|
-
float depth4 = texture2D(depthTexture, uv4, -10.0).x;
|
|
283
|
-
// Sanity check the depths
|
|
284
|
-
if (depth1 == 1.0 || depth2 == 1.0 || depth3 == 1.0 || depth4 == 1.0) {
|
|
285
|
-
gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);
|
|
286
|
-
return;
|
|
244
|
+
float sdPlane( vec3 p, vec3 n, float h ) {
|
|
245
|
+
// n must be normalized
|
|
246
|
+
return dot(p,n) + h;
|
|
287
247
|
}
|
|
288
|
-
vec3
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
vec3
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
248
|
+
float planeIntersect( vec3 ro, vec3 rd, vec4 p ) {
|
|
249
|
+
return -(dot(ro,p.xyz)+p.w)/dot(rd,p.xyz);
|
|
250
|
+
}
|
|
251
|
+
vec3 totalInternalReflection(vec3 ro, vec3 rd, vec3 pos, vec3 normal, float ior, out vec3 rayOrigin, out vec3 rayDirection) {
|
|
252
|
+
rayOrigin = ro;
|
|
253
|
+
rayDirection = rd;
|
|
254
|
+
rayDirection = refract(rayDirection, normal, 1.0 / ior);
|
|
255
|
+
rayOrigin = pos + rayDirection * 0.1;
|
|
256
|
+
return rayDirection;
|
|
257
|
+
}
|
|
258
|
+
void main() {
|
|
259
|
+
// Each sample consists of random offset in the x and y direction
|
|
260
|
+
float caustic = 0.0;
|
|
261
|
+
float causticTexelSize = (1.0 / resolution) * size * 2.0;
|
|
262
|
+
float texelsNeeded = worldRadius / causticTexelSize;
|
|
263
|
+
float sampleRadius = texelsNeeded / resolution;
|
|
264
|
+
float sum = 0.0;
|
|
265
|
+
if (texture2D(depthTexture, vUv).x == 1.0) {
|
|
266
|
+
gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);
|
|
267
|
+
return;
|
|
268
|
+
}
|
|
269
|
+
vec2 offset1 = vec2(-0.5, -0.5);//vec2(rand() - 0.5, rand() - 0.5);
|
|
270
|
+
vec2 offset2 = vec2(-0.5, 0.5);//vec2(rand() - 0.5, rand() - 0.5);
|
|
271
|
+
vec2 offset3 = vec2(0.5, 0.5);//vec2(rand() - 0.5, rand() - 0.5);
|
|
272
|
+
vec2 offset4 = vec2(0.5, -0.5);//vec2(rand() - 0.5, rand() - 0.5);
|
|
273
|
+
vec2 uv1 = vUv + offset1 * sampleRadius;
|
|
274
|
+
vec2 uv2 = vUv + offset2 * sampleRadius;
|
|
275
|
+
vec2 uv3 = vUv + offset3 * sampleRadius;
|
|
276
|
+
vec2 uv4 = vUv + offset4 * sampleRadius;
|
|
277
|
+
vec3 normal1 = texture2D(normalTexture, uv1, -10.0).rgb * 2.0 - 1.0;
|
|
278
|
+
vec3 normal2 = texture2D(normalTexture, uv2, -10.0).rgb * 2.0 - 1.0;
|
|
279
|
+
vec3 normal3 = texture2D(normalTexture, uv3, -10.0).rgb * 2.0 - 1.0;
|
|
280
|
+
vec3 normal4 = texture2D(normalTexture, uv4, -10.0).rgb * 2.0 - 1.0;
|
|
281
|
+
float depth1 = texture2D(depthTexture, uv1, -10.0).x;
|
|
282
|
+
float depth2 = texture2D(depthTexture, uv2, -10.0).x;
|
|
283
|
+
float depth3 = texture2D(depthTexture, uv3, -10.0).x;
|
|
284
|
+
float depth4 = texture2D(depthTexture, uv4, -10.0).x;
|
|
285
|
+
// Sanity check the depths
|
|
286
|
+
if (depth1 == 1.0 || depth2 == 1.0 || depth3 == 1.0 || depth4 == 1.0) {
|
|
287
|
+
gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);
|
|
288
|
+
return;
|
|
289
|
+
}
|
|
290
|
+
vec3 pos1 = WorldPosFromDepth(depth1, uv1);
|
|
291
|
+
vec3 pos2 = WorldPosFromDepth(depth2, uv2);
|
|
292
|
+
vec3 pos3 = WorldPosFromDepth(depth3, uv3);
|
|
293
|
+
vec3 pos4 = WorldPosFromDepth(depth4, uv4);
|
|
294
|
+
vec3 originPos1 = WorldPosFromDepth(0.0, uv1);
|
|
295
|
+
vec3 originPos2 = WorldPosFromDepth(0.0, uv2);
|
|
296
|
+
vec3 originPos3 = WorldPosFromDepth(0.0, uv3);
|
|
297
|
+
vec3 originPos4 = WorldPosFromDepth(0.0, uv4);
|
|
298
|
+
vec3 endPos1, endPos2, endPos3, endPos4;
|
|
299
|
+
vec3 endDir1, endDir2, endDir3, endDir4;
|
|
300
|
+
totalInternalReflection(originPos1, lightDir, pos1, normal1, ior, endPos1, endDir1);
|
|
301
|
+
totalInternalReflection(originPos2, lightDir, pos2, normal2, ior, endPos2, endDir2);
|
|
302
|
+
totalInternalReflection(originPos3, lightDir, pos3, normal3, ior, endPos3, endDir3);
|
|
303
|
+
totalInternalReflection(originPos4, lightDir, pos4, normal4, ior, endPos4, endDir4);
|
|
304
|
+
float lightPosArea = length(cross(originPos2 - originPos1, originPos3 - originPos1)) + length(cross(originPos3 - originPos1, originPos4 - originPos1));
|
|
305
|
+
float t1 = planeIntersect(endPos1, endDir1, vec4(lightPlaneNormal, lightPlaneConstant));
|
|
306
|
+
float t2 = planeIntersect(endPos2, endDir2, vec4(lightPlaneNormal, lightPlaneConstant));
|
|
307
|
+
float t3 = planeIntersect(endPos3, endDir3, vec4(lightPlaneNormal, lightPlaneConstant));
|
|
308
|
+
float t4 = planeIntersect(endPos4, endDir4, vec4(lightPlaneNormal, lightPlaneConstant));
|
|
309
|
+
vec3 finalPos1 = endPos1 + endDir1 * t1;
|
|
310
|
+
vec3 finalPos2 = endPos2 + endDir2 * t2;
|
|
311
|
+
vec3 finalPos3 = endPos3 + endDir3 * t3;
|
|
312
|
+
vec3 finalPos4 = endPos4 + endDir4 * t4;
|
|
313
|
+
float finalArea = length(cross(finalPos2 - finalPos1, finalPos3 - finalPos1)) + length(cross(finalPos3 - finalPos1, finalPos4 - finalPos1));
|
|
314
|
+
caustic += intensity * (lightPosArea / finalArea);
|
|
315
|
+
// Calculate the area of the triangle in light spaces
|
|
316
|
+
gl_FragColor = vec4(vec3(max(caustic, 0.0)), 1.0);
|
|
317
|
+
}`);
|
|
316
318
|
|
|
317
319
|
const CausticsProjectionMaterial = shaderMaterial({
|
|
318
320
|
causticsTexture: null,
|
|
@@ -320,30 +322,28 @@ const CausticsProjectionMaterial = shaderMaterial({
|
|
|
320
322
|
color: new THREE.Color(),
|
|
321
323
|
lightProjMatrix: new THREE.Matrix4(),
|
|
322
324
|
lightViewMatrix: new THREE.Matrix4(),
|
|
323
|
-
},
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
uniform
|
|
332
|
-
uniform
|
|
333
|
-
uniform
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
#include <encodings_fragment>
|
|
346
|
-
}`);
|
|
325
|
+
}, `varying vec3 vWorldPosition;
|
|
326
|
+
void main() {
|
|
327
|
+
gl_Position = projectionMatrix * viewMatrix * modelMatrix * vec4(position, 1.);
|
|
328
|
+
vec4 worldPosition = modelMatrix * vec4(position, 1.);
|
|
329
|
+
vWorldPosition = worldPosition.xyz;
|
|
330
|
+
}`, `varying vec3 vWorldPosition;
|
|
331
|
+
uniform vec3 color;
|
|
332
|
+
uniform sampler2D causticsTexture;
|
|
333
|
+
uniform sampler2D causticsTextureB;
|
|
334
|
+
uniform mat4 lightProjMatrix;
|
|
335
|
+
uniform mat4 lightViewMatrix;
|
|
336
|
+
void main() {
|
|
337
|
+
// Apply caustics
|
|
338
|
+
vec4 lightSpacePos = lightProjMatrix * lightViewMatrix * vec4(vWorldPosition, 1.0);
|
|
339
|
+
lightSpacePos.xyz /= lightSpacePos.w;
|
|
340
|
+
lightSpacePos.xyz = lightSpacePos.xyz * 0.5 + 0.5;
|
|
341
|
+
vec3 front = texture2D(causticsTexture, lightSpacePos.xy).rgb;
|
|
342
|
+
vec3 back = texture2D(causticsTextureB, lightSpacePos.xy).rgb;
|
|
343
|
+
gl_FragColor = vec4((front + back) * color, 1.0);
|
|
344
|
+
#include <tonemapping_fragment>
|
|
345
|
+
#include <${revision >= 154 ? 'colorspace_fragment' : 'encodings_fragment'}>
|
|
346
|
+
}`);
|
|
347
347
|
|
|
348
348
|
const DiscardMaterial = shaderMaterial({}, 'void main() { }', 'void main() { gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0); discard; }');
|
|
349
349
|
|
|
@@ -358,23 +358,37 @@ const GridMaterial = shaderMaterial({
|
|
|
358
358
|
sectionColor: new THREE.Color(),
|
|
359
359
|
infiniteGrid: false,
|
|
360
360
|
followCamera: false,
|
|
361
|
+
worldCamProjPosition: new THREE.Vector3(),
|
|
362
|
+
worldPlanePosition: new THREE.Vector3(),
|
|
361
363
|
},
|
|
362
364
|
/* glsl */ `
|
|
363
|
-
varying vec3
|
|
365
|
+
varying vec3 localPosition;
|
|
366
|
+
varying vec4 worldPosition;
|
|
367
|
+
|
|
368
|
+
uniform vec3 worldCamProjPosition;
|
|
369
|
+
uniform vec3 worldPlanePosition;
|
|
364
370
|
uniform float fadeDistance;
|
|
365
371
|
uniform bool infiniteGrid;
|
|
366
372
|
uniform bool followCamera;
|
|
367
373
|
|
|
368
374
|
void main() {
|
|
369
|
-
|
|
370
|
-
if (infiniteGrid)
|
|
371
|
-
if (followCamera) worldPosition.xz +=cameraPosition.xz;
|
|
375
|
+
localPosition = position.xzy;
|
|
376
|
+
if (infiniteGrid) localPosition *= 1.0 + fadeDistance;
|
|
372
377
|
|
|
373
|
-
|
|
378
|
+
worldPosition = modelMatrix * vec4(localPosition, 1.0);
|
|
379
|
+
if (followCamera) {
|
|
380
|
+
worldPosition.xyz += (worldCamProjPosition - worldPlanePosition);
|
|
381
|
+
localPosition = (inverse(modelMatrix) * worldPosition).xyz;
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
gl_Position = projectionMatrix * viewMatrix * worldPosition;
|
|
374
385
|
}
|
|
375
386
|
`,
|
|
376
387
|
/* glsl */ `
|
|
377
|
-
varying vec3
|
|
388
|
+
varying vec3 localPosition;
|
|
389
|
+
varying vec4 worldPosition;
|
|
390
|
+
|
|
391
|
+
uniform vec3 worldCamProjPosition;
|
|
378
392
|
uniform float cellSize;
|
|
379
393
|
uniform float sectionSize;
|
|
380
394
|
uniform vec3 cellColor;
|
|
@@ -385,80 +399,82 @@ const GridMaterial = shaderMaterial({
|
|
|
385
399
|
uniform float sectionThickness;
|
|
386
400
|
|
|
387
401
|
float getGrid(float size, float thickness) {
|
|
388
|
-
vec2 r =
|
|
402
|
+
vec2 r = localPosition.xz / size;
|
|
389
403
|
vec2 grid = abs(fract(r - 0.5) - 0.5) / fwidth(r);
|
|
390
|
-
float line = min(grid.x, grid.y) + 1. - thickness;
|
|
391
|
-
return 1.0 - min(line, 1.);
|
|
404
|
+
float line = min(grid.x, grid.y) + 1.0 - thickness;
|
|
405
|
+
return 1.0 - min(line, 1.0);
|
|
392
406
|
}
|
|
393
407
|
|
|
394
408
|
void main() {
|
|
395
409
|
float g1 = getGrid(cellSize, cellThickness);
|
|
396
410
|
float g2 = getGrid(sectionSize, sectionThickness);
|
|
397
411
|
|
|
398
|
-
float
|
|
399
|
-
|
|
412
|
+
float dist = distance(worldCamProjPosition, worldPosition.xyz);
|
|
413
|
+
float d = 1.0 - min(dist / fadeDistance, 1.0);
|
|
414
|
+
vec3 color = mix(cellColor, sectionColor, min(1.0, sectionThickness * g2));
|
|
400
415
|
|
|
401
|
-
gl_FragColor = vec4(color, (g1 + g2) * pow(d,fadeStrength));
|
|
416
|
+
gl_FragColor = vec4(color, (g1 + g2) * pow(d, fadeStrength));
|
|
402
417
|
gl_FragColor.a = mix(0.75 * gl_FragColor.a, gl_FragColor.a, g2);
|
|
403
418
|
if (gl_FragColor.a <= 0.0) discard;
|
|
404
419
|
|
|
405
420
|
#include <tonemapping_fragment>
|
|
406
|
-
#include
|
|
421
|
+
#include <${revision >= 154 ? 'colorspace_fragment' : 'encodings_fragment'}>
|
|
407
422
|
}
|
|
408
423
|
`);
|
|
409
424
|
|
|
410
425
|
const NGTS_DISTORT_MATERIAL_SHADER = new InjectionToken('DistortMaterialShader');
|
|
411
|
-
function
|
|
412
|
-
return
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
426
|
+
function injectNgtsMeshDistortMaterial() {
|
|
427
|
+
return inject(NGTS_DISTORT_MATERIAL_SHADER);
|
|
428
|
+
}
|
|
429
|
+
function createMeshDistortMaterial(distortShader) {
|
|
430
|
+
return class extends THREE.MeshPhysicalMaterial {
|
|
431
|
+
constructor(parameters = {}) {
|
|
432
|
+
super(parameters);
|
|
433
|
+
this.setValues(parameters);
|
|
434
|
+
this._time = { value: 0 };
|
|
435
|
+
this._distort = { value: 0.4 };
|
|
436
|
+
this._radius = { value: 1 };
|
|
437
|
+
}
|
|
438
|
+
onBeforeCompile(shader) {
|
|
439
|
+
shader.uniforms['time'] = this._time;
|
|
440
|
+
shader.uniforms['radius'] = this._radius;
|
|
441
|
+
shader.uniforms['distort'] = this._distort;
|
|
442
|
+
shader.vertexShader = `
|
|
428
443
|
uniform float time;
|
|
429
444
|
uniform float radius;
|
|
430
445
|
uniform float distort;
|
|
431
446
|
${distortShader}
|
|
432
447
|
${shader.vertexShader}
|
|
433
448
|
`;
|
|
434
|
-
|
|
449
|
+
shader.vertexShader = shader.vertexShader.replace('#include <begin_vertex>', `
|
|
435
450
|
float updateTime = time / 50.0;
|
|
436
451
|
float noise = snoise(vec3(position / 2.0 + updateTime * 5.0));
|
|
437
452
|
vec3 transformed = vec3(position * (noise * pow(distort, 2.0) + radius));
|
|
438
453
|
`);
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
};
|
|
459
|
-
},
|
|
454
|
+
}
|
|
455
|
+
get time() {
|
|
456
|
+
return this._time.value;
|
|
457
|
+
}
|
|
458
|
+
set time(v) {
|
|
459
|
+
this._time.value = v;
|
|
460
|
+
}
|
|
461
|
+
get distort() {
|
|
462
|
+
return this._distort.value;
|
|
463
|
+
}
|
|
464
|
+
set distort(v) {
|
|
465
|
+
this._distort.value = v;
|
|
466
|
+
}
|
|
467
|
+
get radius() {
|
|
468
|
+
return this._radius.value;
|
|
469
|
+
}
|
|
470
|
+
set radius(v) {
|
|
471
|
+
this._radius.value = v;
|
|
472
|
+
}
|
|
460
473
|
};
|
|
461
474
|
}
|
|
475
|
+
function provideNgtsMeshDistortMaterialShader(distortShader) {
|
|
476
|
+
return { provide: NGTS_DISTORT_MATERIAL_SHADER, useFactory: () => createMeshDistortMaterial(distortShader) };
|
|
477
|
+
}
|
|
462
478
|
|
|
463
479
|
class MeshReflectorMaterial extends MeshStandardMaterial {
|
|
464
480
|
constructor(parameters = {}) {
|
|
@@ -845,7 +861,7 @@ const MeshRefractionMaterial = shaderMaterial({
|
|
|
845
861
|
float nFresnel = fresnelFunc(viewDirection, normal) * fresnel;
|
|
846
862
|
gl_FragColor = vec4(mix(finalColor, vec3(1.0), nFresnel), 1.0);
|
|
847
863
|
#include <tonemapping_fragment>
|
|
848
|
-
#include
|
|
864
|
+
#include <${revision >= 154 ? 'colorspace_fragment' : 'encodings_fragment'}>
|
|
849
865
|
}`);
|
|
850
866
|
|
|
851
867
|
class MeshTransmissionMaterial extends THREE.MeshPhysicalMaterial {
|
|
@@ -864,7 +880,7 @@ class MeshTransmissionMaterial extends THREE.MeshPhysicalMaterial {
|
|
|
864
880
|
thicknessMap: { value: null },
|
|
865
881
|
attenuationDistance: { value: Infinity },
|
|
866
882
|
attenuationColor: { value: new THREE.Color('white') },
|
|
867
|
-
|
|
883
|
+
anisotropicBlur: { value: 0.1 },
|
|
868
884
|
time: { value: 0 },
|
|
869
885
|
distortion: { value: 0.0 },
|
|
870
886
|
distortionScale: { value: 0.5 },
|
|
@@ -876,6 +892,9 @@ class MeshTransmissionMaterial extends THREE.MeshPhysicalMaterial {
|
|
|
876
892
|
...shader.uniforms,
|
|
877
893
|
...this.uniforms,
|
|
878
894
|
};
|
|
895
|
+
if (this.anisotropy && this.anisotropy > 0) {
|
|
896
|
+
shader.defines['USE_ANISOTROPY'] = '';
|
|
897
|
+
}
|
|
879
898
|
// If the transmission sampler is active inject a flag
|
|
880
899
|
if (transmissionSampler)
|
|
881
900
|
shader.defines['USE_SAMPLER'] = '';
|
|
@@ -887,7 +906,7 @@ class MeshTransmissionMaterial extends THREE.MeshPhysicalMaterial {
|
|
|
887
906
|
shader.fragmentShader =
|
|
888
907
|
/*glsl*/ `
|
|
889
908
|
uniform float chromaticAberration;
|
|
890
|
-
uniform float
|
|
909
|
+
uniform float anisotropicBlur;
|
|
891
910
|
uniform float time;
|
|
892
911
|
uniform float distortion;
|
|
893
912
|
uniform float distortionScale;
|
|
@@ -1078,7 +1097,7 @@ class MeshTransmissionMaterial extends THREE.MeshPhysicalMaterial {
|
|
|
1078
1097
|
vec3 transmission = vec3(0.0);
|
|
1079
1098
|
float transmissionR, transmissionB, transmissionG;
|
|
1080
1099
|
float randomCoords = rand();
|
|
1081
|
-
float thickness_smear = thickness * max(pow(roughnessFactor, 0.33),
|
|
1100
|
+
float thickness_smear = thickness * max(pow(roughnessFactor, 0.33), anisotropicBlur);
|
|
1082
1101
|
vec3 distortionNormal = vec3(0.0);
|
|
1083
1102
|
vec3 temporalOffset = vec3(time, -time, -time) * temporalDistortion;
|
|
1084
1103
|
if (distortion > 0.0) {
|
|
@@ -1157,78 +1176,55 @@ const SoftShadowMaterial = shaderMaterial({
|
|
|
1157
1176
|
alphaTest: 0.75,
|
|
1158
1177
|
opacity: 0,
|
|
1159
1178
|
map: null,
|
|
1160
|
-
},
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
varying
|
|
1199
|
-
|
|
1200
|
-
void main() {
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
vec4 viewPosition = viewMatrix * modelPosition;
|
|
1208
|
-
vec4 projectionPostion = projectionMatrix * viewPosition;
|
|
1209
|
-
|
|
1210
|
-
gl_Position = projectionPostion;
|
|
1211
|
-
gl_PointSize = size * 25. * pixelRatio;
|
|
1212
|
-
gl_PointSize *= (1.0 / - viewPosition.z);
|
|
1213
|
-
|
|
1214
|
-
vColor = color;
|
|
1215
|
-
vOpacity = opacity;
|
|
1216
|
-
}
|
|
1217
|
-
`,
|
|
1218
|
-
// language=GLSL
|
|
1219
|
-
`
|
|
1220
|
-
varying vec3 vColor;
|
|
1221
|
-
varying float vOpacity;
|
|
1222
|
-
|
|
1223
|
-
void main() {
|
|
1224
|
-
float distanceToCenter = distance(gl_PointCoord, vec2(0.5));
|
|
1225
|
-
float strength = 0.05 / distanceToCenter - 0.1;
|
|
1226
|
-
|
|
1227
|
-
gl_FragColor = vec4(vColor, strength * vOpacity);
|
|
1228
|
-
}
|
|
1229
|
-
`);
|
|
1179
|
+
}, `varying vec2 vUv;
|
|
1180
|
+
void main() {
|
|
1181
|
+
gl_Position = projectionMatrix * viewMatrix * modelMatrix * vec4(position, 1.);
|
|
1182
|
+
vUv = uv;
|
|
1183
|
+
}`, `varying vec2 vUv;
|
|
1184
|
+
uniform sampler2D map;
|
|
1185
|
+
uniform vec3 color;
|
|
1186
|
+
uniform float opacity;
|
|
1187
|
+
uniform float alphaTest;
|
|
1188
|
+
uniform float blend;
|
|
1189
|
+
void main() {
|
|
1190
|
+
vec4 sampledDiffuseColor = texture2D(map, vUv);
|
|
1191
|
+
gl_FragColor = vec4(color * sampledDiffuseColor.r * blend, max(0.0, (1.0 - (sampledDiffuseColor.r + sampledDiffuseColor.g + sampledDiffuseColor.b) / alphaTest)) * opacity);
|
|
1192
|
+
#include <tonemapping_fragment>
|
|
1193
|
+
#include <${revision >= 154 ? 'colorspace_fragment' : 'encodings_fragment'}>
|
|
1194
|
+
}`);
|
|
1195
|
+
|
|
1196
|
+
const SparklesMaterial = shaderMaterial({ time: 0, pixelRatio: 1 }, ` uniform float pixelRatio;
|
|
1197
|
+
uniform float time;
|
|
1198
|
+
attribute float size;
|
|
1199
|
+
attribute float speed;
|
|
1200
|
+
attribute float opacity;
|
|
1201
|
+
attribute vec3 noise;
|
|
1202
|
+
attribute vec3 color;
|
|
1203
|
+
varying vec3 vColor;
|
|
1204
|
+
varying float vOpacity;
|
|
1205
|
+
void main() {
|
|
1206
|
+
vec4 modelPosition = modelMatrix * vec4(position, 1.0);
|
|
1207
|
+
modelPosition.y += sin(time * speed + modelPosition.x * noise.x * 100.0) * 0.2;
|
|
1208
|
+
modelPosition.z += cos(time * speed + modelPosition.x * noise.y * 100.0) * 0.2;
|
|
1209
|
+
modelPosition.x += cos(time * speed + modelPosition.x * noise.z * 100.0) * 0.2;
|
|
1210
|
+
vec4 viewPosition = viewMatrix * modelPosition;
|
|
1211
|
+
vec4 projectionPostion = projectionMatrix * viewPosition;
|
|
1212
|
+
gl_Position = projectionPostion;
|
|
1213
|
+
gl_PointSize = size * 25. * pixelRatio;
|
|
1214
|
+
gl_PointSize *= (1.0 / - viewPosition.z);
|
|
1215
|
+
vColor = color;
|
|
1216
|
+
vOpacity = opacity;
|
|
1217
|
+
}`, ` varying vec3 vColor;
|
|
1218
|
+
varying float vOpacity;
|
|
1219
|
+
void main() {
|
|
1220
|
+
float distanceToCenter = distance(gl_PointCoord, vec2(0.5));
|
|
1221
|
+
float strength = 0.05 / distanceToCenter - 0.1;
|
|
1222
|
+
gl_FragColor = vec4(vColor, strength * vOpacity);
|
|
1223
|
+
#include <tonemapping_fragment>
|
|
1224
|
+
#include <${revision >= 154 ? 'colorspace_fragment' : 'encodings_fragment'}>
|
|
1225
|
+
}`);
|
|
1230
1226
|
|
|
1231
|
-
class SpotLightMaterial extends ShaderMaterial {
|
|
1227
|
+
class SpotLightMaterial extends THREE.ShaderMaterial {
|
|
1232
1228
|
constructor() {
|
|
1233
1229
|
super({
|
|
1234
1230
|
uniforms: {
|
|
@@ -1236,11 +1232,11 @@ class SpotLightMaterial extends ShaderMaterial {
|
|
|
1236
1232
|
opacity: { value: 1 },
|
|
1237
1233
|
attenuation: { value: 2.5 },
|
|
1238
1234
|
anglePower: { value: 12 },
|
|
1239
|
-
spotPosition: { value: new Vector3(0, 0, 0) },
|
|
1240
|
-
lightColor: { value: new Color('white') },
|
|
1235
|
+
spotPosition: { value: new THREE.Vector3(0, 0, 0) },
|
|
1236
|
+
lightColor: { value: new THREE.Color('white') },
|
|
1241
1237
|
cameraNear: { value: 0 },
|
|
1242
1238
|
cameraFar: { value: 1 },
|
|
1243
|
-
resolution: { value: new Vector2(0, 0) },
|
|
1239
|
+
resolution: { value: new THREE.Vector2(0, 0) },
|
|
1244
1240
|
},
|
|
1245
1241
|
transparent: true,
|
|
1246
1242
|
depthWrite: false,
|
|
@@ -1307,7 +1303,7 @@ class SpotLightMaterial extends ShaderMaterial {
|
|
|
1307
1303
|
gl_FragColor = vec4(lightColor, intensity * opacity);
|
|
1308
1304
|
|
|
1309
1305
|
#include <tonemapping_fragment>
|
|
1310
|
-
#include
|
|
1306
|
+
#include <${revision >= 154 ? 'colorspace_fragment' : 'encodings_fragment'}>
|
|
1311
1307
|
}`,
|
|
1312
1308
|
});
|
|
1313
1309
|
}
|
|
@@ -1340,13 +1336,256 @@ void main() {
|
|
|
1340
1336
|
gl_FragColor = vec4(vColor, opacity);
|
|
1341
1337
|
|
|
1342
1338
|
#include <tonemapping_fragment>
|
|
1343
|
-
|
|
1339
|
+
#include <${revision >= 154 ? 'colorspace_fragment' : 'encodings_fragment'}>
|
|
1344
1340
|
}
|
|
1345
1341
|
`);
|
|
1346
1342
|
|
|
1343
|
+
const WireframeMaterialShaders = {
|
|
1344
|
+
uniforms: {
|
|
1345
|
+
strokeOpacity: 1,
|
|
1346
|
+
fillOpacity: 0.25,
|
|
1347
|
+
fillMix: 0,
|
|
1348
|
+
thickness: 0.05,
|
|
1349
|
+
colorBackfaces: false,
|
|
1350
|
+
dashInvert: true,
|
|
1351
|
+
dash: false,
|
|
1352
|
+
dashRepeats: 4,
|
|
1353
|
+
dashLength: 0.5,
|
|
1354
|
+
squeeze: false,
|
|
1355
|
+
squeezeMin: 0.2,
|
|
1356
|
+
squeezeMax: 1,
|
|
1357
|
+
stroke: new THREE.Color('#ff0000'),
|
|
1358
|
+
backfaceStroke: new THREE.Color('#0000ff'),
|
|
1359
|
+
fill: new THREE.Color('#00ff00'),
|
|
1360
|
+
},
|
|
1361
|
+
vertex: /* glsl */ `
|
|
1362
|
+
attribute vec3 barycentric;
|
|
1363
|
+
|
|
1364
|
+
varying vec3 v_edges_Barycentric;
|
|
1365
|
+
varying vec3 v_edges_Position;
|
|
1366
|
+
|
|
1367
|
+
void initWireframe() {
|
|
1368
|
+
v_edges_Barycentric = barycentric;
|
|
1369
|
+
v_edges_Position = position.xyz;
|
|
1370
|
+
}
|
|
1371
|
+
`,
|
|
1372
|
+
fragment: /* glsl */ `
|
|
1373
|
+
#ifndef PI
|
|
1374
|
+
#define PI 3.1415926535897932384626433832795
|
|
1375
|
+
#endif
|
|
1376
|
+
|
|
1377
|
+
varying vec3 v_edges_Barycentric;
|
|
1378
|
+
varying vec3 v_edges_Position;
|
|
1379
|
+
|
|
1380
|
+
uniform float strokeOpacity;
|
|
1381
|
+
uniform float fillOpacity;
|
|
1382
|
+
uniform float fillMix;
|
|
1383
|
+
uniform float thickness;
|
|
1384
|
+
uniform bool colorBackfaces;
|
|
1385
|
+
|
|
1386
|
+
// Dash
|
|
1387
|
+
uniform bool dashInvert;
|
|
1388
|
+
uniform bool dash;
|
|
1389
|
+
uniform bool dashOnly;
|
|
1390
|
+
uniform float dashRepeats;
|
|
1391
|
+
uniform float dashLength;
|
|
1392
|
+
|
|
1393
|
+
// Squeeze
|
|
1394
|
+
uniform bool squeeze;
|
|
1395
|
+
uniform float squeezeMin;
|
|
1396
|
+
uniform float squeezeMax;
|
|
1397
|
+
|
|
1398
|
+
// Colors
|
|
1399
|
+
uniform vec3 stroke;
|
|
1400
|
+
uniform vec3 backfaceStroke;
|
|
1401
|
+
uniform vec3 fill;
|
|
1402
|
+
|
|
1403
|
+
// This is like
|
|
1404
|
+
float wireframe_aastep(float threshold, float dist) {
|
|
1405
|
+
float afwidth = fwidth(dist) * 0.5;
|
|
1406
|
+
return smoothstep(threshold - afwidth, threshold + afwidth, dist);
|
|
1407
|
+
}
|
|
1408
|
+
|
|
1409
|
+
float wireframe_map(float value, float min1, float max1, float min2, float max2) {
|
|
1410
|
+
return min2 + (value - min1) * (max2 - min2) / (max1 - min1);
|
|
1411
|
+
}
|
|
1412
|
+
|
|
1413
|
+
float getWireframe() {
|
|
1414
|
+
vec3 barycentric = v_edges_Barycentric;
|
|
1415
|
+
|
|
1416
|
+
// Distance from center of each triangle to its edges.
|
|
1417
|
+
float d = min(min(barycentric.x, barycentric.y), barycentric.z);
|
|
1418
|
+
|
|
1419
|
+
// for dashed rendering, we can use this to get the 0 .. 1 value of the line length
|
|
1420
|
+
float positionAlong = max(barycentric.x, barycentric.y);
|
|
1421
|
+
if (barycentric.y < barycentric.x && barycentric.y < barycentric.z) {
|
|
1422
|
+
positionAlong = 1.0 - positionAlong;
|
|
1423
|
+
}
|
|
1424
|
+
|
|
1425
|
+
// the thickness of the stroke
|
|
1426
|
+
float computedThickness = wireframe_map(thickness, 0.0, 1.0, 0.0, 0.34);
|
|
1427
|
+
|
|
1428
|
+
// if we want to shrink the thickness toward the center of the line segment
|
|
1429
|
+
if (squeeze) {
|
|
1430
|
+
computedThickness *= mix(squeezeMin, squeezeMax, (1.0 - sin(positionAlong * PI)));
|
|
1431
|
+
}
|
|
1432
|
+
|
|
1433
|
+
// Create dash pattern
|
|
1434
|
+
if (dash) {
|
|
1435
|
+
// here we offset the stroke position depending on whether it
|
|
1436
|
+
// should overlap or not
|
|
1437
|
+
float offset = 1.0 / dashRepeats * dashLength / 2.0;
|
|
1438
|
+
if (!dashInvert) {
|
|
1439
|
+
offset += 1.0 / dashRepeats / 2.0;
|
|
1440
|
+
}
|
|
1441
|
+
|
|
1442
|
+
// if we should animate the dash or not
|
|
1443
|
+
// if (dashAnimate) {
|
|
1444
|
+
// offset += time * 0.22;
|
|
1445
|
+
// }
|
|
1446
|
+
|
|
1447
|
+
// create the repeating dash pattern
|
|
1448
|
+
float pattern = fract((positionAlong + offset) * dashRepeats);
|
|
1449
|
+
computedThickness *= 1.0 - wireframe_aastep(dashLength, pattern);
|
|
1450
|
+
}
|
|
1451
|
+
|
|
1452
|
+
// compute the anti-aliased stroke edge
|
|
1453
|
+
float edge = 1.0 - wireframe_aastep(computedThickness, d);
|
|
1454
|
+
|
|
1455
|
+
return edge;
|
|
1456
|
+
}
|
|
1457
|
+
`,
|
|
1458
|
+
};
|
|
1459
|
+
const WireframeMaterial = shaderMaterial(WireframeMaterialShaders.uniforms, WireframeMaterialShaders.vertex +
|
|
1460
|
+
/* glsl */ `
|
|
1461
|
+
void main() {
|
|
1462
|
+
initWireframe();
|
|
1463
|
+
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
|
|
1464
|
+
}
|
|
1465
|
+
`, WireframeMaterialShaders.fragment +
|
|
1466
|
+
/* glsl */ `
|
|
1467
|
+
void main () {
|
|
1468
|
+
// Compute color
|
|
1469
|
+
|
|
1470
|
+
float edge = getWireframe();
|
|
1471
|
+
vec4 colorStroke = vec4(stroke, edge);
|
|
1472
|
+
|
|
1473
|
+
#ifdef FLIP_SIDED
|
|
1474
|
+
colorStroke.rgb = backfaceStroke;
|
|
1475
|
+
#endif
|
|
1476
|
+
|
|
1477
|
+
vec4 colorFill = vec4(fill, fillOpacity);
|
|
1478
|
+
vec4 outColor = mix(colorFill, colorStroke, edge * strokeOpacity);
|
|
1479
|
+
|
|
1480
|
+
gl_FragColor = outColor;
|
|
1481
|
+
}
|
|
1482
|
+
`);
|
|
1483
|
+
function setWireframeOverride(material, uniforms) {
|
|
1484
|
+
material.onBeforeCompile = (shader) => {
|
|
1485
|
+
shader.uniforms = {
|
|
1486
|
+
...shader.uniforms,
|
|
1487
|
+
...uniforms,
|
|
1488
|
+
};
|
|
1489
|
+
shader.vertexShader = shader.vertexShader.replace('void main() {', `
|
|
1490
|
+
${WireframeMaterialShaders.vertex}
|
|
1491
|
+
void main() {
|
|
1492
|
+
initWireframe();
|
|
1493
|
+
`);
|
|
1494
|
+
shader.fragmentShader = shader.fragmentShader.replace('void main() {', `
|
|
1495
|
+
${WireframeMaterialShaders.fragment}
|
|
1496
|
+
void main() {
|
|
1497
|
+
`);
|
|
1498
|
+
shader.fragmentShader = shader.fragmentShader.replace('#include <color_fragment>',
|
|
1499
|
+
/* glsl */ `
|
|
1500
|
+
#include <color_fragment>
|
|
1501
|
+
float edge = getWireframe();
|
|
1502
|
+
vec4 colorStroke = vec4(stroke, edge);
|
|
1503
|
+
#ifdef FLIP_SIDED
|
|
1504
|
+
colorStroke.rgb = backfaceStroke;
|
|
1505
|
+
#endif
|
|
1506
|
+
vec4 colorFill = vec4(mix(diffuseColor.rgb, fill, fillMix), mix(diffuseColor.a, fillOpacity, fillMix));
|
|
1507
|
+
vec4 outColor = mix(colorFill, colorStroke, edge * strokeOpacity);
|
|
1508
|
+
|
|
1509
|
+
diffuseColor.rgb = outColor.rgb;
|
|
1510
|
+
diffuseColor.a *= outColor.a;
|
|
1511
|
+
`);
|
|
1512
|
+
};
|
|
1513
|
+
material.side = THREE.DoubleSide;
|
|
1514
|
+
material.transparent = true;
|
|
1515
|
+
}
|
|
1516
|
+
function injectNgtsWireframeUniforms(uniformsFactory, stateFactory, { injector } = {}) {
|
|
1517
|
+
injector = assertInjector(injectNgtsWireframeUniforms, injector);
|
|
1518
|
+
return runInInjectionContext(injector, () => {
|
|
1519
|
+
const uniforms = uniformsFactory();
|
|
1520
|
+
const state = computed(() => stateFactory());
|
|
1521
|
+
const fillOpacity = computed(() => state().fillOpacity);
|
|
1522
|
+
const fillMix = computed(() => state().fillMix);
|
|
1523
|
+
const strokeOpacity = computed(() => state().strokeOpacity);
|
|
1524
|
+
const thickness = computed(() => state().thickness);
|
|
1525
|
+
const colorBackfaces = computed(() => state().colorBackfaces);
|
|
1526
|
+
const dash = computed(() => state().dash);
|
|
1527
|
+
const dashInvert = computed(() => state().dashInvert);
|
|
1528
|
+
const dashRepeats = computed(() => state().dashRepeats);
|
|
1529
|
+
const dashLength = computed(() => state().dashLength);
|
|
1530
|
+
const squeeze = computed(() => state().squeeze);
|
|
1531
|
+
const squeezeMin = computed(() => state().squeezeMin);
|
|
1532
|
+
const squeezeMax = computed(() => state().squeezeMax);
|
|
1533
|
+
const stroke = computed(() => state().stroke);
|
|
1534
|
+
const fill = computed(() => state().fill);
|
|
1535
|
+
const backfaceStroke = computed(() => state().backfaceStroke);
|
|
1536
|
+
effect(() => {
|
|
1537
|
+
uniforms['fillOpacity'].value = fillOpacity() ?? uniforms['fillOpacity'].value;
|
|
1538
|
+
});
|
|
1539
|
+
effect(() => {
|
|
1540
|
+
uniforms['fillMix'].value = fillMix() ?? uniforms['fillMix'].value;
|
|
1541
|
+
});
|
|
1542
|
+
effect(() => {
|
|
1543
|
+
uniforms['strokeOpacity'].value = strokeOpacity() ?? uniforms['strokeOpacity'].value;
|
|
1544
|
+
});
|
|
1545
|
+
effect(() => {
|
|
1546
|
+
uniforms['thickness'].value = thickness() ?? uniforms['thickness'].value;
|
|
1547
|
+
});
|
|
1548
|
+
effect(() => {
|
|
1549
|
+
uniforms['colorBackfaces'].value = colorBackfaces() ?? uniforms['colorBackfaces'].value;
|
|
1550
|
+
});
|
|
1551
|
+
effect(() => {
|
|
1552
|
+
uniforms['dash'].value = dash() ?? uniforms['dash'].value;
|
|
1553
|
+
});
|
|
1554
|
+
effect(() => {
|
|
1555
|
+
uniforms['dashInvert'].value = dashInvert() ?? uniforms['dashInvert'].value;
|
|
1556
|
+
});
|
|
1557
|
+
effect(() => {
|
|
1558
|
+
uniforms['dashRepeats'].value = dashRepeats() ?? uniforms['dashRepeats'].value;
|
|
1559
|
+
});
|
|
1560
|
+
effect(() => {
|
|
1561
|
+
uniforms['dashLength'].value = dashLength() ?? uniforms['dashLength'].value;
|
|
1562
|
+
});
|
|
1563
|
+
effect(() => {
|
|
1564
|
+
uniforms['squeeze'].value = squeeze() ?? uniforms['squeeze'].value;
|
|
1565
|
+
});
|
|
1566
|
+
effect(() => {
|
|
1567
|
+
uniforms['squeezeMin'].value = squeezeMin() ?? uniforms['squeezeMin'].value;
|
|
1568
|
+
});
|
|
1569
|
+
effect(() => {
|
|
1570
|
+
uniforms['squeezeMax'].value = squeezeMax() ?? uniforms['squeezeMax'].value;
|
|
1571
|
+
});
|
|
1572
|
+
effect(() => {
|
|
1573
|
+
uniforms['stroke'].value = stroke() ? new THREE.Color(stroke()) : uniforms['stroke'].value;
|
|
1574
|
+
});
|
|
1575
|
+
effect(() => {
|
|
1576
|
+
uniforms['fill'].value = fill() ? new THREE.Color(fill()) : uniforms['fill'].value;
|
|
1577
|
+
});
|
|
1578
|
+
effect(() => {
|
|
1579
|
+
uniforms['backfaceStroke'].value = backfaceStroke()
|
|
1580
|
+
? new THREE.Color(backfaceStroke())
|
|
1581
|
+
: uniforms['backfaceStroke'].value;
|
|
1582
|
+
});
|
|
1583
|
+
});
|
|
1584
|
+
}
|
|
1585
|
+
|
|
1347
1586
|
/**
|
|
1348
1587
|
* Generated bundle index. Do not edit.
|
|
1349
1588
|
*/
|
|
1350
1589
|
|
|
1351
|
-
export { BlurPass, CausticsMaterial, CausticsProjectionMaterial, ConvolutionMaterial, DiscardMaterial, GridMaterial, MeshReflectorMaterial, MeshRefractionMaterial, MeshTransmissionMaterial, MeshWobbleMaterial, NGTS_DISTORT_MATERIAL_SHADER, SoftShadowMaterial, SparklesMaterial, SpotLightMaterial, StarFieldMaterial, provideNgtsMeshDistortMaterialShader };
|
|
1590
|
+
export { BlurPass, CausticsMaterial, CausticsProjectionMaterial, ConvolutionMaterial, DiscardMaterial, GridMaterial, MeshReflectorMaterial, MeshRefractionMaterial, MeshTransmissionMaterial, MeshWobbleMaterial, NGTS_DISTORT_MATERIAL_SHADER, SoftShadowMaterial, SparklesMaterial, SpotLightMaterial, StarFieldMaterial, WireframeMaterial, WireframeMaterialShaders, createMeshDistortMaterial, injectNgtsMeshDistortMaterial, injectNgtsWireframeUniforms, provideNgtsMeshDistortMaterialShader, setWireframeOverride, shaderMaterial };
|
|
1352
1591
|
//# sourceMappingURL=angular-three-soba-shaders.mjs.map
|