rhodonite 0.20.1 → 0.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (105) hide show
  1. package/README.md +10 -2
  2. package/VERSION-FILE +1 -1
  3. package/dist/esm/foundation/components/MeshRenderer/MeshRendererComponent.d.ts +21 -0
  4. package/dist/esm/foundation/components/Physics/PhysicsComponent.d.ts +1 -1
  5. package/dist/esm/foundation/components/SceneGraph/SceneGraphComponent.d.ts +36 -1
  6. package/dist/esm/foundation/components/Skeletal/SkeletalComponent.d.ts +5 -2
  7. package/dist/esm/foundation/core/Component.d.ts +1 -8
  8. package/dist/esm/foundation/core/Config.d.ts +7 -3
  9. package/dist/esm/foundation/core/GlobalDataRepository.d.ts +12 -8
  10. package/dist/esm/foundation/core/MemoryManager.d.ts +12 -0
  11. package/dist/esm/foundation/definitions/ProcessApproach.d.ts +1 -6
  12. package/dist/esm/foundation/definitions/ShaderSemantics.d.ts +0 -1
  13. package/dist/esm/foundation/definitions/VertexAttribute.d.ts +2 -1
  14. package/dist/esm/foundation/geometry/Mesh.d.ts +52 -0
  15. package/dist/esm/foundation/geometry/Primitive.d.ts +31 -0
  16. package/dist/esm/foundation/geometry/shapes/Cone.d.ts +2 -0
  17. package/dist/esm/foundation/geometry/shapes/Cylinder.d.ts +2 -0
  18. package/dist/esm/foundation/geometry/shapes/Plane.d.ts +2 -0
  19. package/dist/esm/foundation/gizmos/Gizmo.d.ts +30 -0
  20. package/dist/esm/foundation/gizmos/RotationGizmo.d.ts +27 -0
  21. package/dist/esm/foundation/gizmos/ScaleGizmo.d.ts +17 -0
  22. package/dist/esm/foundation/gizmos/TranslationGizmo.d.ts +17 -0
  23. package/dist/esm/foundation/helpers/MeshHelper.d.ts +42 -7
  24. package/dist/esm/foundation/importer/ModelConverter.d.ts +12 -0
  25. package/dist/esm/foundation/materials/contents/CustomMaterialContent.d.ts +1 -1
  26. package/dist/esm/foundation/materials/core/AbstractMaterialContent.d.ts +7 -23
  27. package/dist/esm/foundation/materials/core/Material.d.ts +27 -13
  28. package/dist/esm/foundation/materials/core/MaterialRepository.d.ts +5 -0
  29. package/dist/esm/foundation/physics/PhysicsProperty.d.ts +9 -2
  30. package/dist/esm/foundation/physics/index.d.ts +0 -1
  31. package/dist/esm/foundation/renderer/RenderPass.d.ts +8 -0
  32. package/dist/esm/foundation/system/Engine.d.ts +2 -2
  33. package/dist/esm/foundation/system/EngineState.d.ts +1 -1
  34. package/dist/esm/index.js +650 -685
  35. package/dist/esm/webgl/InstanceSidTable.d.ts +70 -0
  36. package/dist/esm/webgl/MultiDraw.d.ts +167 -0
  37. package/dist/esm/webgl/MultiDrawRepository.d.ts +39 -0
  38. package/dist/esm/webgl/WebGLContextWrapper.d.ts +12 -0
  39. package/dist/esm/webgl/WebGLExtension.d.ts +1 -0
  40. package/dist/esm/webgl/WebGLResourceRepository.d.ts +36 -2
  41. package/dist/{esmdev/webgl/WebGLStrategyDataTexture.d.ts → esm/webgl/WebGLStrategyWebGL2.d.ts} +73 -4
  42. package/dist/esm/webgl/debug/BufferLayoutDecoder.d.ts +83 -0
  43. package/dist/esm/webgl/debug/ShaderParameterDebugger.d.ts +47 -0
  44. package/dist/esm/webgl/debug/index.d.ts +3 -0
  45. package/dist/esm/webgl/debug/types.d.ts +114 -0
  46. package/dist/esm/webgl/index.d.ts +2 -2
  47. package/dist/esm/webgl/main.d.ts +2 -4
  48. package/dist/esm/webgl/shaders/StandardShaderPart.d.ts +1 -1
  49. package/dist/esm/webgl/types/CommonTypes.d.ts +0 -1
  50. package/dist/esm/webgpu/WebGpuResourceRepository.d.ts +15 -1
  51. package/dist/esmdev/foundation/components/MeshRenderer/MeshRendererComponent.d.ts +21 -0
  52. package/dist/esmdev/foundation/components/Physics/PhysicsComponent.d.ts +1 -1
  53. package/dist/esmdev/foundation/components/SceneGraph/SceneGraphComponent.d.ts +36 -1
  54. package/dist/esmdev/foundation/components/Skeletal/SkeletalComponent.d.ts +5 -2
  55. package/dist/esmdev/foundation/core/Component.d.ts +1 -8
  56. package/dist/esmdev/foundation/core/Config.d.ts +7 -3
  57. package/dist/esmdev/foundation/core/GlobalDataRepository.d.ts +12 -8
  58. package/dist/esmdev/foundation/core/MemoryManager.d.ts +12 -0
  59. package/dist/esmdev/foundation/definitions/ProcessApproach.d.ts +1 -6
  60. package/dist/esmdev/foundation/definitions/ShaderSemantics.d.ts +0 -1
  61. package/dist/esmdev/foundation/definitions/VertexAttribute.d.ts +2 -1
  62. package/dist/esmdev/foundation/geometry/Mesh.d.ts +52 -0
  63. package/dist/esmdev/foundation/geometry/Primitive.d.ts +31 -0
  64. package/dist/esmdev/foundation/geometry/shapes/Cone.d.ts +2 -0
  65. package/dist/esmdev/foundation/geometry/shapes/Cylinder.d.ts +2 -0
  66. package/dist/esmdev/foundation/geometry/shapes/Plane.d.ts +2 -0
  67. package/dist/esmdev/foundation/gizmos/Gizmo.d.ts +30 -0
  68. package/dist/esmdev/foundation/gizmos/RotationGizmo.d.ts +27 -0
  69. package/dist/esmdev/foundation/gizmos/ScaleGizmo.d.ts +17 -0
  70. package/dist/esmdev/foundation/gizmos/TranslationGizmo.d.ts +17 -0
  71. package/dist/esmdev/foundation/helpers/MeshHelper.d.ts +42 -7
  72. package/dist/esmdev/foundation/importer/ModelConverter.d.ts +12 -0
  73. package/dist/esmdev/foundation/materials/contents/CustomMaterialContent.d.ts +1 -1
  74. package/dist/esmdev/foundation/materials/core/AbstractMaterialContent.d.ts +7 -23
  75. package/dist/esmdev/foundation/materials/core/Material.d.ts +27 -13
  76. package/dist/esmdev/foundation/materials/core/MaterialRepository.d.ts +5 -0
  77. package/dist/esmdev/foundation/physics/PhysicsProperty.d.ts +9 -2
  78. package/dist/esmdev/foundation/physics/index.d.ts +0 -1
  79. package/dist/esmdev/foundation/renderer/RenderPass.d.ts +8 -0
  80. package/dist/esmdev/foundation/system/Engine.d.ts +2 -2
  81. package/dist/esmdev/foundation/system/EngineState.d.ts +1 -1
  82. package/dist/esmdev/index.js +12831 -11280
  83. package/dist/esmdev/webgl/InstanceSidTable.d.ts +70 -0
  84. package/dist/esmdev/webgl/MultiDraw.d.ts +167 -0
  85. package/dist/esmdev/webgl/MultiDrawRepository.d.ts +39 -0
  86. package/dist/esmdev/webgl/WebGLContextWrapper.d.ts +12 -0
  87. package/dist/esmdev/webgl/WebGLExtension.d.ts +1 -0
  88. package/dist/esmdev/webgl/WebGLResourceRepository.d.ts +36 -2
  89. package/dist/{esm/webgl/WebGLStrategyDataTexture.d.ts → esmdev/webgl/WebGLStrategyWebGL2.d.ts} +73 -4
  90. package/dist/esmdev/webgl/debug/BufferLayoutDecoder.d.ts +83 -0
  91. package/dist/esmdev/webgl/debug/ShaderParameterDebugger.d.ts +47 -0
  92. package/dist/esmdev/webgl/debug/index.d.ts +3 -0
  93. package/dist/esmdev/webgl/debug/types.d.ts +114 -0
  94. package/dist/esmdev/webgl/index.d.ts +2 -2
  95. package/dist/esmdev/webgl/main.d.ts +2 -4
  96. package/dist/esmdev/webgl/shaders/StandardShaderPart.d.ts +1 -1
  97. package/dist/esmdev/webgl/types/CommonTypes.d.ts +0 -1
  98. package/dist/esmdev/webgpu/WebGpuResourceRepository.d.ts +15 -1
  99. package/package.json +2 -1
  100. package/dist/esm/foundation/physics/Oimo/OimoPhysicsStrategy.d.ts +0 -124
  101. package/dist/esm/foundation/physics/Oimo/index.d.ts +0 -1
  102. package/dist/esm/webgl/WebGLStrategyUniform.d.ts +0 -193
  103. package/dist/esmdev/foundation/physics/Oimo/OimoPhysicsStrategy.d.ts +0 -124
  104. package/dist/esmdev/foundation/physics/Oimo/index.d.ts +0 -1
  105. package/dist/esmdev/webgl/WebGLStrategyUniform.d.ts +0 -193
@@ -19,6 +19,8 @@ export declare class ScaleGizmo extends Gizmo {
19
19
  private static __space;
20
20
  private static __latestTargetEntity?;
21
21
  private static __length;
22
+ /** Gizmo size as a fraction of the viewport height (unit axis length). */
23
+ private static __screenSpaceRatio;
22
24
  private __onPointerDownFunc;
23
25
  private __onPointerMoveFunc;
24
26
  private __onPointerUpFunc;
@@ -41,13 +43,28 @@ export declare class ScaleGizmo extends Gizmo {
41
43
  /**
42
44
  * Sets the length of the gizmo handles
43
45
  * @param val - The length value to set
46
+ * @deprecated The gizmo size is now derived from the camera so that it stays
47
+ * constant in screen space. This value no longer affects the visual size.
44
48
  */
45
49
  set length(val: number);
46
50
  /**
47
51
  * Gets the current length of the gizmo handles
48
52
  * @returns The current length value
53
+ * @deprecated The gizmo size is now derived from the camera so that it stays
54
+ * constant in screen space. This value no longer affects the visual size.
49
55
  */
50
56
  get length(): number;
57
+ /**
58
+ * Sets the gizmo size as a fraction of the viewport height.
59
+ * The unit axis length is projected to this fraction of the viewport height.
60
+ * @param val - The ratio of the viewport height (for example, 0.12 for 12%)
61
+ */
62
+ set screenSpaceRatio(val: number);
63
+ /**
64
+ * Gets the gizmo size as a fraction of the viewport height.
65
+ * @returns The ratio of the viewport height occupied by the gizmo's unit axis length
66
+ */
67
+ get screenSpaceRatio(): number;
51
68
  /**
52
69
  * Sets the visibility of the gizmo and manages input event registration
53
70
  * @param flg - True to show the gizmo, false to hide it
@@ -23,6 +23,8 @@ export declare class TranslationGizmo extends Gizmo {
23
23
  private __onPointerUpFunc;
24
24
  private __isCameraControllerDisabled;
25
25
  private static __length;
26
+ /** Gizmo size as a fraction of the viewport height (unit axis length). */
27
+ private static __screenSpaceRatio;
26
28
  /** Reusable quaternions for world-rotation calculations (avoids per-frame allocations) */
27
29
  private static readonly __tmpQuaternion_0;
28
30
  private static readonly __tmpQuaternion_1;
@@ -42,13 +44,28 @@ export declare class TranslationGizmo extends Gizmo {
42
44
  /**
43
45
  * Sets the length/scale of the gizmo axes.
44
46
  * @param val - The length value for the gizmo axes
47
+ * @deprecated The gizmo size is now derived from the camera so that it stays
48
+ * constant in screen space. This value no longer affects the visual size.
45
49
  */
46
50
  set length(val: number);
47
51
  /**
48
52
  * Gets the current length/scale of the gizmo axes.
49
53
  * @returns The current length value of the gizmo axes
54
+ * @deprecated The gizmo size is now derived from the camera so that it stays
55
+ * constant in screen space. This value no longer affects the visual size.
50
56
  */
51
57
  get length(): number;
58
+ /**
59
+ * Sets the gizmo size as a fraction of the viewport height.
60
+ * The unit axis length is projected to this fraction of the viewport height.
61
+ * @param val - The ratio of the viewport height (for example, 0.12 for 12%)
62
+ */
63
+ set screenSpaceRatio(val: number);
64
+ /**
65
+ * Gets the gizmo size as a fraction of the viewport height.
66
+ * @returns The ratio of the viewport height occupied by the gizmo's unit axis length
67
+ */
68
+ get screenSpaceRatio(): number;
52
69
  /**
53
70
  * Sets the visibility of the gizmo and manages input event registration.
54
71
  * When set to visible, registers pointer event handlers and adds the gizmo to the scene.
@@ -18,6 +18,8 @@ import type { IMeshEntity } from './EntityHelper';
18
18
  * @param engine - The engine instance
19
19
  * @param desc - Configuration object for the plane
20
20
  * @param desc.direction - The orientation of the plane ('xz', 'xy', or 'yz'). Defaults to 'xz'
21
+ * @param desc.physics - When physics.use is true, a thin box shape is attached so the plane
22
+ * can act as a collider
21
23
  * @returns A mesh entity representing the plane
22
24
  *
23
25
  * @example
@@ -27,6 +29,13 @@ import type { IMeshEntity } from './EntityHelper';
27
29
  *
28
30
  * // Create a vertical plane facing forward
29
31
  * const verticalPlane = createPlane({ direction: 'xy' });
32
+ *
33
+ * // Create a horizontal plane that acts as a static physics collider
34
+ * const physicsPlane = createPlane({
35
+ * width: 20,
36
+ * height: 20,
37
+ * physics: { use: true, move: false, density: 1, friction: 0.5, restitution: 0.3 }
38
+ * });
30
39
  * ```
31
40
  */
32
41
  declare const createPlane: (engine: Engine, desc?: PlaneDescriptor & {
@@ -65,11 +74,16 @@ declare const createLine: (engine: Engine, desc?: LineDescriptor) => IMeshEntity
65
74
  */
66
75
  declare const createGrid: (engine: Engine, desc?: GridDescriptor) => IMeshEntity;
67
76
  /**
68
- * Creates a cone mesh entity.
77
+ * Creates a cone mesh entity with optional physics simulation.
78
+ *
79
+ * When physics is enabled, a cylinder shape with a zero top radius is attached. Rapier only has a
80
+ * cylinder collider, so the cone is approximated by a cylinder that uses the cone's base radius.
81
+ * The cone mesh spans [0, height] along +Y, so the shape is offset by half its height.
69
82
  *
70
83
  * @param engine - The engine instance
71
- * @param desc - Configuration object for the cone geometry
72
- * @returns A mesh entity representing the cone
84
+ * @param desc - Configuration object for the cone geometry and physics properties
85
+ * @param desc.physics - When physics.use is true, a collider shape is attached
86
+ * @returns A mesh entity representing the cone, with a physics component if specified
73
87
  *
74
88
  * @example
75
89
  * ```typescript
@@ -81,7 +95,27 @@ declare const createGrid: (engine: Engine, desc?: GridDescriptor) => IMeshEntity
81
95
  * ```
82
96
  */
83
97
  declare const createCone: (engine: Engine, desc?: ConeDescriptor) => IMeshEntity;
84
- /** Creates a centered cylinder or truncated-cone mesh entity. */
98
+ /**
99
+ * Creates a centered cylinder or truncated-cone mesh entity with optional physics simulation.
100
+ *
101
+ * When physics is enabled, a cylinder shape is attached so the primitive can act as a collider.
102
+ * Rapier approximates a truncated cone with a cylinder that uses the larger radius.
103
+ *
104
+ * @param engine - The engine instance
105
+ * @param desc - Configuration object for the cylinder geometry and physics properties
106
+ * @returns A mesh entity representing the cylinder, with a physics component if specified
107
+ *
108
+ * @example
109
+ * ```typescript
110
+ * const cylinder = createCylinder({ radiusBottom: 0.5, radiusTop: 0.5, height: 2 });
111
+ *
112
+ * const physicsCylinder = createCylinder({
113
+ * radiusBottom: 0.5,
114
+ * height: 2,
115
+ * physics: { use: true, move: true, density: 1.0, friction: 0.5, restitution: 0.3 }
116
+ * });
117
+ * ```
118
+ */
85
119
  declare const createCylinder: (engine: Engine, desc?: CylinderDescriptor) => IMeshEntity;
86
120
  /**
87
121
  * Creates a cube mesh entity with optional physics simulation.
@@ -245,16 +279,17 @@ declare const createAxis: (engine: Engine, desc?: AxisDescriptor) => IMeshEntity
245
279
  */
246
280
  declare const createRing: (engine: Engine, desc?: RingDescriptor) => IMeshEntity;
247
281
  /**
248
- * Creates a capsule mesh entity.
282
+ * Creates a capsule mesh entity with optional physics simulation.
249
283
  * A capsule is a cylinder with hemispherical caps at both ends.
250
284
  *
251
285
  * @param engine - The engine instance
252
- * @param desc - Configuration object for the capsule geometry
286
+ * @param desc - Configuration object for the capsule geometry and physics properties
253
287
  * @param desc.radius - The radius of the capsule (hemispheres and cylinder). Defaults to 0.5
254
288
  * @param desc.height - The height of the cylinder part (distance between hemisphere centers). Defaults to 1
255
289
  * @param desc.widthSegments - Number of horizontal segments. Defaults to 16
256
290
  * @param desc.heightSegments - Number of vertical segments for each hemisphere. Defaults to 8
257
- * @returns A mesh entity representing the capsule
291
+ * @param desc.physics - When physics.use is true, a capsule shape is attached as a collider
292
+ * @returns A mesh entity representing the capsule, with a physics component if specified
258
293
  *
259
294
  * @example
260
295
  * ```typescript
@@ -196,6 +196,18 @@ export declare class ModelConverter {
196
196
  * @param rnBuffers - Array of Rhodonite buffers
197
197
  */
198
198
  static _setupSkeleton(engine: Engine, gltfModel: RnM2, rnEntities: ISceneGraphEntity[], rnBuffers: Buffer[]): void;
199
+ /**
200
+ * Returns the lowest common ancestor of the given joints in the scene graph.
201
+ * glTF's `skin.skeleton` is optional; when it is omitted, the common root of the
202
+ * joints is the root of the skin's joint hierarchy.
203
+ */
204
+ private static __getCommonAncestorOfJoints;
205
+ /**
206
+ * Generates smooth vertex normals for primitives that have no NORMAL attribute.
207
+ * glTF requires implementations to calculate normals when they are absent; without
208
+ * them lit materials receive a zero normal and shade incorrectly (black or NaN).
209
+ */
210
+ private static __generateNormalsIfMissing;
199
211
  /**
200
212
  * Sets up all objects (meshes, cameras, lights, groups) from glTF nodes
201
213
  * @param gltfModel - The glTF model data
@@ -12,7 +12,7 @@ import type { Material } from '../core/Material';
12
12
  export declare class CustomMaterialContent extends AbstractMaterialContent {
13
13
  private __diffuseIblCubeMapSampler;
14
14
  private __specularIblCubeMapSampler;
15
- /** Material and values of the last IBL parameter write (WebGL DataTexture mode). */
15
+ /** Material and values of the last IBL parameter write (WebGL2 mode). */
16
16
  private __lastIblMaterial?;
17
17
  private __lastIblMaterialStateVersion;
18
18
  private __lastIblValues;
@@ -2,10 +2,7 @@ import { type ShaderityObject } from 'shaderity';
2
2
  import type { RenderingArgWebGL } from '../../../webgl/types/CommonTypes';
3
3
  import type { BlendShapeComponent } from '../../components/BlendShape/BlendShapeComponent';
4
4
  import type { CameraComponent } from '../../components/Camera/CameraComponent';
5
- import type { LightComponent } from '../../components/Light/LightComponent';
6
5
  import type { MeshComponent } from '../../components/Mesh/MeshComponent';
7
- import type { SkeletalComponent } from '../../components/Skeletal/SkeletalComponent';
8
- import type { Config } from '../../core/Config';
9
6
  import { RnObject } from '../../core/RnObject';
10
7
  import type { ShaderSemanticsInfo } from '../../definitions/ShaderSemanticsInfo';
11
8
  import { type ShaderTypeEnum } from '../../definitions/ShaderType';
@@ -22,6 +19,12 @@ type MaterialNodeUID = number;
22
19
  * This class handles shader semantics, rendering setup, and GPU parameter management for materials.
23
20
  */
24
21
  export declare abstract class AbstractMaterialContent extends RnObject {
22
+ /**
23
+ * Whether draws of this material can be batched into one multi-draw call.
24
+ * Material contents that set per-primitive uniforms in the per-primitive hook
25
+ * must override this to false.
26
+ */
27
+ get isMultiDrawCompatible(): boolean;
25
28
  protected __semantics: ShaderSemanticsInfo[];
26
29
  static materialNodes: AbstractMaterialContent[];
27
30
  protected __materialName: string;
@@ -33,10 +36,6 @@ export declare abstract class AbstractMaterialContent extends RnObject {
33
36
  private __isMorphing;
34
37
  private __isSkinning;
35
38
  private __isLighting;
36
- private static __lightPositions;
37
- private static __lightDirections;
38
- private static __lightIntensities;
39
- private static __lightProperties;
40
39
  private static __materialContentCount;
41
40
  private __materialContentUid;
42
41
  /** Shader caches managed per-Engine. Key is Engine.objectUID */
@@ -166,7 +165,7 @@ export declare abstract class AbstractMaterialContent extends RnObject {
166
165
  * @param material - The material instance
167
166
  * @param CameraComponentClass - The camera component class
168
167
  */
169
- protected setupBasicInfo(engine: Engine, args: RenderingArgWebGL, shaderProgram: WebGLProgram, firstTime: boolean, material: Material, CameraComponentClass: typeof CameraComponent): void;
168
+ protected setupBasicInfo(_engine: Engine, args: RenderingArgWebGL, shaderProgram: WebGLProgram, _firstTime: boolean, _material: Material, _CameraComponentClass: typeof CameraComponent): void;
170
169
  /**
171
170
  * Sets the world transformation matrix uniform in the shader.
172
171
  * @param shaderProgram - The WebGL shader program
@@ -207,21 +206,6 @@ export declare abstract class AbstractMaterialContent extends RnObject {
207
206
  * @param displayIdx - The display index for VR rendering
208
207
  */
209
208
  setProjection(shaderProgram: WebGLProgram, cameraComponent: CameraComponent, isVr: boolean, displayIdx: number): void;
210
- /**
211
- * Sets skeletal animation uniforms in the shader.
212
- * @param shaderProgram - The WebGL shader program
213
- * @param setUniform - Whether to set uniform values
214
- * @param skeletalComponent - The skeletal component containing bone data
215
- */
216
- protected setSkinning(config: Config, shaderProgram: WebGLProgram, setUniform: boolean, skeletalComponent?: SkeletalComponent): void;
217
- /**
218
- * Sets lighting information uniforms in the shader.
219
- * @param shaderProgram - The WebGL shader program
220
- * @param lightComponents - Array of light components
221
- * @param material - The material instance
222
- * @param setUniform - Whether to set uniform values
223
- */
224
- protected setLightsInfo(config: Config, shaderProgram: WebGLProgram, lightComponents: LightComponent[], _material: Material, setUniform: boolean): void;
225
209
  /**
226
210
  * Sets morph target animation uniforms in the shader.
227
211
  * @param shaderProgram - The WebGL shader program
@@ -140,6 +140,24 @@ export declare class Material extends RnObject {
140
140
  * @internal
141
141
  */
142
142
  _getFingerPrint(): string;
143
+ private __textureBindingSignature;
144
+ private __textureBindingSignatureVersion;
145
+ private __multiDrawStateKey;
146
+ private __multiDrawStateKeyVersion;
147
+ /**
148
+ * Signature of the texture/sampler bindings and the true uniforms that are set per
149
+ * material in WebGL2 mode. Materials with the same signature can share one
150
+ * multi-draw batch (their per-draw state differs only in the data texture row).
151
+ * @internal
152
+ */
153
+ _getTextureBindingSignature(): string;
154
+ /**
155
+ * Key of the material state that must be identical for a multi-draw batch:
156
+ * material type, shader semantics variant, shader defines, pipeline fingerprint,
157
+ * texture bindings and true-uniform values.
158
+ * @internal
159
+ */
160
+ _getMultiDrawStateKey(): string;
143
161
  /**
144
162
  * Checks if a value is an animated value (implements IAnimatedValue).
145
163
  * @param value - The value to check
@@ -188,11 +206,10 @@ export declare class Material extends RnObject {
188
206
  isShaderProgramReady(primitive: Primitive): boolean;
189
207
  /**
190
208
  * Sets up uniform locations for material nodes in the shader program.
191
- * @internal Called from WebGLStrategyDataTexture and WebGLStrategyUniform only
192
- * @param isUniformOnlyMode - Whether to operate in uniform-only mode
209
+ * @internal Called from WebGLStrategyWebGL2 only
193
210
  * @param primitive - The primitive to set up uniforms for
194
211
  */
195
- _setUniformLocationsOfMaterialNodes(isUniformOnlyMode: boolean, primitive: Primitive): void;
212
+ _setUniformLocationsOfMaterialNodes(primitive: Primitive): void;
196
213
  /**
197
214
  * Gets the shader program UID for the given primitive.
198
215
  * @param primitive - The primitive to get the shader program UID for
@@ -212,7 +229,7 @@ export declare class Material extends RnObject {
212
229
  getBelongPrimitives(): Map<number, Primitive>;
213
230
  /**
214
231
  * Creates a WebGL shader program for this material and the given primitive.
215
- * @internal Called from WebGLStrategyDataTexture and WebGLStrategyUniform
232
+ * @internal Called from WebGLStrategyWebGL2
216
233
  * @param componentDataAccessMethodDefinitionsForVertexShader - method definitions for component data access for vertex shader
217
234
  * @param componentDataAccessMethodDefinitionsForPixelShader - method definitions for component data access for pixel shader
218
235
  * @param propertySetterOfGlobalDataRepository - Function to set shader properties of global data repository
@@ -234,7 +251,7 @@ export declare class Material extends RnObject {
234
251
  _createProgramWebGpu(engine: Engine, primitive: Primitive, componentDataAccessMethodDefinitionsForVertexShader: string, componentDataAccessMethodDefinitionsForPixelShader: string, propertySetterOfGlobalDataRepository: getShaderPropertyFuncOfGlobalDataRepository, propertySetterOfMaterial: getShaderPropertyFuncOfMaterial, morphedPositionGetter: string): void;
235
252
  /**
236
253
  * Creates a shader program using updated shader source code.
237
- * @internal Called from WebGLStrategyDataTexture and WebGLStrategyUniform
254
+ * @internal Called from WebGLStrategyWebGL2
238
255
  * @param updatedShaderSources - The updated shader source code
239
256
  * @param primitive - The primitive to create the program for
240
257
  * @param onError - Optional error callback function
@@ -243,18 +260,17 @@ export declare class Material extends RnObject {
243
260
  _createProgramByUpdatedSources(updatedShaderSources: ShaderSources, primitive: Primitive, onError?: (message: string) => void): [CGAPIResourceHandle, boolean];
244
261
  /**
245
262
  * Sets up basic uniform locations in the shader program.
246
- * @internal Called by WebGLStrategyDataTexture and WebGLStrategyUniform only
263
+ * @internal Called by WebGLStrategyWebGL2 only
247
264
  * @param primitive - The primitive to set up uniforms for
248
265
  */
249
266
  _setupBasicUniformsLocations(primitive: Primitive): void;
250
267
  /**
251
268
  * Sets up additional uniform locations in the shader program.
252
- * @internal Called by WebGLStrategyDataTexture and WebGLStrategyUniform only
269
+ * @internal Called by WebGLStrategyWebGL2 only
253
270
  * @param shaderSemantics - Array of shader semantics to set up
254
- * @param isUniformOnlyMode - Whether to operate in uniform-only mode
255
271
  * @param primitive - The primitive to set up uniforms for
256
272
  */
257
- _setupAdditionalUniformLocations(shaderSemantics: ShaderSemanticsInfo[], isUniformOnlyMode: boolean, primitive: Primitive): void;
273
+ _setupAdditionalUniformLocations(shaderSemantics: ShaderSemanticsInfo[], primitive: Primitive): void;
258
274
  /**
259
275
  * Sets internal setting parameters to GPU for WebGPU rendering.
260
276
  * @param params - Object containing material and rendering arguments
@@ -266,7 +282,7 @@ export declare class Material extends RnObject {
266
282
  }): void;
267
283
  /**
268
284
  * Sets parameters to GPU for WebGL rendering per material.
269
- * @internal Called from WebGLStrategyDataTexture and WebGLStrategyUniform only
285
+ * @internal Called from WebGLStrategyWebGL2 only
270
286
  * @param params - Object containing rendering parameters
271
287
  */
272
288
  _setParametersToGpuWebGL({ engine, material, shaderProgram, firstTime, args, }: {
@@ -301,10 +317,9 @@ export declare class Material extends RnObject {
301
317
  * Sets parameters to GPU for WebGL rendering without internal settings.
302
318
  * @param params - Object containing rendering parameters
303
319
  */
304
- _setParametersToGpuWebGLWithOutInternalSetting({ shaderProgram, firstTime, isUniformMode, }: {
320
+ _setParametersToGpuWebGLWithOutInternalSetting({ shaderProgram, firstTime, }: {
305
321
  shaderProgram: WebGLProgram;
306
322
  firstTime: boolean;
307
- isUniformMode: boolean;
308
323
  }): void;
309
324
  /**
310
325
  * Gets shader property strings for vertex and pixel shaders.
@@ -319,7 +334,6 @@ export declare class Material extends RnObject {
319
334
  /**
320
335
  * Sets automatic parameters to GPU for WebGL rendering.
321
336
  * @private
322
- * @param isUniformMode - Whether to operate in uniform mode
323
337
  * @param firstTime - Whether this is the first time setting parameters
324
338
  * @param shaderProgram - The WebGL shader program
325
339
  */
@@ -141,6 +141,11 @@ export declare class MaterialRepository {
141
141
  */
142
142
  private __allocateBufferView;
143
143
  _getMaterialCountPerBufferView(materialTypeName: string): Count | undefined;
144
+ /**
145
+ * Public accessor used by debugging tools. The material SID selects a buffer view
146
+ * with `floor(materialSID / materialCountPerBufferView)`.
147
+ */
148
+ getMaterialCountPerBufferView(materialTypeName: string): Count | undefined;
144
149
  _getBufferViewVersion(materialTypeName: string): number;
145
150
  /**
146
151
  * Invalidates all shader programs for all registered materials.
@@ -1,7 +1,11 @@
1
1
  import type { PhysicsShapeTypeEnum } from '../definitions/PhysicsShapeType';
2
2
  import type { IVector3 } from '../math';
3
3
  import type { IQuaternion } from '../math/IQuaternion';
4
- export type PhysicsEngineType = 'oimo' | 'rapier';
4
+ /**
5
+ * Physics engine selection.
6
+ * @deprecated Only 'rapier' is supported. Oimo.js support was removed. Retained for source compatibility.
7
+ */
8
+ export type PhysicsEngineType = 'rapier';
5
9
  export type PhysicsBodyProperty = {
6
10
  /** Whether the body is dynamic. False creates a fixed body. */
7
11
  move: boolean;
@@ -73,7 +77,10 @@ export type PhysicsPropertyInner = {
73
77
  export type PhysicsProperty = {
74
78
  /** Whether physics simulation is enabled for the entity */
75
79
  use: boolean;
76
- /** Physics engine to use. Defaults to 'rapier'. */
80
+ /**
81
+ * Physics engine to use.
82
+ * @deprecated Rapier is always used. Omit this field.
83
+ */
77
84
  engine?: PhysicsEngineType;
78
85
  /** Whether the physics body can move (dynamic) or is static */
79
86
  move: boolean;
@@ -1,5 +1,4 @@
1
1
  export * from './CharacterControllerStrategy';
2
- export * from './Oimo';
3
2
  export * from './PhysicsProperty';
4
3
  export * from './PhysicsStrategy';
5
4
  export * from './PhysicsWorldProperty';
@@ -83,12 +83,20 @@ export declare class RenderPass extends RnObject {
83
83
  _lastBlendWithoutZWriteIndex: number;
84
84
  /** @internal Array of last primitive UIDs for optimization */
85
85
  _lastPrimitiveUids: number[];
86
+ /**
87
+ * @internal Primitives in the same order as `_lastPrimitiveUids`, so the render strategy can
88
+ * avoid a per-primitive repository lookup. Valid only while `_lastPrimitiveUids` is the array
89
+ * the strategy was called with.
90
+ */
91
+ _lastPrimitives: Primitive[] | null;
86
92
  /** @internal Last transform components update count for change detection */
87
93
  _lastTransformComponentsUpdateCount: number;
88
94
  /** @internal Last camera controller components update count for change detection */
89
95
  _lastCameraControllerComponentsUpdateCount: number;
90
96
  /** @internal Last scene graph components update count for change detection */
91
97
  _lastSceneGraphComponentsUpdateCount: number;
98
+ /** @internal Last multi-draw group version for change detection */
99
+ _lastMultiDrawGroupVersion: number;
92
100
  /** @internal Whether something was rendered in the previous frame */
93
101
  _renderedSomethingBefore: boolean;
94
102
  /** @internal Whether the sort render result has changed */
@@ -35,7 +35,7 @@ interface EngineInitDescription {
35
35
  * @example
36
36
  * ```
37
37
  * const engine = await Rn.Engine.init({
38
- * approach: Rn.ProcessApproach.DataTexture,
38
+ * approach: Rn.ProcessApproach.WebGL2,
39
39
  * canvas: document.getElementById('world') as HTMLCanvasElement,
40
40
  * });
41
41
  *
@@ -218,7 +218,7 @@ export declare class Engine extends RnObject {
218
218
  * @example
219
219
  * ```
220
220
  * const engine = await Rn.Engine.init({
221
- * approach: Rn.ProcessApproach.DataTexture,
221
+ * approach: Rn.ProcessApproach.WebGL2,
222
222
  * canvas: document.getElementById('world') as HTMLCanvasElement,
223
223
  * });
224
224
  * ```
@@ -6,7 +6,7 @@ import { type ProcessApproachEnum } from '../definitions/ProcessApproach';
6
6
  export declare class EngineState {
7
7
  /**
8
8
  * The current process approach being used for rendering operations.
9
- * Determines whether to use WebGL2 uniform approach, data texture approach, WebGPU, or none.
9
+ * Determines whether to use the WebGL2 data texture approach, WebGPU, or none.
10
10
  */
11
11
  currentProcessApproach: ProcessApproachEnum;
12
12
  /**