rhodonite 0.20.0 → 0.20.1

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 (92) hide show
  1. package/VERSION-FILE +1 -1
  2. package/dist/esm/foundation/components/Animation/AnimationComponent.d.ts +18 -0
  3. package/dist/esm/foundation/components/Animation/AnimationOps.d.ts +20 -1
  4. package/dist/esm/foundation/components/Animation/AnimationStateRepository.d.ts +49 -0
  5. package/dist/esm/foundation/components/AnimationState/AnimationStateComponent.d.ts +5 -0
  6. package/dist/esm/foundation/components/BlendShape/BlendShapeComponent.d.ts +21 -0
  7. package/dist/esm/foundation/components/MeshRenderer/MeshRendererComponent.d.ts +61 -1
  8. package/dist/esm/foundation/components/SceneGraph/SceneGraphComponent.d.ts +50 -4
  9. package/dist/esm/foundation/components/Skeletal/SkeletalComponent.d.ts +45 -1
  10. package/dist/esm/foundation/components/Vrm/VrmComponent.d.ts +33 -3
  11. package/dist/esm/foundation/core/ComponentRepository.d.ts +17 -0
  12. package/dist/esm/foundation/geometry/Mesh.d.ts +27 -0
  13. package/dist/esm/foundation/gizmos/RotationGizmo.d.ts +2 -0
  14. package/dist/esm/foundation/gizmos/ScaleGizmo.d.ts +7 -0
  15. package/dist/esm/foundation/gizmos/TranslationGizmo.d.ts +7 -0
  16. package/dist/esm/foundation/helpers/MaterialHelper.d.ts +1 -1
  17. package/dist/esm/foundation/helpers/Shadow/ShadowSystem.d.ts +14 -0
  18. package/dist/esm/foundation/materials/contents/CustomMaterialContent.d.ts +4 -0
  19. package/dist/esm/foundation/materials/core/Material.d.ts +16 -0
  20. package/dist/esm/foundation/materials/core/MaterialRepository.d.ts +17 -0
  21. package/dist/esm/foundation/math/AnimatedQuaternion.d.ts +17 -1
  22. package/dist/esm/foundation/math/AnimatedScalar.d.ts +17 -1
  23. package/dist/esm/foundation/math/AnimatedValueEvaluationState.d.ts +56 -0
  24. package/dist/esm/foundation/math/AnimatedVector2.d.ts +17 -1
  25. package/dist/esm/foundation/math/AnimatedVector3.d.ts +17 -1
  26. package/dist/esm/foundation/math/AnimatedVector4.d.ts +17 -1
  27. package/dist/esm/foundation/math/AnimatedVectorN.d.ts +17 -1
  28. package/dist/esm/foundation/math/IAnimatedValue.d.ts +18 -0
  29. package/dist/esm/foundation/math/IMatrix.d.ts +12 -0
  30. package/dist/esm/foundation/math/IdentityMatrix44.d.ts +9 -0
  31. package/dist/esm/foundation/physics/Oimo/OimoPhysicsStrategy.d.ts +22 -0
  32. package/dist/esm/foundation/physics/PhysicsStrategy.d.ts +8 -0
  33. package/dist/esm/foundation/physics/Rapier/RapierCharacterControllerStrategy.d.ts +2 -0
  34. package/dist/esm/foundation/physics/Rapier/RapierPhysicsStrategy.d.ts +12 -0
  35. package/dist/esm/foundation/renderer/pipelines/ForwardRenderPipeline.d.ts +26 -26
  36. package/dist/esm/foundation/system/Engine.d.ts +31 -0
  37. package/dist/esm/foundation/textures/Sampler.d.ts +14 -0
  38. package/dist/esm/index.js +555 -555
  39. package/dist/esm/webgl/WebGLExtendedTypes.d.ts +2 -0
  40. package/dist/esm/webgl/WebGLGpuTimer.d.ts +32 -0
  41. package/dist/esm/webgl/WebGLResourceRepository.d.ts +21 -1
  42. package/dist/esm/webgl/WebGLStrategyDataTexture.d.ts +9 -0
  43. package/dist/esm/webgpu/RangeAllocator.d.ts +39 -0
  44. package/dist/esm/webgpu/WebGpuBufferArena.d.ts +60 -0
  45. package/dist/esm/webgpu/WebGpuGpuTimer.d.ts +49 -0
  46. package/dist/esm/webgpu/WebGpuResourceRepository.d.ts +212 -18
  47. package/dist/esmdev/foundation/components/Animation/AnimationComponent.d.ts +18 -0
  48. package/dist/esmdev/foundation/components/Animation/AnimationOps.d.ts +20 -1
  49. package/dist/esmdev/foundation/components/Animation/AnimationStateRepository.d.ts +49 -0
  50. package/dist/esmdev/foundation/components/AnimationState/AnimationStateComponent.d.ts +5 -0
  51. package/dist/esmdev/foundation/components/BlendShape/BlendShapeComponent.d.ts +21 -0
  52. package/dist/esmdev/foundation/components/MeshRenderer/MeshRendererComponent.d.ts +61 -1
  53. package/dist/esmdev/foundation/components/SceneGraph/SceneGraphComponent.d.ts +50 -4
  54. package/dist/esmdev/foundation/components/Skeletal/SkeletalComponent.d.ts +45 -1
  55. package/dist/esmdev/foundation/components/Vrm/VrmComponent.d.ts +33 -3
  56. package/dist/esmdev/foundation/core/ComponentRepository.d.ts +17 -0
  57. package/dist/esmdev/foundation/geometry/Mesh.d.ts +27 -0
  58. package/dist/esmdev/foundation/gizmos/RotationGizmo.d.ts +2 -0
  59. package/dist/esmdev/foundation/gizmos/ScaleGizmo.d.ts +7 -0
  60. package/dist/esmdev/foundation/gizmos/TranslationGizmo.d.ts +7 -0
  61. package/dist/esmdev/foundation/helpers/MaterialHelper.d.ts +1 -1
  62. package/dist/esmdev/foundation/helpers/Shadow/ShadowSystem.d.ts +14 -0
  63. package/dist/esmdev/foundation/materials/contents/CustomMaterialContent.d.ts +4 -0
  64. package/dist/esmdev/foundation/materials/core/Material.d.ts +16 -0
  65. package/dist/esmdev/foundation/materials/core/MaterialRepository.d.ts +17 -0
  66. package/dist/esmdev/foundation/math/AnimatedQuaternion.d.ts +17 -1
  67. package/dist/esmdev/foundation/math/AnimatedScalar.d.ts +17 -1
  68. package/dist/esmdev/foundation/math/AnimatedValueEvaluationState.d.ts +56 -0
  69. package/dist/esmdev/foundation/math/AnimatedVector2.d.ts +17 -1
  70. package/dist/esmdev/foundation/math/AnimatedVector3.d.ts +17 -1
  71. package/dist/esmdev/foundation/math/AnimatedVector4.d.ts +17 -1
  72. package/dist/esmdev/foundation/math/AnimatedVectorN.d.ts +17 -1
  73. package/dist/esmdev/foundation/math/IAnimatedValue.d.ts +18 -0
  74. package/dist/esmdev/foundation/math/IMatrix.d.ts +12 -0
  75. package/dist/esmdev/foundation/math/IdentityMatrix44.d.ts +9 -0
  76. package/dist/esmdev/foundation/physics/Oimo/OimoPhysicsStrategy.d.ts +22 -0
  77. package/dist/esmdev/foundation/physics/PhysicsStrategy.d.ts +8 -0
  78. package/dist/esmdev/foundation/physics/Rapier/RapierCharacterControllerStrategy.d.ts +2 -0
  79. package/dist/esmdev/foundation/physics/Rapier/RapierPhysicsStrategy.d.ts +12 -0
  80. package/dist/esmdev/foundation/renderer/pipelines/ForwardRenderPipeline.d.ts +26 -26
  81. package/dist/esmdev/foundation/system/Engine.d.ts +31 -0
  82. package/dist/esmdev/foundation/textures/Sampler.d.ts +14 -0
  83. package/dist/esmdev/index.js +6620 -4050
  84. package/dist/esmdev/webgl/WebGLExtendedTypes.d.ts +2 -0
  85. package/dist/esmdev/webgl/WebGLGpuTimer.d.ts +32 -0
  86. package/dist/esmdev/webgl/WebGLResourceRepository.d.ts +21 -1
  87. package/dist/esmdev/webgl/WebGLStrategyDataTexture.d.ts +9 -0
  88. package/dist/esmdev/webgpu/RangeAllocator.d.ts +39 -0
  89. package/dist/esmdev/webgpu/WebGpuBufferArena.d.ts +60 -0
  90. package/dist/esmdev/webgpu/WebGpuGpuTimer.d.ts +49 -0
  91. package/dist/esmdev/webgpu/WebGpuResourceRepository.d.ts +212 -18
  92. package/package.json +1 -1
@@ -56,6 +56,8 @@ export declare class Engine extends RnObject {
56
56
  private __engineState;
57
57
  private __renderPassTickCount;
58
58
  private __animationFrameId;
59
+ /** The object (Window or XRSession) that owns the current animation frame callback. */
60
+ private __animationFrameObject?;
59
61
  private __renderLoopFunc?;
60
62
  private __args;
61
63
  private __webXRSystem;
@@ -75,6 +77,8 @@ export declare class Engine extends RnObject {
75
77
  private __lastPrimitiveCount;
76
78
  /** Shader program cache map for this engine instance. Maps shader text to program UIDs. */
77
79
  private __shaderProgramCache;
80
+ private __gpuTimerEnabled;
81
+ private __webglGpuTimer?;
78
82
  private static __engines;
79
83
  private static __engineCount;
80
84
  private __engineUid;
@@ -166,6 +170,33 @@ export declare class Engine extends RnObject {
166
170
  */
167
171
  process(frame: Frame): void;
168
172
  process(expressions: Expression[]): void;
173
+ /**
174
+ * Whether the GPU time of each process() call is measured.
175
+ *
176
+ * @remarks
177
+ * Disabled by default. Measuring uses GPU timer queries (EXT_disjoint_timer_query_webgl2 in WebGL2, the
178
+ * `timestamp-query` feature in WebGPU), which add a small overhead. See {@link gpuTimeMilliseconds}.
179
+ */
180
+ get gpuTimerEnabled(): boolean;
181
+ set gpuTimerEnabled(flag: boolean);
182
+ /**
183
+ * Whether the GPU time can be measured in this environment.
184
+ * Browsers may not expose GPU timer queries (e.g. for privacy reasons or on some platforms).
185
+ */
186
+ get isGpuTimerSupported(): boolean;
187
+ /**
188
+ * The GPU time spent on the latest measured process() call, in milliseconds.
189
+ *
190
+ * @remarks
191
+ * Undefined until a result is available, or when {@link gpuTimerEnabled} is false or the environment does
192
+ * not support GPU timer queries. GPU results arrive asynchronously, so the value lags behind by a few
193
+ * frames. In WebGPU it is the sum of the durations of the render passes; in WebGL2 it is the time the GPU
194
+ * spent on all the commands issued during process().
195
+ */
196
+ get gpuTimeMilliseconds(): number | undefined;
197
+ private __getWebGLGpuTimer;
198
+ private __beginGpuTimer;
199
+ private __endGpuTimer;
169
200
  private __processRenderPassWebGPU;
170
201
  private __renderDeferredEffekseerEffectsAfterResolveWebGPU;
171
202
  private __renderMeshesWebGPU;
@@ -87,3 +87,17 @@ export declare class Sampler {
87
87
  */
88
88
  destroy(): void;
89
89
  }
90
+ /**
91
+ * Returns a sampler shared per engine for the given descriptor, creating it on first use.
92
+ *
93
+ * Use this for default samplers that are set on many materials. Creating a new Sampler per material
94
+ * creates one GPU sampler object per material, and the renderer then has to rebind the sampler on
95
+ * every draw because no two consecutive materials share one. Samplers are immutable after creation,
96
+ * so sharing them is safe.
97
+ *
98
+ * @param engine - The engine that owns the sampler
99
+ * @param desc - The sampler descriptor
100
+ * @returns The shared sampler (already created)
101
+ * @internal
102
+ */
103
+ export declare function getSharedSampler(engine: Engine, desc: SamplerDescriptor): Sampler;