three-base 2.0.142 → 2.0.145

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.
Files changed (227) hide show
  1. package/DirectionalLight.d.ts +6 -6
  2. package/DirectionalLight.js +68 -68
  3. package/EventMap.d.ts +103 -103
  4. package/EventMap.js +17 -17
  5. package/EventMesh.d.ts +18 -18
  6. package/EventMesh.js +59 -59
  7. package/ExtrudeMesh.d.ts +112 -112
  8. package/ExtrudeMesh.js +342 -342
  9. package/FPScontrol.d.ts +511 -511
  10. package/FPScontrol.js +1799 -1799
  11. package/FPScontrol.ts +1855 -1855
  12. package/Fire/Fire.d.ts +28 -28
  13. package/Fire/Fire.js +80 -80
  14. package/Fire/FireGeometry.d.ts +9 -9
  15. package/Fire/FireGeometry.js +40 -40
  16. package/Fire/FireMaterial.d.ts +28 -28
  17. package/Fire/FireMaterial.js +32 -32
  18. package/Fire/index.d.ts +2 -2
  19. package/Fire/index.js +2 -2
  20. package/GLTFDracoLoader.d.ts +71 -71
  21. package/GLTFDracoLoader.js +266 -266
  22. package/GLTFDracoLoader.ts +1 -1
  23. package/Grass/Grass.d.ts +8 -8
  24. package/Grass/Grass.js +38 -38
  25. package/Grass/index.d.ts +2 -2
  26. package/Grass/index.js +2 -2
  27. package/Ground1/Ground1.d.ts +10 -10
  28. package/Ground1/Ground1.js +71 -71
  29. package/Ground1/index.d.ts +1 -1
  30. package/Ground1/index.js +1 -1
  31. package/MeshBase.d.ts +36 -36
  32. package/MeshBase.js +247 -247
  33. package/Mirror.d.ts +25 -25
  34. package/Mirror.js +143 -143
  35. package/MktMesh/MktMesh.d.ts +301 -291
  36. package/MktMesh/MktMesh.js +1064 -1045
  37. package/MktMesh/MktMesh.ts +32 -11
  38. package/MktMesh/assetUrl.d.ts +59 -35
  39. package/MktMesh/assetUrl.js +154 -69
  40. package/MktMesh/assetUrl.ts +155 -69
  41. package/MktMesh/mktMappingShader.d.ts +12 -12
  42. package/MktMesh/mktMappingShader.js +138 -138
  43. package/MktMesh/mktMappingShader.ts +139 -139
  44. package/MktMesh/mktShader.d.ts +263 -263
  45. package/MktMesh/mktShader.js +1236 -1236
  46. package/MktMesh/mktShader.ts +1344 -1344
  47. package/MktMesh/panoBitmapTexture.d.ts +25 -25
  48. package/MktMesh/panoBitmapTexture.js +52 -52
  49. package/MktMesh/panoBitmapTexture.ts +54 -54
  50. package/MktMesh/panoSlotBind.d.ts +29 -29
  51. package/MktMesh/panoSlotBind.js +106 -106
  52. package/MktMesh/panoSlotBind.ts +153 -153
  53. package/MktMesh/panoSlotRoster.d.ts +22 -22
  54. package/MktMesh/panoSlotRoster.js +169 -169
  55. package/MktMesh/panoSlotRoster.ts +168 -168
  56. package/MktMesh/panoTileStitcher.d.ts +119 -119
  57. package/MktMesh/panoTileStitcher.js +529 -529
  58. package/MktMesh/panoTileStitcher.ts +616 -616
  59. package/MktMesh/types.d.ts +75 -75
  60. package/MktMesh/types.js +1 -1
  61. package/MktMesh/wallCapTessellate.d.ts +33 -33
  62. package/MktMesh/wallCapTessellate.js +97 -97
  63. package/MktMesh/wallCapTessellate.ts +68 -68
  64. package/PipeMesh/PathGeometry.d.ts +44 -44
  65. package/PipeMesh/PathGeometry.js +307 -307
  66. package/PipeMesh/PathPoint.d.ts +17 -17
  67. package/PipeMesh/PathPoint.js +31 -31
  68. package/PipeMesh/PathPointList.d.ts +31 -31
  69. package/PipeMesh/PathPointList.js +209 -209
  70. package/PipeMesh/PathTubeGeometry.d.ts +25 -25
  71. package/PipeMesh/PathTubeGeometry.js +130 -130
  72. package/PipeMesh/PipeMesh.d.ts +25 -25
  73. package/PipeMesh/PipeMesh.js +63 -63
  74. package/PipeMesh/index.d.ts +1 -1
  75. package/PipeMesh/index.js +1 -1
  76. package/PlaneModal1/PlaneModal1.d.ts +34 -34
  77. package/PlaneModal1/PlaneModal1.js +109 -109
  78. package/PlaneModal1/index.d.ts +1 -1
  79. package/PlaneModal1/index.js +1 -1
  80. package/PlaneText.d.ts +27 -27
  81. package/PlaneText.js +35 -35
  82. package/PlaneWithHtml.d.ts +13 -13
  83. package/PlaneWithHtml.js +64 -64
  84. package/PointLight/PointLight.d.ts +13 -13
  85. package/PointLight/PointLight.js +64 -64
  86. package/PointLight/index.d.ts +1 -1
  87. package/PointLight/index.js +1 -1
  88. package/Sky/Sky.d.ts +9 -9
  89. package/Sky/Sky.js +22 -22
  90. package/Sky/index.d.ts +1 -1
  91. package/Sky/index.js +1 -1
  92. package/SpotLight.d.ts +6 -6
  93. package/SpotLight.js +72 -72
  94. package/SpriteModal1/SpriteModal1.d.ts +33 -33
  95. package/SpriteModal1/SpriteModal1.js +116 -116
  96. package/SpriteModal1/index.d.ts +1 -1
  97. package/SpriteModal1/index.js +1 -1
  98. package/SpriteText.d.ts +46 -46
  99. package/SpriteText.js +176 -176
  100. package/SpriteText2.d.ts +48 -48
  101. package/SpriteText2.js +223 -223
  102. package/SpriteText3.d.ts +86 -86
  103. package/SpriteText3.js +517 -517
  104. package/SpriteText3.ts +599 -599
  105. package/SpriteWithHtml.d.ts +9 -9
  106. package/SpriteWithHtml.js +44 -44
  107. package/Text3D/Text3D.d.ts +20 -20
  108. package/Text3D/Text3D.js +58 -58
  109. package/Text3D/fontController.d.ts +60 -60
  110. package/Text3D/fontController.js +166 -166
  111. package/Text3D/index.d.ts +1 -1
  112. package/Text3D/index.js +1 -1
  113. package/ThreeBase.d.ts +248 -248
  114. package/ThreeBase.js +1202 -1202
  115. package/ThreeBase.ts +1314 -1314
  116. package/ThreeMouse.d.ts +53 -54
  117. package/ThreeMouse.js +453 -453
  118. package/Transition.d.ts +45 -45
  119. package/Transition.js +209 -209
  120. package/Water/Water.d.ts +5 -5
  121. package/Water/Water.js +44 -44
  122. package/Water/index.d.ts +2 -2
  123. package/Water/index.js +2 -2
  124. package/WaterFlow/FloatingDuck.d.ts +88 -88
  125. package/WaterFlow/FloatingDuck.js +307 -307
  126. package/WaterFlow/FloatingDuck.ts +445 -445
  127. package/WaterFlow/GPUFluidSimulation.d.ts +56 -56
  128. package/WaterFlow/GPUFluidSimulation.js +781 -781
  129. package/WaterFlow/GPUFluidSimulation.ts +827 -827
  130. package/WaterFlow/ReservoirSystem.d.ts +106 -106
  131. package/WaterFlow/ReservoirSystem.js +611 -611
  132. package/WaterFlow/ReservoirSystem.ts +754 -754
  133. package/WaterFlow/SPHField.d.ts +35 -35
  134. package/WaterFlow/SPHField.js +203 -203
  135. package/WaterFlow/SPHField.ts +228 -228
  136. package/WaterFlow/ScreenSpaceFluidPass.d.ts +69 -69
  137. package/WaterFlow/ScreenSpaceFluidPass.js +728 -728
  138. package/WaterFlow/ScreenSpaceFluidPass.ts +789 -789
  139. package/WaterFlow/ShallowWaterSurface.d.ts +45 -45
  140. package/WaterFlow/ShallowWaterSurface.js +438 -438
  141. package/WaterFlow/ShallowWaterSurface.ts +510 -510
  142. package/WaterFlow/WaterFlow.d.ts +87 -87
  143. package/WaterFlow/WaterFlow.js +171 -171
  144. package/WaterFlow/WaterFlow.ts +219 -219
  145. package/WaterFlow/types.d.ts +161 -161
  146. package/WaterFlow/types.js +1 -1
  147. package/WaterFlow/types.ts +189 -189
  148. package/WaterFlow/waterFlowPass.d.ts +3 -3
  149. package/WaterFlow/waterFlowPass.js +20 -20
  150. package/WaterFlow/waterFlowPass.ts +40 -40
  151. package/collisionOBB.d.ts +42 -42
  152. package/collisionOBB.js +112 -112
  153. package/collisionOBB.ts +108 -108
  154. package/declare.d.ts +25 -25
  155. package/index.d.ts +1 -1
  156. package/index.js +1 -1
  157. package/instanced/InstancedBatch.d.ts +57 -57
  158. package/instanced/InstancedBatch.js +348 -348
  159. package/instanced/InstancedBatch.ts +406 -406
  160. package/instanced/InstancedChild.d.ts +174 -174
  161. package/instanced/InstancedChild.js +264 -264
  162. package/instanced/InstancedChild.ts +327 -327
  163. package/instanced/InstancedGroup.d.ts +43 -43
  164. package/instanced/InstancedGroup.js +126 -126
  165. package/instanced/InstancedGroup.ts +137 -137
  166. package/instanced/InstancedMeshBase.d.ts +38 -38
  167. package/instanced/InstancedMeshBase.js +282 -282
  168. package/instanced/InstancedTemplate.d.ts +46 -46
  169. package/instanced/InstancedTemplate.js +125 -125
  170. package/keyControls.d.ts +29 -30
  171. package/keyControls.js +101 -101
  172. package/lensflare/LensFlare.d.ts +39 -39
  173. package/lensflare/LensFlare.js +284 -284
  174. package/package.json +6 -1
  175. package/pass/bloom_pass.d.ts +2 -2
  176. package/pass/bloom_pass.js +174 -174
  177. package/pass/cover_pass.d.ts +2 -2
  178. package/pass/cover_pass.js +108 -108
  179. package/pass/debugDepthState.d.ts +20 -20
  180. package/pass/debugDepthState.js +9 -9
  181. package/pass/debugDepthState.ts +22 -22
  182. package/pass/depthTestBias.d.ts +12 -12
  183. package/pass/depthTestBias.js +12 -12
  184. package/pass/depthTestBias.ts +12 -12
  185. package/pass/effectUserData.d.ts +27 -27
  186. package/pass/effectUserData.js +1 -1
  187. package/pass/effectUserData.ts +46 -46
  188. package/pass/frosted_glass_pass.d.ts +2 -2
  189. package/pass/frosted_glass_pass.js +150 -150
  190. package/pass/fsQuad.d.ts +9 -9
  191. package/pass/fsQuad.js +28 -28
  192. package/pass/glow_pass.d.ts +2 -2
  193. package/pass/glow_pass.js +350 -350
  194. package/pass/screen_bloom_pass.d.ts +11 -11
  195. package/pass/screen_bloom_pass.js +136 -136
  196. package/pass/ssao_pass.d.ts +88 -88
  197. package/pass/ssao_pass.js +799 -799
  198. package/pass/ssao_pass.ts +918 -918
  199. package/pass/stroke_pass.d.ts +2 -2
  200. package/pass/stroke_pass.js +267 -267
  201. package/shaders/FXAAShaderMaterial.d.ts +3 -3
  202. package/shaders/FXAAShaderMaterial.js +20 -20
  203. package/shaders/baseDepthVisShader.d.ts +11 -11
  204. package/shaders/baseDepthVisShader.js +36 -36
  205. package/shaders/baseDepthVisShader.ts +36 -36
  206. package/shaders/baseTextureToRenderShader.d.ts +2 -2
  207. package/shaders/baseTextureToRenderShader.js +19 -19
  208. package/shaders/copyShader.d.ts +3 -3
  209. package/shaders/copyShader.js +13 -13
  210. package/shaders/debugDepthCompareShader.d.ts +14 -14
  211. package/shaders/debugDepthCompareShader.js +49 -49
  212. package/shaders/debugDepthCompareShader.ts +50 -50
  213. package/shaders/debugDepthJudgeShader.d.ts +18 -18
  214. package/shaders/debugDepthJudgeShader.js +52 -52
  215. package/shaders/debugDepthJudgeShader.ts +54 -54
  216. package/shaders/debugExcludedShader.d.ts +13 -13
  217. package/shaders/debugExcludedShader.js +46 -46
  218. package/shaders/debugExcludedShader.ts +48 -48
  219. package/spriteTextBg.d.ts +1 -1
  220. package/spriteTextBg.js +20 -20
  221. package/spriteTextBg.ts +20 -20
  222. package/threeLoader.d.ts +35 -35
  223. package/threeLoader.js +518 -518
  224. package/threeUtils.d.ts +53 -53
  225. package/threeUtils.js +329 -329
  226. package/types.d.ts +2 -2
  227. package/types.js +6 -6
@@ -1,15 +1,15 @@
1
- /*
2
- * @Author: xiaosihan
3
- * @Date: 2024-01-20 05:10:37
4
- * @Last Modified by: xiaosihan
5
- * @Last Modified time: 2024-01-20 05:10:57
6
- */
7
- import { NoBlending, ShaderChunk, ShaderMaterial, Vector2 } from "three";
8
- const FXAAShaderMaterial = new ShaderMaterial({
9
- uniforms: {
10
- tDiffuse: { value: null },
11
- resolution: { value: new Vector2(1 / 1024, 1 / 1024) }
12
- },
1
+ /*
2
+ * @Author: xiaosihan
3
+ * @Date: 2024-01-20 05:10:37
4
+ * @Last Modified by: xiaosihan
5
+ * @Last Modified time: 2024-01-20 05:10:57
6
+ */
7
+ import { NoBlending, ShaderChunk, ShaderMaterial, Vector2 } from "three";
8
+ const FXAAShaderMaterial = new ShaderMaterial({
9
+ uniforms: {
10
+ tDiffuse: { value: null },
11
+ resolution: { value: new Vector2(1 / 1024, 1 / 1024) }
12
+ },
13
13
  vertexShader: `
14
14
  ${ShaderChunk.common}
15
15
  ${ShaderChunk.logdepthbuf_pars_vertex}
@@ -19,7 +19,7 @@ const FXAAShaderMaterial = new ShaderMaterial({
19
19
  gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
20
20
  ${ShaderChunk.logdepthbuf_vertex}
21
21
  }
22
- `,
22
+ `,
23
23
  fragmentShader: `
24
24
  ${ShaderChunk.logdepthbuf_pars_fragment}
25
25
  precision highp float;
@@ -192,10 +192,10 @@ const FXAAShaderMaterial = new ShaderMaterial({
192
192
  );
193
193
  ${ShaderChunk.logdepthbuf_fragment}
194
194
  }
195
- `,
196
- blending: NoBlending,
197
- depthTest: false,
198
- depthWrite: false,
199
- transparent: true
200
- });
201
- export default FXAAShaderMaterial;
195
+ `,
196
+ blending: NoBlending,
197
+ depthTest: false,
198
+ depthWrite: false,
199
+ transparent: true
200
+ });
201
+ export default FXAAShaderMaterial;
@@ -1,11 +1,11 @@
1
- import { ShaderMaterial } from "three";
2
- /**
3
- * 调试用:把 baseDepthTexture(可见深度图)直接以灰度输出到屏幕。
4
- * 对数深度:近=0(黑) 远=1(白)。
5
- * - 全屏纯白 → 深度图为空(全 clear 1.0),说明 renderAoDepthPass 没把深度写进 baseDepthTexture;
6
- * 此时所有依赖深度遮挡的后处理(stroke/glow/cover/frosted)都会"一律显示在前"。
7
- * - 有灰阶/明暗 → 深度图正常,问题在比对侧(selectDepth / depthTestShader)。
8
- * 触发:在控制台执行 `window.__BASE_DEPTH_VIS = true` 后画面即切到该视图。
9
- */
10
- declare const baseDepthVisShader: ShaderMaterial;
11
- export default baseDepthVisShader;
1
+ import { ShaderMaterial } from "three";
2
+ /**
3
+ * 调试用:把 baseDepthTexture(可见深度图)直接以灰度输出到屏幕。
4
+ * 对数深度:近=0(黑) 远=1(白)。
5
+ * - 全屏纯白 → 深度图为空(全 clear 1.0),说明 renderAoDepthPass 没把深度写进 baseDepthTexture;
6
+ * 此时所有依赖深度遮挡的后处理(stroke/glow/cover/frosted)都会"一律显示在前"。
7
+ * - 有灰阶/明暗 → 深度图正常,问题在比对侧(selectDepth / depthTestShader)。
8
+ * 触发:在控制台执行 `window.__BASE_DEPTH_VIS = true` 后画面即切到该视图。
9
+ */
10
+ declare const baseDepthVisShader: ShaderMaterial;
11
+ export default baseDepthVisShader;
@@ -1,36 +1,36 @@
1
- import { ShaderChunk, ShaderMaterial } from "three";
2
- /**
3
- * 调试用:把 baseDepthTexture(可见深度图)直接以灰度输出到屏幕。
4
- * 对数深度:近=0(黑) 远=1(白)。
5
- * - 全屏纯白 → 深度图为空(全 clear 1.0),说明 renderAoDepthPass 没把深度写进 baseDepthTexture;
6
- * 此时所有依赖深度遮挡的后处理(stroke/glow/cover/frosted)都会"一律显示在前"。
7
- * - 有灰阶/明暗 → 深度图正常,问题在比对侧(selectDepth / depthTestShader)。
8
- * 触发:在控制台执行 `window.__BASE_DEPTH_VIS = true` 后画面即切到该视图。
9
- */
10
- const baseDepthVisShader = new ShaderMaterial({
11
- uniforms: {
12
- tDepth: { value: null },
13
- },
14
- vertexShader: `
15
- ${ShaderChunk.common}
16
- ${ShaderChunk.logdepthbuf_pars_vertex}
17
- varying vec2 vUv;
18
- void main() {
19
- vUv = uv;
20
- gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
21
- ${ShaderChunk.logdepthbuf_vertex}
22
- }
23
- `,
24
- fragmentShader: `
25
- uniform sampler2D tDepth;
26
- varying vec2 vUv;
27
- void main() {
28
- float d = texture2D(tDepth, vUv).r;
29
- gl_FragColor = vec4(d, d, d, 1.0);
30
- }
31
- `,
32
- depthTest: false,
33
- depthWrite: false,
34
- transparent: true,
35
- });
36
- export default baseDepthVisShader;
1
+ import { ShaderChunk, ShaderMaterial } from "three";
2
+ /**
3
+ * 调试用:把 baseDepthTexture(可见深度图)直接以灰度输出到屏幕。
4
+ * 对数深度:近=0(黑) 远=1(白)。
5
+ * - 全屏纯白 → 深度图为空(全 clear 1.0),说明 renderAoDepthPass 没把深度写进 baseDepthTexture;
6
+ * 此时所有依赖深度遮挡的后处理(stroke/glow/cover/frosted)都会"一律显示在前"。
7
+ * - 有灰阶/明暗 → 深度图正常,问题在比对侧(selectDepth / depthTestShader)。
8
+ * 触发:在控制台执行 `window.__BASE_DEPTH_VIS = true` 后画面即切到该视图。
9
+ */
10
+ const baseDepthVisShader = new ShaderMaterial({
11
+ uniforms: {
12
+ tDepth: { value: null },
13
+ },
14
+ vertexShader: `
15
+ ${ShaderChunk.common}
16
+ ${ShaderChunk.logdepthbuf_pars_vertex}
17
+ varying vec2 vUv;
18
+ void main() {
19
+ vUv = uv;
20
+ gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
21
+ ${ShaderChunk.logdepthbuf_vertex}
22
+ }
23
+ `,
24
+ fragmentShader: `
25
+ uniform sampler2D tDepth;
26
+ varying vec2 vUv;
27
+ void main() {
28
+ float d = texture2D(tDepth, vUv).r;
29
+ gl_FragColor = vec4(d, d, d, 1.0);
30
+ }
31
+ `,
32
+ depthTest: false,
33
+ depthWrite: false,
34
+ transparent: true,
35
+ });
36
+ export default baseDepthVisShader;
@@ -1,36 +1,36 @@
1
- import { ShaderChunk, ShaderMaterial } from "three";
2
- /**
3
- * 调试用:把 baseDepthTexture(可见深度图)直接以灰度输出到屏幕。
4
- * 对数深度:近=0(黑) 远=1(白)。
5
- * - 全屏纯白 → 深度图为空(全 clear 1.0),说明 renderAoDepthPass 没把深度写进 baseDepthTexture;
6
- * 此时所有依赖深度遮挡的后处理(stroke/glow/cover/frosted)都会"一律显示在前"。
7
- * - 有灰阶/明暗 → 深度图正常,问题在比对侧(selectDepth / depthTestShader)。
8
- * 触发:在控制台执行 `window.__BASE_DEPTH_VIS = true` 后画面即切到该视图。
9
- */
10
- const baseDepthVisShader = new ShaderMaterial({
11
- uniforms: {
12
- tDepth: { value: null as unknown as import("three").Texture },
13
- },
14
- vertexShader: `
15
- ${ShaderChunk.common}
16
- ${ShaderChunk.logdepthbuf_pars_vertex}
17
- varying vec2 vUv;
18
- void main() {
19
- vUv = uv;
20
- gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
21
- ${ShaderChunk.logdepthbuf_vertex}
22
- }
23
- `,
24
- fragmentShader: `
25
- uniform sampler2D tDepth;
26
- varying vec2 vUv;
27
- void main() {
28
- float d = texture2D(tDepth, vUv).r;
29
- gl_FragColor = vec4(d, d, d, 1.0);
30
- }
31
- `,
32
- depthTest: false,
33
- depthWrite: false,
34
- transparent: true,
35
- });
36
- export default baseDepthVisShader;
1
+ import { ShaderChunk, ShaderMaterial } from "three";
2
+ /**
3
+ * 调试用:把 baseDepthTexture(可见深度图)直接以灰度输出到屏幕。
4
+ * 对数深度:近=0(黑) 远=1(白)。
5
+ * - 全屏纯白 → 深度图为空(全 clear 1.0),说明 renderAoDepthPass 没把深度写进 baseDepthTexture;
6
+ * 此时所有依赖深度遮挡的后处理(stroke/glow/cover/frosted)都会"一律显示在前"。
7
+ * - 有灰阶/明暗 → 深度图正常,问题在比对侧(selectDepth / depthTestShader)。
8
+ * 触发:在控制台执行 `window.__BASE_DEPTH_VIS = true` 后画面即切到该视图。
9
+ */
10
+ const baseDepthVisShader = new ShaderMaterial({
11
+ uniforms: {
12
+ tDepth: { value: null as unknown as import("three").Texture },
13
+ },
14
+ vertexShader: `
15
+ ${ShaderChunk.common}
16
+ ${ShaderChunk.logdepthbuf_pars_vertex}
17
+ varying vec2 vUv;
18
+ void main() {
19
+ vUv = uv;
20
+ gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
21
+ ${ShaderChunk.logdepthbuf_vertex}
22
+ }
23
+ `,
24
+ fragmentShader: `
25
+ uniform sampler2D tDepth;
26
+ varying vec2 vUv;
27
+ void main() {
28
+ float d = texture2D(tDepth, vUv).r;
29
+ gl_FragColor = vec4(d, d, d, 1.0);
30
+ }
31
+ `,
32
+ depthTest: false,
33
+ depthWrite: false,
34
+ transparent: true,
35
+ });
36
+ export default baseDepthVisShader;
@@ -1,2 +1,2 @@
1
- import { ShaderMaterial } from "three";
2
- export declare const baseTextureToRenderShader: ShaderMaterial;
1
+ import { ShaderMaterial } from "three";
2
+ export declare const baseTextureToRenderShader: ShaderMaterial;
@@ -1,11 +1,11 @@
1
- import { ShaderMaterial, Vector2, ShaderChunk, NoBlending } from "three";
2
- export const baseTextureToRenderShader = new ShaderMaterial({
3
- uniforms: {
4
- tDiffuse: { value: null },
5
- resolution: { value: new Vector2(1 / 1024, 1 / 1024) },
6
- /** 抖动强度:1.0 = 标准 ±0.5 LSB(总跨度 1/255),0 = 关闭(A/B 对比用) */
7
- uDitherStrength: { value: 1.0 }
8
- },
1
+ import { ShaderMaterial, Vector2, ShaderChunk, NoBlending } from "three";
2
+ export const baseTextureToRenderShader = new ShaderMaterial({
3
+ uniforms: {
4
+ tDiffuse: { value: null },
5
+ resolution: { value: new Vector2(1 / 1024, 1 / 1024) },
6
+ /** 抖动强度:1.0 = 标准 ±0.5 LSB(总跨度 1/255),0 = 关闭(A/B 对比用) */
7
+ uDitherStrength: { value: 1.0 }
8
+ },
9
9
  vertexShader: `
10
10
  ${ShaderChunk.common}
11
11
  ${ShaderChunk.logdepthbuf_pars_vertex}
@@ -15,7 +15,7 @@ export const baseTextureToRenderShader = new ShaderMaterial({
15
15
  gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
16
16
  ${ShaderChunk.logdepthbuf_vertex}
17
17
  }
18
- `,
18
+ `,
19
19
  fragmentShader: `
20
20
  ${ShaderChunk.logdepthbuf_pars_fragment}
21
21
  precision highp float;
@@ -220,13 +220,13 @@ export const baseTextureToRenderShader = new ShaderMaterial({
220
220
  gl_FragColor = vec4(srgbColor.rgb + dither, srgbColor.a);
221
221
  ${ShaderChunk.logdepthbuf_fragment}
222
222
  }
223
- `,
224
- blending: NoBlending,
225
- depthTest: false,
226
- depthWrite: false,
227
- transparent: true,
228
- // 终处理:手写 sRGBTransferOETF 已是唯一一次 sRGB 编码;关闭 three 的自动 tonemap/colorspace 注入,
229
- // 防止渲染到屏幕时被 three 再编码一次(本 ShaderMaterial 不写 include 块,three 本就不会注入,
230
- // 这里显式置 false 仅是防御,保证颜色空间语义单一可控)。
231
- toneMapped: false,
232
- });
223
+ `,
224
+ blending: NoBlending,
225
+ depthTest: false,
226
+ depthWrite: false,
227
+ transparent: true,
228
+ // 终处理:手写 sRGBTransferOETF 已是唯一一次 sRGB 编码;关闭 three 的自动 tonemap/colorspace 注入,
229
+ // 防止渲染到屏幕时被 three 再编码一次(本 ShaderMaterial 不写 include 块,three 本就不会注入,
230
+ // 这里显式置 false 仅是防御,保证颜色空间语义单一可控)。
231
+ toneMapped: false,
232
+ });
@@ -1,3 +1,3 @@
1
- import { ShaderMaterial } from "three";
2
- declare const copyShader: ShaderMaterial;
3
- export default copyShader;
1
+ import { ShaderMaterial } from "three";
2
+ declare const copyShader: ShaderMaterial;
3
+ export default copyShader;
@@ -1,9 +1,9 @@
1
- import { ShaderChunk, ShaderMaterial } from "three";
2
- const copyShader = new ShaderMaterial({
3
- uniforms: {
4
- map: { value: null },
5
- opacity: { value: 1 },
6
- },
1
+ import { ShaderChunk, ShaderMaterial } from "three";
2
+ const copyShader = new ShaderMaterial({
3
+ uniforms: {
4
+ map: { value: null },
5
+ opacity: { value: 1 },
6
+ },
7
7
  vertexShader: `
8
8
  ${ShaderChunk.common}
9
9
  ${ShaderChunk.logdepthbuf_pars_vertex}
@@ -13,7 +13,7 @@ const copyShader = new ShaderMaterial({
13
13
  gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
14
14
  ${ShaderChunk.logdepthbuf_vertex}
15
15
  }
16
- `,
16
+ `,
17
17
  fragmentShader: `
18
18
  ${ShaderChunk.logdepthbuf_pars_fragment}
19
19
  uniform float opacity;
@@ -24,9 +24,9 @@ const copyShader = new ShaderMaterial({
24
24
  gl_FragColor.a *= opacity;
25
25
  ${ShaderChunk.logdepthbuf_fragment}
26
26
  }
27
- `,
28
- depthTest: true,
29
- depthWrite: true,
30
- transparent: true,
31
- });
32
- export default copyShader;
27
+ `,
28
+ depthTest: true,
29
+ depthWrite: true,
30
+ transparent: true,
31
+ });
32
+ export default copyShader;
@@ -1,14 +1,14 @@
1
- import { ShaderMaterial } from "three";
2
- /**
3
- * 调试用:把「全局 base 深度」与「最近一次 glow/stroke 选区的 select 深度」并排显示,
4
- * 用于排查"深度测试全部失效"根因:
5
- * R = 全局 base 深度(baseDepthTexture,排除地板)
6
- * G = 选区自身深度(selectDepthTexture,由 glow_pass/stroke_pass 渲染后写入 debugDepthState)
7
- * 两路都用 `pow(cameraFar+1, d)-1` 反推到近似线性视深再归一化(背景≈1 → 黄白)。
8
- * - R 全白、G 也有内容 → 全局 base 深度没写进(renderAoDepthPass 失效),但选区深度正常;
9
- * - R、G 都全白 → 两路深度都没写进;
10
- * - R 有灰阶、G 全白 → 选区深度没写进(glow/stroke 自身的深度 pass 失效);
11
- * - R、G 都有灰阶 → 深度正常,问题在 depthTestShader 比对侧。
12
- */
13
- declare const debugDepthCompareShader: ShaderMaterial;
14
- export default debugDepthCompareShader;
1
+ import { ShaderMaterial } from "three";
2
+ /**
3
+ * 调试用:把「全局 base 深度」与「最近一次 glow/stroke 选区的 select 深度」并排显示,
4
+ * 用于排查"深度测试全部失效"根因:
5
+ * R = 全局 base 深度(baseDepthTexture,排除地板)
6
+ * G = 选区自身深度(selectDepthTexture,由 glow_pass/stroke_pass 渲染后写入 debugDepthState)
7
+ * 两路都用 `pow(cameraFar+1, d)-1` 反推到近似线性视深再归一化(背景≈1 → 黄白)。
8
+ * - R 全白、G 也有内容 → 全局 base 深度没写进(renderAoDepthPass 失效),但选区深度正常;
9
+ * - R、G 都全白 → 两路深度都没写进;
10
+ * - R 有灰阶、G 全白 → 选区深度没写进(glow/stroke 自身的深度 pass 失效);
11
+ * - R、G 都有灰阶 → 深度正常,问题在 depthTestShader 比对侧。
12
+ */
13
+ declare const debugDepthCompareShader: ShaderMaterial;
14
+ export default debugDepthCompareShader;
@@ -1,49 +1,49 @@
1
- import { ShaderChunk, ShaderMaterial } from "three";
2
- /**
3
- * 调试用:把「全局 base 深度」与「最近一次 glow/stroke 选区的 select 深度」并排显示,
4
- * 用于排查"深度测试全部失效"根因:
5
- * R = 全局 base 深度(baseDepthTexture,排除地板)
6
- * G = 选区自身深度(selectDepthTexture,由 glow_pass/stroke_pass 渲染后写入 debugDepthState)
7
- * 两路都用 `pow(cameraFar+1, d)-1` 反推到近似线性视深再归一化(背景≈1 → 黄白)。
8
- * - R 全白、G 也有内容 → 全局 base 深度没写进(renderAoDepthPass 失效),但选区深度正常;
9
- * - R、G 都全白 → 两路深度都没写进;
10
- * - R 有灰阶、G 全白 → 选区深度没写进(glow/stroke 自身的深度 pass 失效);
11
- * - R、G 都有灰阶 → 深度正常,问题在 depthTestShader 比对侧。
12
- */
13
- const debugDepthCompareShader = new ShaderMaterial({
14
- uniforms: {
15
- tBase: { value: null },
16
- tSelect: { value: null },
17
- cameraFar: { value: 1000.0 },
18
- },
19
- vertexShader: `
20
- ${ShaderChunk.common}
21
- ${ShaderChunk.logdepthbuf_pars_vertex}
22
- varying vec2 vUv;
23
- void main() {
24
- vUv = uv;
25
- gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
26
- ${ShaderChunk.logdepthbuf_vertex}
27
- }
28
- `,
29
- fragmentShader: `
30
- ${ShaderChunk.logdepthbuf_pars_fragment}
31
- uniform sampler2D tBase;
32
- uniform sampler2D tSelect;
33
- uniform float cameraFar;
34
- varying vec2 vUv;
35
- void main() {
36
- float baseD = texture2D(tBase, vUv).r;
37
- float selD = texture2D(tSelect, vUv).r;
38
- // 与 stroke_pass 的 __STROKE_DEPTH_VIS 同一反推公式,保证两座视图语义一致
39
- float vb = pow(cameraFar + 1.0, baseD) - 1.0;
40
- float vs = pow(cameraFar + 1.0, selD) - 1.0;
41
- gl_FragColor = vec4(vb / cameraFar, vs / cameraFar, 0.0, 1.0);
42
- ${ShaderChunk.logdepthbuf_fragment}
43
- }
44
- `,
45
- depthTest: false,
46
- depthWrite: false,
47
- transparent: true,
48
- });
49
- export default debugDepthCompareShader;
1
+ import { ShaderChunk, ShaderMaterial } from "three";
2
+ /**
3
+ * 调试用:把「全局 base 深度」与「最近一次 glow/stroke 选区的 select 深度」并排显示,
4
+ * 用于排查"深度测试全部失效"根因:
5
+ * R = 全局 base 深度(baseDepthTexture,排除地板)
6
+ * G = 选区自身深度(selectDepthTexture,由 glow_pass/stroke_pass 渲染后写入 debugDepthState)
7
+ * 两路都用 `pow(cameraFar+1, d)-1` 反推到近似线性视深再归一化(背景≈1 → 黄白)。
8
+ * - R 全白、G 也有内容 → 全局 base 深度没写进(renderAoDepthPass 失效),但选区深度正常;
9
+ * - R、G 都全白 → 两路深度都没写进;
10
+ * - R 有灰阶、G 全白 → 选区深度没写进(glow/stroke 自身的深度 pass 失效);
11
+ * - R、G 都有灰阶 → 深度正常,问题在 depthTestShader 比对侧。
12
+ */
13
+ const debugDepthCompareShader = new ShaderMaterial({
14
+ uniforms: {
15
+ tBase: { value: null },
16
+ tSelect: { value: null },
17
+ cameraFar: { value: 1000.0 },
18
+ },
19
+ vertexShader: `
20
+ ${ShaderChunk.common}
21
+ ${ShaderChunk.logdepthbuf_pars_vertex}
22
+ varying vec2 vUv;
23
+ void main() {
24
+ vUv = uv;
25
+ gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
26
+ ${ShaderChunk.logdepthbuf_vertex}
27
+ }
28
+ `,
29
+ fragmentShader: `
30
+ ${ShaderChunk.logdepthbuf_pars_fragment}
31
+ uniform sampler2D tBase;
32
+ uniform sampler2D tSelect;
33
+ uniform float cameraFar;
34
+ varying vec2 vUv;
35
+ void main() {
36
+ float baseD = texture2D(tBase, vUv).r;
37
+ float selD = texture2D(tSelect, vUv).r;
38
+ // 与 stroke_pass 的 __STROKE_DEPTH_VIS 同一反推公式,保证两座视图语义一致
39
+ float vb = pow(cameraFar + 1.0, baseD) - 1.0;
40
+ float vs = pow(cameraFar + 1.0, selD) - 1.0;
41
+ gl_FragColor = vec4(vb / cameraFar, vs / cameraFar, 0.0, 1.0);
42
+ ${ShaderChunk.logdepthbuf_fragment}
43
+ }
44
+ `,
45
+ depthTest: false,
46
+ depthWrite: false,
47
+ transparent: true,
48
+ });
49
+ export default debugDepthCompareShader;
@@ -1,50 +1,50 @@
1
- import { ShaderChunk, ShaderMaterial } from "three";
2
-
3
- /**
4
- * 调试用:把「全局 base 深度」与「最近一次 glow/stroke 选区的 select 深度」并排显示,
5
- * 用于排查"深度测试全部失效"根因:
6
- * R = 全局 base 深度(baseDepthTexture,排除地板)
7
- * G = 选区自身深度(selectDepthTexture,由 glow_pass/stroke_pass 渲染后写入 debugDepthState)
8
- * 两路都用 `pow(cameraFar+1, d)-1` 反推到近似线性视深再归一化(背景≈1 → 黄白)。
9
- * - R 全白、G 也有内容 → 全局 base 深度没写进(renderAoDepthPass 失效),但选区深度正常;
10
- * - R、G 都全白 → 两路深度都没写进;
11
- * - R 有灰阶、G 全白 → 选区深度没写进(glow/stroke 自身的深度 pass 失效);
12
- * - R、G 都有灰阶 → 深度正常,问题在 depthTestShader 比对侧。
13
- */
14
- const debugDepthCompareShader = new ShaderMaterial({
15
- uniforms: {
16
- tBase: { value: null as unknown as import("three").Texture },
17
- tSelect: { value: null as unknown as import("three").Texture },
18
- cameraFar: { value: 1000.0 },
19
- },
20
- vertexShader: `
21
- ${ShaderChunk.common}
22
- ${ShaderChunk.logdepthbuf_pars_vertex}
23
- varying vec2 vUv;
24
- void main() {
25
- vUv = uv;
26
- gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
27
- ${ShaderChunk.logdepthbuf_vertex}
28
- }
29
- `,
30
- fragmentShader: `
31
- ${ShaderChunk.logdepthbuf_pars_fragment}
32
- uniform sampler2D tBase;
33
- uniform sampler2D tSelect;
34
- uniform float cameraFar;
35
- varying vec2 vUv;
36
- void main() {
37
- float baseD = texture2D(tBase, vUv).r;
38
- float selD = texture2D(tSelect, vUv).r;
39
- // 与 stroke_pass 的 __STROKE_DEPTH_VIS 同一反推公式,保证两座视图语义一致
40
- float vb = pow(cameraFar + 1.0, baseD) - 1.0;
41
- float vs = pow(cameraFar + 1.0, selD) - 1.0;
42
- gl_FragColor = vec4(vb / cameraFar, vs / cameraFar, 0.0, 1.0);
43
- ${ShaderChunk.logdepthbuf_fragment}
44
- }
45
- `,
46
- depthTest: false,
47
- depthWrite: false,
48
- transparent: true,
49
- });
50
- export default debugDepthCompareShader;
1
+ import { ShaderChunk, ShaderMaterial } from "three";
2
+
3
+ /**
4
+ * 调试用:把「全局 base 深度」与「最近一次 glow/stroke 选区的 select 深度」并排显示,
5
+ * 用于排查"深度测试全部失效"根因:
6
+ * R = 全局 base 深度(baseDepthTexture,排除地板)
7
+ * G = 选区自身深度(selectDepthTexture,由 glow_pass/stroke_pass 渲染后写入 debugDepthState)
8
+ * 两路都用 `pow(cameraFar+1, d)-1` 反推到近似线性视深再归一化(背景≈1 → 黄白)。
9
+ * - R 全白、G 也有内容 → 全局 base 深度没写进(renderAoDepthPass 失效),但选区深度正常;
10
+ * - R、G 都全白 → 两路深度都没写进;
11
+ * - R 有灰阶、G 全白 → 选区深度没写进(glow/stroke 自身的深度 pass 失效);
12
+ * - R、G 都有灰阶 → 深度正常,问题在 depthTestShader 比对侧。
13
+ */
14
+ const debugDepthCompareShader = new ShaderMaterial({
15
+ uniforms: {
16
+ tBase: { value: null as unknown as import("three").Texture },
17
+ tSelect: { value: null as unknown as import("three").Texture },
18
+ cameraFar: { value: 1000.0 },
19
+ },
20
+ vertexShader: `
21
+ ${ShaderChunk.common}
22
+ ${ShaderChunk.logdepthbuf_pars_vertex}
23
+ varying vec2 vUv;
24
+ void main() {
25
+ vUv = uv;
26
+ gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
27
+ ${ShaderChunk.logdepthbuf_vertex}
28
+ }
29
+ `,
30
+ fragmentShader: `
31
+ ${ShaderChunk.logdepthbuf_pars_fragment}
32
+ uniform sampler2D tBase;
33
+ uniform sampler2D tSelect;
34
+ uniform float cameraFar;
35
+ varying vec2 vUv;
36
+ void main() {
37
+ float baseD = texture2D(tBase, vUv).r;
38
+ float selD = texture2D(tSelect, vUv).r;
39
+ // 与 stroke_pass 的 __STROKE_DEPTH_VIS 同一反推公式,保证两座视图语义一致
40
+ float vb = pow(cameraFar + 1.0, baseD) - 1.0;
41
+ float vs = pow(cameraFar + 1.0, selD) - 1.0;
42
+ gl_FragColor = vec4(vb / cameraFar, vs / cameraFar, 0.0, 1.0);
43
+ ${ShaderChunk.logdepthbuf_fragment}
44
+ }
45
+ `,
46
+ depthTest: false,
47
+ depthWrite: false,
48
+ transparent: true,
49
+ });
50
+ export default debugDepthCompareShader;
@@ -1,18 +1,18 @@
1
- import { ShaderMaterial } from "three";
2
- /**
3
- * 调试用:把「深度测试判定」本身画出来,用于定位"后处理深度测试全部失效"。
4
- *
5
- * 通道语义(全部为**原始**深度值,不做对数反解,避免饱和丢信息):
6
- * R = 全局 base 深度(baseDepthTexture,排除地板)
7
- * G = 选区自身深度(selectDepthTexture,glow/stroke 渲染后写入 debugDepthState)
8
- * B = 判定结果:baseD < selD - bias ? 1 : 0
9
- * 与 stroke_pass 的 depthTestShader 同一判定式(bias = 0.0006):
10
- * 1(蓝) = 判为被更近物体挡住 → 该像素应 discard;0(黑) = 不丢弃。
11
- *
12
- * 判读:
13
- * - 物体区域(G 明显暗于 1.0 的像素)B 全黑 → 判定从不触发,后处理必"一律显示在最前";
14
- * 再看该区域 R 与 G 谁大:R 反而比 G 大(base 比 select 还远)→ base 深度图里缺了遮挡物。
15
- * - 物体区域 B 有蓝 → 判定本身正常,问题在后续合成(叠加顺序/混合)。
16
- */
17
- declare const debugDepthJudgeShader: ShaderMaterial;
18
- export default debugDepthJudgeShader;
1
+ import { ShaderMaterial } from "three";
2
+ /**
3
+ * 调试用:把「深度测试判定」本身画出来,用于定位"后处理深度测试全部失效"。
4
+ *
5
+ * 通道语义(全部为**原始**深度值,不做对数反解,避免饱和丢信息):
6
+ * R = 全局 base 深度(baseDepthTexture,排除地板)
7
+ * G = 选区自身深度(selectDepthTexture,glow/stroke 渲染后写入 debugDepthState)
8
+ * B = 判定结果:baseD < selD - bias ? 1 : 0
9
+ * 与 stroke_pass 的 depthTestShader 同一判定式(bias = 0.0006):
10
+ * 1(蓝) = 判为被更近物体挡住 → 该像素应 discard;0(黑) = 不丢弃。
11
+ *
12
+ * 判读:
13
+ * - 物体区域(G 明显暗于 1.0 的像素)B 全黑 → 判定从不触发,后处理必"一律显示在最前";
14
+ * 再看该区域 R 与 G 谁大:R 反而比 G 大(base 比 select 还远)→ base 深度图里缺了遮挡物。
15
+ * - 物体区域 B 有蓝 → 判定本身正常,问题在后续合成(叠加顺序/混合)。
16
+ */
17
+ declare const debugDepthJudgeShader: ShaderMaterial;
18
+ export default debugDepthJudgeShader;