@woosh/meep-engine 2.165.4 → 2.165.6

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 (179) hide show
  1. package/editor/Editor.d.ts +65 -65
  2. package/editor/SelectionVisualizer.d.ts +19 -19
  3. package/editor/actions/concrete/ActionUpdateTexture.d.ts +11 -11
  4. package/editor/actions/concrete/ArrayCopyAction.d.ts +19 -19
  5. package/editor/actions/concrete/ComponentAddAction.d.ts +14 -14
  6. package/editor/actions/concrete/ComponentRemoveAction.d.ts +10 -10
  7. package/editor/actions/concrete/EntityCreateAction.d.ts +17 -17
  8. package/editor/actions/concrete/EntityRemoveAction.d.ts +10 -10
  9. package/editor/actions/concrete/ModifyPatchSampler2DAction.d.ts +46 -46
  10. package/editor/actions/concrete/ModifyPatchTextureArray2DAction.d.ts +37 -37
  11. package/editor/actions/concrete/PaintTerrainOverlayAction.d.ts +22 -22
  12. package/editor/actions/concrete/PatchTerrainHeightAction.d.ts +18 -18
  13. package/editor/actions/concrete/SelectionAddAction.d.ts +18 -18
  14. package/editor/actions/concrete/SelectionClearAction.d.ts +8 -8
  15. package/editor/actions/concrete/SelectionRemoveAction.d.ts +9 -9
  16. package/editor/actions/concrete/TransformModifyAction.d.ts +16 -16
  17. package/editor/actions/concrete/WriteGridValueAction.d.ts +14 -14
  18. package/editor/ecs/EditorEntity.d.ts +15 -15
  19. package/editor/ecs/EditorEntitySystem.d.ts +7 -7
  20. package/editor/ecs/component/FieldDescriptor.d.ts +26 -26
  21. package/editor/ecs/component/FieldValueAdapter.d.ts +6 -6
  22. package/editor/ecs/component/TypeEditor.d.ts +24 -24
  23. package/editor/ecs/component/createFieldEditor.d.ts +8 -8
  24. package/editor/ecs/component/createObjectEditor.d.ts +13 -13
  25. package/editor/ecs/component/editors/ColorEditor.d.ts +6 -6
  26. package/editor/ecs/component/editors/HTMLElementEditor.d.ts +6 -6
  27. package/editor/ecs/component/editors/ImagePathEditor.d.ts +6 -6
  28. package/editor/ecs/component/editors/LargeStringEditor.d.ts +15 -15
  29. package/editor/ecs/component/editors/NumericIntervalEditor.d.ts +6 -6
  30. package/editor/ecs/component/editors/ObservedBooleanEditor.d.ts +6 -6
  31. package/editor/ecs/component/editors/ObservedEnumEditor.d.ts +6 -6
  32. package/editor/ecs/component/editors/ObservedIntegerEditor.d.ts +6 -6
  33. package/editor/ecs/component/editors/ObservedStringEditor.d.ts +6 -6
  34. package/editor/ecs/component/editors/Sampler2DEditor.d.ts +6 -6
  35. package/editor/ecs/component/editors/collection/ListEditor.d.ts +7 -7
  36. package/editor/ecs/component/editors/common/BitFlagsEditor.d.ts +11 -11
  37. package/editor/ecs/component/editors/common/EnumEditor.d.ts +7 -7
  38. package/editor/ecs/component/editors/common/makeV3_editor.d.ts +14 -14
  39. package/editor/ecs/component/editors/common/noEditor.d.ts +2 -2
  40. package/editor/ecs/component/editors/ecs/GridObstacleEditor.d.ts +6 -6
  41. package/editor/ecs/component/editors/ecs/MinimapMarkerEditor.d.ts +13 -13
  42. package/editor/ecs/component/editors/ecs/ParameterLookupTableEditor.d.ts +66 -66
  43. package/editor/ecs/component/editors/ecs/ParameterTrackEditor.d.ts +11 -11
  44. package/editor/ecs/component/editors/ecs/ParameterTrackSetEditor.d.ts +13 -13
  45. package/editor/ecs/component/editors/ecs/ParticleEmitterEditor.d.ts +51 -51
  46. package/editor/ecs/component/editors/ecs/ParticleEmitterLayerEditor.d.ts +47 -47
  47. package/editor/ecs/component/editors/ecs/SimulationStepDefinitionEditor.d.ts +15 -15
  48. package/editor/ecs/component/editors/ecs/Trail2DEditor.d.ts +29 -29
  49. package/editor/ecs/component/editors/ecs/TransformEditor.d.ts +19 -19
  50. package/editor/ecs/component/editors/ecs/terrain/SplatMappingEditor.d.ts +18 -18
  51. package/editor/ecs/component/editors/ecs/terrain/TerrainEditor.d.ts +38 -38
  52. package/editor/ecs/component/editors/ecs/terrain/TerrainLayerEditor.d.ts +15 -15
  53. package/editor/ecs/component/editors/ecs/terrain/TerrainLayersEditor.d.ts +18 -18
  54. package/editor/ecs/component/editors/ecs/terrain/TerrainOverlayEditor.d.ts +17 -17
  55. package/editor/ecs/component/editors/geom/QuaternionEditor.d.ts +5 -5
  56. package/editor/ecs/component/editors/geom/Vector1Editor.d.ts +6 -6
  57. package/editor/ecs/component/editors/geom/Vector2Editor.d.ts +5 -5
  58. package/editor/ecs/component/editors/geom/Vector3Editor.d.ts +5 -5
  59. package/editor/ecs/component/editors/geom/Vector4Editor.d.ts +5 -5
  60. package/editor/ecs/component/editors/primitive/ArrayEditor.d.ts +7 -7
  61. package/editor/ecs/component/editors/primitive/BooleanEditor.d.ts +6 -6
  62. package/editor/ecs/component/editors/primitive/FunctionEditor.d.ts +6 -6
  63. package/editor/ecs/component/editors/primitive/NumberEditor.d.ts +7 -7
  64. package/editor/ecs/component/editors/primitive/ObjectEditor.d.ts +5 -5
  65. package/editor/ecs/component/editors/primitive/StringEditor.d.ts +6 -6
  66. package/editor/ecs/component/editors/three/BufferGeometryEditor.d.ts +6 -6
  67. package/editor/ecs/component/editors/three/MaterialEditor.d.ts +6 -6
  68. package/editor/ecs/component/editors/three/MeshEditor.d.ts +6 -6
  69. package/editor/ecs/component/editors/three/TextureEditor.d.ts +6 -6
  70. package/editor/ecs/component/findNearestRegisteredType.d.ts +7 -7
  71. package/editor/enableEditor.d.ts +13 -13
  72. package/editor/library/MeshLibrary.d.ts +12 -12
  73. package/editor/process/DisableGameUIProcess.d.ts +7 -7
  74. package/editor/process/EditorProcess.d.ts +18 -18
  75. package/editor/process/ObstacleGridDisplayProcess.d.ts +12 -12
  76. package/editor/process/ProcessEngine.d.ts +29 -29
  77. package/editor/process/SymbolicDisplayProcess.d.ts +18 -18
  78. package/editor/process/symbolic/ComponentSymbolicDisplay.d.ts +10 -10
  79. package/editor/process/symbolic/SymbolicDisplayInternalAPI.d.ts +64 -64
  80. package/editor/process/symbolic/buildThreeJSHelperEntity.d.ts +8 -8
  81. package/editor/process/symbolic/make3DSymbolicDisplay.d.ts +9 -9
  82. package/editor/process/symbolic/makeCameraSymbolicDisplay.d.ts +6 -6
  83. package/editor/process/symbolic/makeGridPositionSymbolDisplay.d.ts +5 -5
  84. package/editor/process/symbolic/makeHelperBoxGeometry.d.ts +2 -2
  85. package/editor/process/symbolic/makeHelperSphereGeometry.d.ts +8 -8
  86. package/editor/process/symbolic/makeLightSymbolicDisplay.d.ts +6 -6
  87. package/editor/process/symbolic/makeParticleEmitterSymbolicDisplay.d.ts +5 -5
  88. package/editor/process/symbolic/makePathSymbolicDisplay.d.ts +6 -6
  89. package/editor/process/symbolic/makePositionedIconDisplaySymbol.d.ts +8 -8
  90. package/editor/process/symbolic/makeSocketsSymbolicDisplay.d.ts +6 -6
  91. package/editor/process/symbolic/makeSolidArrowGeometry.d.ts +25 -25
  92. package/editor/process/symbolic/makeSoundEmitterSymbolicDisplay.d.ts +5 -5
  93. package/editor/process/symbolic/synchronizeTransform.d.ts +11 -11
  94. package/editor/tools/GridPaintTool.d.ts +16 -16
  95. package/editor/tools/SelectionTool.d.ts +26 -26
  96. package/editor/tools/TopDownCameraControlTool.d.ts +12 -12
  97. package/editor/tools/engine/Tool.d.ts +63 -63
  98. package/editor/tools/engine/ToolEngine.d.ts +22 -22
  99. package/editor/tools/engine/ToolState.d.ts +6 -6
  100. package/editor/tools/paint/TerrainHeightPaintTool.d.ts +17 -17
  101. package/editor/tools/paint/TerrainPaintTool.d.ts +30 -30
  102. package/editor/tools/paint/TerrainTexturePaintTool.d.ts +17 -17
  103. package/editor/tools/v2/TransformMode.d.ts +6 -6
  104. package/editor/view/EditorView.d.ts +38 -38
  105. package/editor/view/ecs/ComponentControlFactory.d.ts +18 -18
  106. package/editor/view/ecs/ComponentControlView.d.ts +23 -23
  107. package/editor/view/ecs/EntityEditor.d.ts +29 -29
  108. package/editor/view/ecs/EntityList.d.ts +21 -21
  109. package/editor/view/ecs/HierarchicalEntityListView.d.ts +7 -7
  110. package/editor/view/ecs/components/DatGuiController.d.ts +45 -45
  111. package/editor/view/ecs/components/GridObstacleController.d.ts +13 -13
  112. package/editor/view/ecs/components/color/GaugeView.d.ts +12 -12
  113. package/editor/view/ecs/components/common/AutoCanvasView.d.ts +19 -19
  114. package/editor/view/ecs/components/common/LineView.d.ts +11 -11
  115. package/editor/view/ecs/components/common/NumberController.d.ts +17 -17
  116. package/editor/view/ecs/components/particles/ColorParameterLUTController.d.ts +13 -13
  117. package/editor/view/makeEntityDecorators.d.ts +5 -5
  118. package/editor/view/tools/ToolSettingsView.d.ts +10 -10
  119. package/editor/view/tools/ToolView.d.ts +12 -12
  120. package/editor/view/v2/SplitView.d.ts +16 -16
  121. package/package.json +1 -1
  122. package/samples/generation/grid/GridTags.d.ts +15 -15
  123. package/samples/generation/grid/MirGridLayers.d.ts +7 -7
  124. package/samples/generation/rules/matcher_tag_occupied.d.ts +2 -2
  125. package/samples/generation/rules/matcher_tag_traversable.d.ts +2 -2
  126. package/samples/generation/rules/matcher_tag_unoccupied.d.ts +2 -2
  127. package/src/engine/ecs/gui/hud/HeadsUpDisplaySystem.d.ts.map +1 -1
  128. package/src/engine/ecs/gui/hud/HeadsUpDisplaySystem.js +65 -12
  129. package/src/engine/ecs/gui/hud/testHudEdgeStick.d.ts +2 -0
  130. package/src/engine/ecs/gui/hud/testHudEdgeStick.d.ts.map +1 -0
  131. package/src/engine/ecs/gui/hud/testHudEdgeStick.js +134 -0
  132. package/src/engine/ecs/gui/position/ViewportPositionSystem.d.ts.map +1 -1
  133. package/src/engine/ecs/gui/position/ViewportPositionSystem.js +44 -23
  134. package/src/engine/graphics/ecs/light/LightContext.d.ts +8 -0
  135. package/src/engine/graphics/ecs/light/LightContext.d.ts.map +1 -1
  136. package/src/engine/graphics/ecs/light/LightContext.js +33 -3
  137. package/src/engine/graphics/ecs/light/LightSystem.d.ts.map +1 -1
  138. package/src/engine/graphics/ecs/light/LightSystem.js +13 -6
  139. package/src/engine/graphics/ecs/light/binding/three/ThreeLightBinding.d.ts +12 -0
  140. package/src/engine/graphics/ecs/light/binding/three/ThreeLightBinding.d.ts.map +1 -1
  141. package/src/engine/graphics/ecs/light/binding/three/ThreeLightBinding.js +184 -6
  142. package/src/engine/graphics/ecs/trail3d/Trail3D.d.ts +24 -1
  143. package/src/engine/graphics/ecs/trail3d/Trail3D.d.ts.map +1 -1
  144. package/src/engine/graphics/ecs/trail3d/Trail3D.js +43 -0
  145. package/src/engine/graphics/ecs/trail3d/Trail3DFlags.d.ts +1 -0
  146. package/src/engine/graphics/ecs/trail3d/Trail3DFlags.js +9 -1
  147. package/src/engine/graphics/ecs/trail3d/Trail3DSystem.d.ts.map +1 -1
  148. package/src/engine/graphics/ecs/trail3d/Trail3DSystem.js +4 -0
  149. package/src/engine/graphics/ecs/trail3d/prototypeTrail3D.js +22 -1
  150. package/src/engine/graphics/render/buffer/simple-fx/ao/SAOShader.js +381 -362
  151. package/src/engine/graphics/render/forward_plus/LightManager.d.ts +5 -0
  152. package/src/engine/graphics/render/forward_plus/LightManager.d.ts.map +1 -1
  153. package/src/engine/graphics/render/forward_plus/LightManager.js +11 -0
  154. package/src/engine/graphics/render/forward_plus/model/AbstractLight.d.ts +16 -1
  155. package/src/engine/graphics/render/forward_plus/model/AbstractLight.d.ts.map +1 -1
  156. package/src/engine/graphics/render/forward_plus/model/AbstractLight.js +22 -1
  157. package/src/engine/graphics/render/forward_plus/model/Decal.d.ts +7 -0
  158. package/src/engine/graphics/render/forward_plus/model/Decal.d.ts.map +1 -1
  159. package/src/engine/graphics/render/forward_plus/model/Decal.js +11 -0
  160. package/src/engine/graphics/render/forward_plus/model/PointLight.d.ts +2 -0
  161. package/src/engine/graphics/render/forward_plus/model/PointLight.d.ts.map +1 -1
  162. package/src/engine/graphics/render/forward_plus/model/PointLight.js +10 -0
  163. package/src/engine/graphics/render/forward_plus/model/SpotLight.d.ts +2 -0
  164. package/src/engine/graphics/render/forward_plus/model/SpotLight.d.ts.map +1 -1
  165. package/src/engine/graphics/render/forward_plus/model/SpotLight.js +12 -0
  166. package/src/engine/graphics/shadows/ShadowMapRenderer.d.ts +10 -0
  167. package/src/engine/graphics/shadows/ShadowMapRenderer.d.ts.map +1 -1
  168. package/src/engine/graphics/shadows/ShadowMapRenderer.js +83 -10
  169. package/src/engine/graphics/shadows/testPointShadowMapRendering.d.ts +2 -0
  170. package/src/engine/graphics/shadows/testPointShadowMapRendering.d.ts.map +1 -0
  171. package/src/engine/graphics/shadows/testPointShadowMapRendering.js +242 -0
  172. package/src/engine/graphics/trail/tube/TubeMaterialX.d.ts +8 -1
  173. package/src/engine/graphics/trail/tube/TubeMaterialX.d.ts.map +1 -1
  174. package/src/engine/graphics/trail/tube/TubeMaterialX.js +111 -15
  175. package/src/engine/graphics/trail/tube/TubeXMaterialSpec.d.ts +9 -2
  176. package/src/engine/graphics/trail/tube/TubeXMaterialSpec.d.ts.map +1 -1
  177. package/src/engine/graphics/trail/tube/TubeXMaterialSpec.js +15 -4
  178. package/src/engine/graphics/trail/tube/TubeXPlugin.d.ts.map +1 -1
  179. package/src/engine/graphics/trail/tube/TubeXPlugin.js +7 -1
@@ -1,12 +1,25 @@
1
- import { DoubleSide, NormalBlending, ShaderMaterial } from "three";
1
+ import { DoubleSide, NormalBlending, ShaderMaterial, UniformsLib, UniformsUtils } from "three";
2
2
 
3
3
  const TWO_PI = "6.283185307179586";
4
4
 
5
5
  /**
6
- * Unlit tube material. Vertices arrive as ring CENTRES; the actual surface vertex
6
+ * Tube material. Vertices arrive as ring CENTRES; the actual surface vertex
7
7
  * is extruded here in WORLD space from the per-knot tangent frame (tn, tb) and the
8
8
  * vertex's angular position `tubeUv.x`. The mesh transform is identity (centres are
9
9
  * already world space, written CPU-side), so modelViewMatrix == viewMatrix.
10
+ *
11
+ * Unlit by default. The LIT define switches the fragment stage onto the standard
12
+ * three.js light chain instead — specular is forced to zero, so the tube shades as
13
+ * a matte (Lambert) surface under ambient / hemisphere / light-probe / directional /
14
+ * point / spot lights, and receives shadows (it never casts them). The surface
15
+ * normal is the ring's radial direction; the per-knot thickness taper's tilt is
16
+ * ignored.
17
+ *
18
+ * The lit variant deliberately follows the three.js chunk conventions —
19
+ * `void main() {`, `transformed`, `#include <worldpos_vertex>`,
20
+ * `#include <lights_pars_begin>`, `#include <lights_fragment_begin>` — because the
21
+ * Forward+ {@link MaterialTransformer} keys its textual injections on exactly these
22
+ * markers to add clustered point-light accumulation and decals.
10
23
  */
11
24
  const vertexShader = `
12
25
  varying vec2 vUv;
@@ -19,18 +32,44 @@ const vertexShader = `
19
32
  attribute float thickness;
20
33
  attribute vec3 color;
21
34
 
22
- void main(){
35
+ #ifdef LIT
36
+
37
+ varying vec3 vNormal;
38
+ varying vec3 vViewPosition;
39
+
40
+ #include <common>
41
+ #include <shadowmap_pars_vertex>
42
+
43
+ #endif
44
+
45
+ void main() {
23
46
  float angle = tubeUv.x * ${TWO_PI};
24
47
 
25
48
  // radial direction in the knot's frame; unit, perpendicular to the tangent
26
49
  vec3 radial = cos(angle) * tn + sin(angle) * tb;
27
50
 
28
- vec3 surface = position + radial * (thickness * 0.5);
51
+ // extruded surface vertex, named per three.js chunk convention
52
+ vec3 transformed = position + radial * (thickness * 0.5);
29
53
 
30
54
  vUv = tubeUv;
31
55
  vColor = vec4(color / 255.0, alpha);
32
56
 
33
- gl_Position = projectionMatrix * modelViewMatrix * vec4(surface, 1.0);
57
+ vec4 mvPosition = modelViewMatrix * vec4(transformed, 1.0);
58
+
59
+ #ifdef LIT
60
+
61
+ // the tube's surface normal is the radial direction itself
62
+ vec3 transformedNormal = normalMatrix * radial;
63
+
64
+ vNormal = transformedNormal;
65
+ vViewPosition = -mvPosition.xyz;
66
+
67
+ #include <worldpos_vertex>
68
+ #include <shadowmap_vertex>
69
+
70
+ #endif
71
+
72
+ gl_Position = projectionMatrix * mvPosition;
34
73
  }
35
74
  `;
36
75
 
@@ -40,7 +79,21 @@ const fragmentShader = `
40
79
 
41
80
  uniform sampler2D uDiffuse;
42
81
 
43
- void main(){
82
+ #ifdef LIT
83
+
84
+ // vViewPosition is declared by <lights_phong_pars_fragment>
85
+ varying vec3 vNormal;
86
+
87
+ #include <common>
88
+ #include <packing>
89
+ #include <bsdfs>
90
+ #include <lights_pars_begin>
91
+ #include <lights_phong_pars_fragment>
92
+ #include <shadowmap_pars_fragment>
93
+
94
+ #endif
95
+
96
+ void main() {
44
97
  vec4 diffuseColor = vColor;
45
98
 
46
99
  #ifdef USE_TEXTURE
@@ -48,24 +101,67 @@ const fragmentShader = `
48
101
  diffuseColor *= texel;
49
102
  #endif
50
103
 
51
- gl_FragColor = diffuseColor;
104
+ #ifdef LIT
105
+
106
+ ReflectedLight reflectedLight = ReflectedLight(vec3(0.0), vec3(0.0), vec3(0.0), vec3(0.0));
107
+
108
+ #include <normal_fragment_begin>
109
+
110
+ // Blinn-Phong with specular forced to zero = pure Lambert; a trail is a
111
+ // matte surface, highlights on a fading tube read as artifacts
112
+ BlinnPhongMaterial material;
113
+ material.diffuseColor = diffuseColor.rgb;
114
+ material.specularColor = vec3(0.0);
115
+ material.specularShininess = 1.0;
116
+ material.specularStrength = 0.0;
117
+
118
+ #include <lights_fragment_begin>
119
+ #include <lights_fragment_end>
120
+
121
+ vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;
122
+
123
+ gl_FragColor = vec4(outgoingLight, diffuseColor.a);
124
+
125
+ #include <tonemapping_fragment>
126
+ #include <encodings_fragment>
127
+
128
+ #else
129
+
130
+ gl_FragColor = diffuseColor;
131
+
132
+ #endif
52
133
  }
53
134
  `;
54
135
 
55
136
  export class TubeMaterialX extends ShaderMaterial {
56
- constructor(params) {
137
+ /**
138
+ * @param {Object} params three.js material parameters, plus:
139
+ * @param {boolean} [params.lit=false] compile the lit variant — standard light
140
+ * chain, receive-only shadows — instead of the unlit one
141
+ */
142
+ constructor({ lit = false, ...params } = {}) {
57
143
  super({
58
144
  fragmentShader,
59
145
  vertexShader,
60
- uniforms: {
61
- uDiffuse: {
62
- type: 't',
63
- value: null
64
- }
65
- },
146
+ uniforms: lit
147
+ ? UniformsUtils.merge([
148
+ UniformsLib.lights,
149
+ { uDiffuse: { value: null } }
150
+ ])
151
+ : {
152
+ uDiffuse: {
153
+ type: 't',
154
+ value: null
155
+ }
156
+ },
66
157
  defines: {
67
- USE_TEXTURE: false
158
+ USE_TEXTURE: false,
159
+ // a `false` define is omitted from the compiled shader entirely,
160
+ // not emitted as "#define LIT false"
161
+ LIT: lit
68
162
  },
163
+ // wires the renderer's light state into the merged uniforms
164
+ lights: lit,
69
165
  blending: NormalBlending,
70
166
  transparent: true,
71
167
  // The primary use is transparent trails (depthWrite: false). Callers that
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Material configuration for a {@link TubeX}. Used as a cache key in
3
3
  * {@link TubeXPlugin}, so any field that changes the compiled material (texture,
4
- * depth-write mode) participates in {@link equals}/{@link hash}.
4
+ * depth-write mode, lighting) participates in {@link equals}/{@link hash}.
5
5
  */
6
6
  export class TubeXMaterialSpec {
7
7
  /**
@@ -16,11 +16,18 @@ export class TubeXMaterialSpec {
16
16
  * @type {boolean}
17
17
  */
18
18
  depthWrite: boolean;
19
+ /**
20
+ * When true the tube shades as a matte surface under the standard scene
21
+ * lights and receives shadows; when false (default) it renders unlit.
22
+ * @type {boolean}
23
+ */
24
+ lit: boolean;
19
25
  equals(other: any): boolean;
20
26
  hash(): number;
21
- fromJSON({ diffuse, depthWrite }: {
27
+ fromJSON({ diffuse, depthWrite, lit }: {
22
28
  diffuse: any;
23
29
  depthWrite?: boolean;
30
+ lit?: boolean;
24
31
  }): void;
25
32
  }
26
33
  //# sourceMappingURL=TubeXMaterialSpec.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"TubeXMaterialSpec.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/trail/tube/TubeXMaterialSpec.js"],"names":[],"mappings":"AAGA;;;;GAIG;AACH;IAEI;;;OAGG;IACH,SAFU,SAAO,IAAI,CAEN;IAEf;;;;;OAKG;IACH,YAFU,OAAO,CAEE;IAEnB,4BAGC;IAED,eAEC;IAED;;;aAYC;CACJ"}
1
+ {"version":3,"file":"TubeXMaterialSpec.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/trail/tube/TubeXMaterialSpec.js"],"names":[],"mappings":"AAGA;;;;GAIG;AACH;IAEI;;;OAGG;IACH,SAFU,SAAO,IAAI,CAEN;IAEf;;;;;OAKG;IACH,YAFU,OAAO,CAEE;IAEnB;;;;OAIG;IACH,KAFU,OAAO,CAEL;IAEZ,4BAIC;IAED,eAEC;IAED;;;;aAeC;CACJ"}
@@ -4,7 +4,7 @@ import { computeStringHash } from "../../../../core/primitives/strings/computeSt
4
4
  /**
5
5
  * Material configuration for a {@link TubeX}. Used as a cache key in
6
6
  * {@link TubeXPlugin}, so any field that changes the compiled material (texture,
7
- * depth-write mode) participates in {@link equals}/{@link hash}.
7
+ * depth-write mode, lighting) participates in {@link equals}/{@link hash}.
8
8
  */
9
9
  export class TubeXMaterialSpec {
10
10
 
@@ -22,16 +22,24 @@ export class TubeXMaterialSpec {
22
22
  */
23
23
  depthWrite = false;
24
24
 
25
+ /**
26
+ * When true the tube shades as a matte surface under the standard scene
27
+ * lights and receives shadows; when false (default) it renders unlit.
28
+ * @type {boolean}
29
+ */
30
+ lit = false;
31
+
25
32
  equals(other) {
26
33
  return this.diffuse === other.diffuse
27
- && this.depthWrite === other.depthWrite;
34
+ && this.depthWrite === other.depthWrite
35
+ && this.lit === other.lit;
28
36
  }
29
37
 
30
38
  hash() {
31
- return (computeStringHash(this.diffuse) * 2) + (this.depthWrite ? 1 : 0);
39
+ return (computeStringHash(this.diffuse) * 4) + (this.lit ? 2 : 0) + (this.depthWrite ? 1 : 0);
32
40
  }
33
41
 
34
- fromJSON({ diffuse, depthWrite = false }) {
42
+ fromJSON({ diffuse, depthWrite = false, lit = false }) {
35
43
 
36
44
  if (diffuse !== undefined && diffuse !== null) {
37
45
  assert.isString(diffuse, "diffuse");
@@ -43,5 +51,8 @@ export class TubeXMaterialSpec {
43
51
 
44
52
  assert.isBoolean(depthWrite, "depthWrite");
45
53
  this.depthWrite = depthWrite;
54
+
55
+ assert.isBoolean(lit, "lit");
56
+ this.lit = lit;
46
57
  }
47
58
  }
@@ -1 +1 @@
1
- {"version":3,"file":"TubeXPlugin.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/trail/tube/TubeXPlugin.js"],"names":[],"mappings":"AAOA;;;;;;;GAOG;AACH;IAOI,8BAWC;IARG,WAAyB;IAU7B;;;OAGG;IACH,4CAFa,aAAa,CAIzB;;CAsCJ;6BA3E4B,iCAAiC;8BAChC,oBAAoB"}
1
+ {"version":3,"file":"TubeXPlugin.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/trail/tube/TubeXPlugin.js"],"names":[],"mappings":"AAOA;;;;;;;GAOG;AACH;IAOI,8BAWC;IARG,WAAyB;IAU7B;;;OAGG;IACH,4CAFa,aAAa,CAIzB;;CA4CJ;6BAjF4B,iCAAiC;8BAChC,oBAAoB"}
@@ -48,6 +48,7 @@ export class TubeXPlugin extends EnginePlugin {
48
48
  #build_material(spec) {
49
49
 
50
50
  const material = new TubeMaterialX({
51
+ lit: spec.lit,
51
52
  transparent: true,
52
53
  depthWrite: spec.depthWrite,
53
54
  wireframe: false
@@ -75,6 +76,11 @@ export class TubeXPlugin extends EnginePlugin {
75
76
  material.needsUpdate = true;
76
77
  }
77
78
 
78
- return material;
79
+ // Hand the material to the material manager so renderer-wide compile steps
80
+ // apply — under Forward+ the lit variant is rewritten to also receive
81
+ // clustered point lights and decals. With no steps registered this is a
82
+ // pass-through. The async texture callback above still lands: the compiled
83
+ // material shares the source's uniform objects.
84
+ return this.engine.graphics.getMaterialManager().obtain(material).getValue();
79
85
  }
80
86
  }