rhodonite 0.20.2 → 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.
- package/README.md +10 -2
- package/VERSION-FILE +1 -1
- package/dist/esm/foundation/components/Physics/PhysicsComponent.d.ts +1 -1
- package/dist/esm/foundation/core/Component.d.ts +1 -8
- package/dist/esm/foundation/core/Config.d.ts +0 -3
- package/dist/esm/foundation/core/GlobalDataRepository.d.ts +12 -8
- package/dist/esm/foundation/core/MemoryManager.d.ts +12 -0
- package/dist/esm/foundation/definitions/ProcessApproach.d.ts +1 -6
- package/dist/esm/foundation/definitions/ShaderSemantics.d.ts +0 -1
- package/dist/esm/foundation/materials/contents/CustomMaterialContent.d.ts +1 -1
- package/dist/esm/foundation/materials/core/AbstractMaterialContent.d.ts +1 -23
- package/dist/esm/foundation/materials/core/Material.d.ts +10 -14
- package/dist/esm/foundation/materials/core/MaterialRepository.d.ts +5 -0
- package/dist/esm/foundation/physics/PhysicsProperty.d.ts +9 -2
- package/dist/esm/foundation/physics/index.d.ts +0 -1
- package/dist/esm/foundation/system/Engine.d.ts +2 -2
- package/dist/esm/foundation/system/EngineState.d.ts +1 -1
- package/dist/esm/index.js +465 -588
- package/dist/esm/webgl/MultiDraw.d.ts +1 -1
- package/dist/esm/webgl/WebGLResourceRepository.d.ts +1 -2
- package/dist/{esmdev/webgl/WebGLStrategyDataTexture.d.ts → esm/webgl/WebGLStrategyWebGL2.d.ts} +4 -4
- package/dist/esm/webgl/debug/BufferLayoutDecoder.d.ts +83 -0
- package/dist/esm/webgl/debug/ShaderParameterDebugger.d.ts +47 -0
- package/dist/esm/webgl/debug/index.d.ts +3 -0
- package/dist/esm/webgl/debug/types.d.ts +114 -0
- package/dist/esm/webgl/index.d.ts +2 -2
- package/dist/esm/webgl/main.d.ts +2 -4
- package/dist/esm/webgl/shaders/StandardShaderPart.d.ts +1 -1
- package/dist/esm/webgl/types/CommonTypes.d.ts +0 -1
- package/dist/esmdev/foundation/components/Physics/PhysicsComponent.d.ts +1 -1
- package/dist/esmdev/foundation/core/Component.d.ts +1 -8
- package/dist/esmdev/foundation/core/Config.d.ts +0 -3
- package/dist/esmdev/foundation/core/GlobalDataRepository.d.ts +12 -8
- package/dist/esmdev/foundation/core/MemoryManager.d.ts +12 -0
- package/dist/esmdev/foundation/definitions/ProcessApproach.d.ts +1 -6
- package/dist/esmdev/foundation/definitions/ShaderSemantics.d.ts +0 -1
- package/dist/esmdev/foundation/materials/contents/CustomMaterialContent.d.ts +1 -1
- package/dist/esmdev/foundation/materials/core/AbstractMaterialContent.d.ts +1 -23
- package/dist/esmdev/foundation/materials/core/Material.d.ts +10 -14
- package/dist/esmdev/foundation/materials/core/MaterialRepository.d.ts +5 -0
- package/dist/esmdev/foundation/physics/PhysicsProperty.d.ts +9 -2
- package/dist/esmdev/foundation/physics/index.d.ts +0 -1
- package/dist/esmdev/foundation/system/Engine.d.ts +2 -2
- package/dist/esmdev/foundation/system/EngineState.d.ts +1 -1
- package/dist/esmdev/index.js +1293 -2043
- package/dist/esmdev/webgl/MultiDraw.d.ts +1 -1
- package/dist/esmdev/webgl/WebGLResourceRepository.d.ts +1 -2
- package/dist/{esm/webgl/WebGLStrategyDataTexture.d.ts → esmdev/webgl/WebGLStrategyWebGL2.d.ts} +4 -4
- package/dist/esmdev/webgl/debug/BufferLayoutDecoder.d.ts +83 -0
- package/dist/esmdev/webgl/debug/ShaderParameterDebugger.d.ts +47 -0
- package/dist/esmdev/webgl/debug/index.d.ts +3 -0
- package/dist/esmdev/webgl/debug/types.d.ts +114 -0
- package/dist/esmdev/webgl/index.d.ts +2 -2
- package/dist/esmdev/webgl/main.d.ts +2 -4
- package/dist/esmdev/webgl/shaders/StandardShaderPart.d.ts +1 -1
- package/dist/esmdev/webgl/types/CommonTypes.d.ts +0 -1
- package/package.json +2 -1
- package/dist/esm/foundation/physics/Oimo/OimoPhysicsStrategy.d.ts +0 -124
- package/dist/esm/foundation/physics/Oimo/index.d.ts +0 -1
- package/dist/esm/webgl/WebGLStrategyUniform.d.ts +0 -193
- package/dist/esmdev/foundation/physics/Oimo/OimoPhysicsStrategy.d.ts +0 -124
- package/dist/esmdev/foundation/physics/Oimo/index.d.ts +0 -1
- package/dist/esmdev/webgl/WebGLStrategyUniform.d.ts +0 -193
|
@@ -146,7 +146,7 @@ export declare class Material extends RnObject {
|
|
|
146
146
|
private __multiDrawStateKeyVersion;
|
|
147
147
|
/**
|
|
148
148
|
* Signature of the texture/sampler bindings and the true uniforms that are set per
|
|
149
|
-
* material in
|
|
149
|
+
* material in WebGL2 mode. Materials with the same signature can share one
|
|
150
150
|
* multi-draw batch (their per-draw state differs only in the data texture row).
|
|
151
151
|
* @internal
|
|
152
152
|
*/
|
|
@@ -206,11 +206,10 @@ export declare class Material extends RnObject {
|
|
|
206
206
|
isShaderProgramReady(primitive: Primitive): boolean;
|
|
207
207
|
/**
|
|
208
208
|
* Sets up uniform locations for material nodes in the shader program.
|
|
209
|
-
* @internal Called from
|
|
210
|
-
* @param isUniformOnlyMode - Whether to operate in uniform-only mode
|
|
209
|
+
* @internal Called from WebGLStrategyWebGL2 only
|
|
211
210
|
* @param primitive - The primitive to set up uniforms for
|
|
212
211
|
*/
|
|
213
|
-
_setUniformLocationsOfMaterialNodes(
|
|
212
|
+
_setUniformLocationsOfMaterialNodes(primitive: Primitive): void;
|
|
214
213
|
/**
|
|
215
214
|
* Gets the shader program UID for the given primitive.
|
|
216
215
|
* @param primitive - The primitive to get the shader program UID for
|
|
@@ -230,7 +229,7 @@ export declare class Material extends RnObject {
|
|
|
230
229
|
getBelongPrimitives(): Map<number, Primitive>;
|
|
231
230
|
/**
|
|
232
231
|
* Creates a WebGL shader program for this material and the given primitive.
|
|
233
|
-
* @internal Called from
|
|
232
|
+
* @internal Called from WebGLStrategyWebGL2
|
|
234
233
|
* @param componentDataAccessMethodDefinitionsForVertexShader - method definitions for component data access for vertex shader
|
|
235
234
|
* @param componentDataAccessMethodDefinitionsForPixelShader - method definitions for component data access for pixel shader
|
|
236
235
|
* @param propertySetterOfGlobalDataRepository - Function to set shader properties of global data repository
|
|
@@ -252,7 +251,7 @@ export declare class Material extends RnObject {
|
|
|
252
251
|
_createProgramWebGpu(engine: Engine, primitive: Primitive, componentDataAccessMethodDefinitionsForVertexShader: string, componentDataAccessMethodDefinitionsForPixelShader: string, propertySetterOfGlobalDataRepository: getShaderPropertyFuncOfGlobalDataRepository, propertySetterOfMaterial: getShaderPropertyFuncOfMaterial, morphedPositionGetter: string): void;
|
|
253
252
|
/**
|
|
254
253
|
* Creates a shader program using updated shader source code.
|
|
255
|
-
* @internal Called from
|
|
254
|
+
* @internal Called from WebGLStrategyWebGL2
|
|
256
255
|
* @param updatedShaderSources - The updated shader source code
|
|
257
256
|
* @param primitive - The primitive to create the program for
|
|
258
257
|
* @param onError - Optional error callback function
|
|
@@ -261,18 +260,17 @@ export declare class Material extends RnObject {
|
|
|
261
260
|
_createProgramByUpdatedSources(updatedShaderSources: ShaderSources, primitive: Primitive, onError?: (message: string) => void): [CGAPIResourceHandle, boolean];
|
|
262
261
|
/**
|
|
263
262
|
* Sets up basic uniform locations in the shader program.
|
|
264
|
-
* @internal Called by
|
|
263
|
+
* @internal Called by WebGLStrategyWebGL2 only
|
|
265
264
|
* @param primitive - The primitive to set up uniforms for
|
|
266
265
|
*/
|
|
267
266
|
_setupBasicUniformsLocations(primitive: Primitive): void;
|
|
268
267
|
/**
|
|
269
268
|
* Sets up additional uniform locations in the shader program.
|
|
270
|
-
* @internal Called by
|
|
269
|
+
* @internal Called by WebGLStrategyWebGL2 only
|
|
271
270
|
* @param shaderSemantics - Array of shader semantics to set up
|
|
272
|
-
* @param isUniformOnlyMode - Whether to operate in uniform-only mode
|
|
273
271
|
* @param primitive - The primitive to set up uniforms for
|
|
274
272
|
*/
|
|
275
|
-
_setupAdditionalUniformLocations(shaderSemantics: ShaderSemanticsInfo[],
|
|
273
|
+
_setupAdditionalUniformLocations(shaderSemantics: ShaderSemanticsInfo[], primitive: Primitive): void;
|
|
276
274
|
/**
|
|
277
275
|
* Sets internal setting parameters to GPU for WebGPU rendering.
|
|
278
276
|
* @param params - Object containing material and rendering arguments
|
|
@@ -284,7 +282,7 @@ export declare class Material extends RnObject {
|
|
|
284
282
|
}): void;
|
|
285
283
|
/**
|
|
286
284
|
* Sets parameters to GPU for WebGL rendering per material.
|
|
287
|
-
* @internal Called from
|
|
285
|
+
* @internal Called from WebGLStrategyWebGL2 only
|
|
288
286
|
* @param params - Object containing rendering parameters
|
|
289
287
|
*/
|
|
290
288
|
_setParametersToGpuWebGL({ engine, material, shaderProgram, firstTime, args, }: {
|
|
@@ -319,10 +317,9 @@ export declare class Material extends RnObject {
|
|
|
319
317
|
* Sets parameters to GPU for WebGL rendering without internal settings.
|
|
320
318
|
* @param params - Object containing rendering parameters
|
|
321
319
|
*/
|
|
322
|
-
_setParametersToGpuWebGLWithOutInternalSetting({ shaderProgram, firstTime,
|
|
320
|
+
_setParametersToGpuWebGLWithOutInternalSetting({ shaderProgram, firstTime, }: {
|
|
323
321
|
shaderProgram: WebGLProgram;
|
|
324
322
|
firstTime: boolean;
|
|
325
|
-
isUniformMode: boolean;
|
|
326
323
|
}): void;
|
|
327
324
|
/**
|
|
328
325
|
* Gets shader property strings for vertex and pixel shaders.
|
|
@@ -337,7 +334,6 @@ export declare class Material extends RnObject {
|
|
|
337
334
|
/**
|
|
338
335
|
* Sets automatic parameters to GPU for WebGL rendering.
|
|
339
336
|
* @private
|
|
340
|
-
* @param isUniformMode - Whether to operate in uniform mode
|
|
341
337
|
* @param firstTime - Whether this is the first time setting parameters
|
|
342
338
|
* @param shaderProgram - The WebGL shader program
|
|
343
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
|
-
|
|
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
|
-
/**
|
|
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;
|
|
@@ -35,7 +35,7 @@ interface EngineInitDescription {
|
|
|
35
35
|
* @example
|
|
36
36
|
* ```
|
|
37
37
|
* const engine = await Rn.Engine.init({
|
|
38
|
-
* approach: Rn.ProcessApproach.
|
|
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.
|
|
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
|
|
9
|
+
* Determines whether to use the WebGL2 data texture approach, WebGPU, or none.
|
|
10
10
|
*/
|
|
11
11
|
currentProcessApproach: ProcessApproachEnum;
|
|
12
12
|
/**
|