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
package/README.md
CHANGED
|
@@ -74,6 +74,14 @@ $ npm install rhodonite
|
|
|
74
74
|
|
|
75
75
|
If you get an error like "webxr-input-profiles not found" when building a project using Rhodonite, Try "npm install" or "pnpm install" again.
|
|
76
76
|
|
|
77
|
+
## Migration to WebGL2 mode
|
|
78
|
+
|
|
79
|
+
- `ProcessApproach.Uniform` was removed. Use `ProcessApproach.WebGL2`.
|
|
80
|
+
- `ProcessApproach.DataTexture` was renamed to `ProcessApproach.WebGL2` (mode name `"WebGL2"`).
|
|
81
|
+
- `WebGLStrategyDataTexture` was renamed to `WebGLStrategyWebGL2`.
|
|
82
|
+
- The shader define `RN_IS_DATATEXTURE_MODE` was renamed to `RN_IS_WEBGL2_MODE`.
|
|
83
|
+
- `Config.maxSkeletalBoneNumberForUniformMode` and the `setUniform` rendering argument were removed.
|
|
84
|
+
|
|
77
85
|
## Coding with Rhodonite
|
|
78
86
|
|
|
79
87
|
### In JavaScript
|
|
@@ -85,7 +93,7 @@ If you get an error like "webxr-input-profiles not found" when building a projec
|
|
|
85
93
|
<script>
|
|
86
94
|
// Init Rhodonite
|
|
87
95
|
const engine = await Rn.Engine.init({
|
|
88
|
-
approach: Rn.ProcessApproach.
|
|
96
|
+
approach: Rn.ProcessApproach.WebGL2,
|
|
89
97
|
canvas: document.getElementById('world'),
|
|
90
98
|
});
|
|
91
99
|
|
|
@@ -120,7 +128,7 @@ import Rn from 'rhodonite/dist/esm/index.js';
|
|
|
120
128
|
|
|
121
129
|
// Init Rhodonite
|
|
122
130
|
const engine = await Rn.Engine.init({
|
|
123
|
-
approach: Rn.ProcessApproach.
|
|
131
|
+
approach: Rn.ProcessApproach.WebGL2,
|
|
124
132
|
canvas: document.getElementById('world') as HTMLCanvasElement,
|
|
125
133
|
});
|
|
126
134
|
|
package/VERSION-FILE
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
v0.
|
|
1
|
+
v0.21.0-1-gbbd868bcd-dirty
|
|
2
2
|
main
|
|
@@ -73,7 +73,7 @@ export declare class PhysicsComponent extends Component {
|
|
|
73
73
|
/**
|
|
74
74
|
* Common logic method that updates the global physics simulation.
|
|
75
75
|
* This is called once per frame for all physics components and handles
|
|
76
|
-
* the overall physics world update
|
|
76
|
+
* the overall physics world update through the Rapier physics backend.
|
|
77
77
|
*/
|
|
78
78
|
static common_$logic({ engine }: {
|
|
79
79
|
engine: Engine;
|
|
@@ -29,11 +29,6 @@ export type MemberInfo = {
|
|
|
29
29
|
componentType: ComponentTypeEnum;
|
|
30
30
|
initValues: number[] | VectorN;
|
|
31
31
|
convertToBool?: boolean;
|
|
32
|
-
/**
|
|
33
|
-
* Multiplier applied to the uniform array length in uniform mode
|
|
34
|
-
* (the array length becomes Config.maxSkeletalBoneNumberForUniformMode * this value).
|
|
35
|
-
*/
|
|
36
|
-
uniformArrayLengthMultiplier?: number;
|
|
37
32
|
/**
|
|
38
33
|
* Whether this array member has a per-instance length (see `Component.registerMember`).
|
|
39
34
|
*/
|
|
@@ -249,10 +244,9 @@ export declare class Component extends RnObject {
|
|
|
249
244
|
* @param componentType - The primitive data type (e.g., Float32, Int32)
|
|
250
245
|
* @param initValues - Initial values for the member field
|
|
251
246
|
* @param convertToBool - Whether to convert the member value to a boolean
|
|
252
|
-
* @param uniformArrayLengthMultiplier - Multiplier of the uniform array length in uniform mode
|
|
253
247
|
* @param isVariableLength - Whether the array member has a per-instance length
|
|
254
248
|
*/
|
|
255
|
-
static registerMember(this: typeof Component, { bufferUse, memberName, dataClassType, shaderType, compositionType, componentType, initValues, arrayLength, componentSID, convertToBool,
|
|
249
|
+
static registerMember(this: typeof Component, { bufferUse, memberName, dataClassType, shaderType, compositionType, componentType, initValues, arrayLength, componentSID, convertToBool, isVariableLength, }: {
|
|
256
250
|
bufferUse: BufferUseEnum;
|
|
257
251
|
memberName: string;
|
|
258
252
|
dataClassType: DataClassType;
|
|
@@ -263,7 +257,6 @@ export declare class Component extends RnObject {
|
|
|
263
257
|
arrayLength?: Count | undefined;
|
|
264
258
|
componentSID?: ComponentSID;
|
|
265
259
|
convertToBool?: boolean;
|
|
266
|
-
uniformArrayLengthMultiplier?: number;
|
|
267
260
|
isVariableLength?: boolean;
|
|
268
261
|
}): void;
|
|
269
262
|
/**
|
|
@@ -11,7 +11,6 @@ type ConfigInitDescription = {
|
|
|
11
11
|
maxLightNumber?: number;
|
|
12
12
|
materialCountPerBufferView?: number;
|
|
13
13
|
boneDataType?: BoneDataTypeEnum;
|
|
14
|
-
maxSkeletalBoneNumberForUniformMode?: number;
|
|
15
14
|
isUboEnabled?: boolean;
|
|
16
15
|
eventTargetDom?: HTMLElement;
|
|
17
16
|
cacheWebGpuRenderBundles?: boolean;
|
|
@@ -50,8 +49,6 @@ export declare class Config {
|
|
|
50
49
|
* and other SkeletalComponents default to Vec4x2.
|
|
51
50
|
*/
|
|
52
51
|
boneDataType: BoneDataTypeEnum | undefined;
|
|
53
|
-
/** The maximum number of bones of each skeleton that Rhodonite can handle for Uniform Mode */
|
|
54
|
-
maxSkeletalBoneNumberForUniformMode: number;
|
|
55
52
|
/** Whether the UBO is enabled */
|
|
56
53
|
isUboEnabled: boolean;
|
|
57
54
|
/** The event target DOM for mouse operation */
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { ProcessApproachEnum } from '../../foundation/definitions/ProcessApproach';
|
|
2
|
-
import type { CGAPIResourceHandle, Index, IndexOf16Bytes } from '../../types/CommonTypes';
|
|
2
|
+
import type { CGAPIResourceHandle, Count, Index, IndexOf16Bytes } from '../../types/CommonTypes';
|
|
3
3
|
import type { getShaderPropertyFuncOfGlobalDataRepository, ShaderSemanticsName } from '../definitions/ShaderSemantics';
|
|
4
|
+
import { type ShaderSemanticsInfo } from '../definitions/ShaderSemanticsInfo';
|
|
4
5
|
import type { Engine } from '../system/Engine';
|
|
5
6
|
/**
|
|
6
7
|
* The repository class that manages global data used throughout the rendering pipeline.
|
|
@@ -63,13 +64,16 @@ export declare class GlobalDataRepository {
|
|
|
63
64
|
*/
|
|
64
65
|
getValue(shaderSemantic: ShaderSemanticsName, countIndex: Index): any;
|
|
65
66
|
/**
|
|
66
|
-
*
|
|
67
|
-
* This is
|
|
68
|
-
*
|
|
69
|
-
* @param shaderProgramUid - The unique identifier of the shader program
|
|
70
|
-
* @internal
|
|
67
|
+
* Returns every registered global property with its current value and layout offset.
|
|
68
|
+
* This is intended for debugging tools; it does not allocate or modify anything.
|
|
71
69
|
*/
|
|
72
|
-
|
|
70
|
+
getPropertyTable(): Array<{
|
|
71
|
+
semantic: ShaderSemanticsName;
|
|
72
|
+
info: ShaderSemanticsInfo;
|
|
73
|
+
value: any;
|
|
74
|
+
vec4Index: IndexOf16Bytes;
|
|
75
|
+
maxCount: Count;
|
|
76
|
+
}>;
|
|
73
77
|
/**
|
|
74
78
|
* Sets up uniform locations for properties that need uniform access in data texture mode.
|
|
75
79
|
* Only sets up uniforms for properties marked with needUniformInDataTextureMode flag.
|
|
@@ -77,7 +81,7 @@ export declare class GlobalDataRepository {
|
|
|
77
81
|
* @param shaderProgramUid - The unique identifier of the shader program
|
|
78
82
|
* @internal
|
|
79
83
|
*/
|
|
80
|
-
|
|
84
|
+
_setUniformLocationsForWebGL2ModeOnly(shaderProgramUid: CGAPIResourceHandle): void;
|
|
81
85
|
/**
|
|
82
86
|
* Gets the memory location offset of a global property in 16-byte aligned units.
|
|
83
87
|
* This is used for data texture mode to determine where properties are stored in memory.
|
|
@@ -87,6 +87,18 @@ export declare class MemoryManager {
|
|
|
87
87
|
* @returns The byte offset of the existing buffers in bytes
|
|
88
88
|
*/
|
|
89
89
|
getByteOffsetOfExistingBuffers(bufferUse: BufferUseEnum, indexOfTheBufferLayer: Index): Byte;
|
|
90
|
+
/**
|
|
91
|
+
* Reads float values from the concatenated layers of a buffer usage.
|
|
92
|
+
*
|
|
93
|
+
* This is intended for debugging tools. The returned array is a copy when the range
|
|
94
|
+
* spans buffer layers, and a view into the layer otherwise.
|
|
95
|
+
*
|
|
96
|
+
* @param bufferUse - The buffer usage to read
|
|
97
|
+
* @param byteOffset - Byte offset from the start of the first layer
|
|
98
|
+
* @param count - Number of float values to read
|
|
99
|
+
* @returns The read values, or null when the range is outside the allocated buffers
|
|
100
|
+
*/
|
|
101
|
+
readFloat32Array(bufferUse: BufferUseEnum, byteOffset: Byte, count: Count): Float32Array | null;
|
|
90
102
|
/**
|
|
91
103
|
* Prints memory usage statistics for all managed buffers to the console.
|
|
92
104
|
* Shows used bytes, total bytes, and usage percentage for each buffer type.
|
|
@@ -8,17 +8,12 @@ export declare class ProcessApproachClass extends EnumClass implements EnumIO {
|
|
|
8
8
|
}
|
|
9
9
|
export type ProcessApproachEnum = ProcessApproachClass;
|
|
10
10
|
declare function from(index: number): ProcessApproachEnum | undefined;
|
|
11
|
-
declare const isDataTextureApproach: (processApproach: ProcessApproachEnum) => boolean;
|
|
12
|
-
declare const isUniformApproach: (processApproach: ProcessApproachEnum) => boolean;
|
|
13
11
|
declare const isWebGpuApproach: (processApproach: ProcessApproachEnum) => boolean;
|
|
14
12
|
declare const isWebGL2Approach: (processApproach: ProcessApproachEnum) => boolean;
|
|
15
13
|
export declare const ProcessApproach: Readonly<{
|
|
16
|
-
isDataTextureApproach: typeof isDataTextureApproach;
|
|
17
|
-
isUniformApproach: typeof isUniformApproach;
|
|
18
14
|
isWebGpuApproach: typeof isWebGpuApproach;
|
|
19
15
|
None: ProcessApproachClass;
|
|
20
|
-
|
|
21
|
-
DataTexture: ProcessApproachClass;
|
|
16
|
+
WebGL2: ProcessApproachClass;
|
|
22
17
|
WebGPU: ProcessApproachClass;
|
|
23
18
|
from: typeof from;
|
|
24
19
|
isWebGL2Approach: typeof isWebGL2Approach;
|
|
@@ -71,7 +71,6 @@ export declare const ShaderSemantics: Readonly<{
|
|
|
71
71
|
ShadingModel: ShaderSemanticsEnum;
|
|
72
72
|
SkinningMode: ShaderSemanticsEnum;
|
|
73
73
|
GeneralTexture: ShaderSemanticsEnum;
|
|
74
|
-
VertexAttributesExistenceArray: ShaderSemanticsEnum;
|
|
75
74
|
BoneQuaternion: ShaderSemanticsEnum;
|
|
76
75
|
BoneTranslateScale: ShaderSemanticsEnum;
|
|
77
76
|
BoneTranslatePackedQuat: ShaderSemanticsEnum;
|
|
@@ -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 (
|
|
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';
|
|
@@ -39,10 +36,6 @@ export declare abstract class AbstractMaterialContent extends RnObject {
|
|
|
39
36
|
private __isMorphing;
|
|
40
37
|
private __isSkinning;
|
|
41
38
|
private __isLighting;
|
|
42
|
-
private static __lightPositions;
|
|
43
|
-
private static __lightDirections;
|
|
44
|
-
private static __lightIntensities;
|
|
45
|
-
private static __lightProperties;
|
|
46
39
|
private static __materialContentCount;
|
|
47
40
|
private __materialContentUid;
|
|
48
41
|
/** Shader caches managed per-Engine. Key is Engine.objectUID */
|
|
@@ -172,7 +165,7 @@ export declare abstract class AbstractMaterialContent extends RnObject {
|
|
|
172
165
|
* @param material - The material instance
|
|
173
166
|
* @param CameraComponentClass - The camera component class
|
|
174
167
|
*/
|
|
175
|
-
protected setupBasicInfo(
|
|
168
|
+
protected setupBasicInfo(_engine: Engine, args: RenderingArgWebGL, shaderProgram: WebGLProgram, _firstTime: boolean, _material: Material, _CameraComponentClass: typeof CameraComponent): void;
|
|
176
169
|
/**
|
|
177
170
|
* Sets the world transformation matrix uniform in the shader.
|
|
178
171
|
* @param shaderProgram - The WebGL shader program
|
|
@@ -213,21 +206,6 @@ export declare abstract class AbstractMaterialContent extends RnObject {
|
|
|
213
206
|
* @param displayIdx - The display index for VR rendering
|
|
214
207
|
*/
|
|
215
208
|
setProjection(shaderProgram: WebGLProgram, cameraComponent: CameraComponent, isVr: boolean, displayIdx: number): void;
|
|
216
|
-
/**
|
|
217
|
-
* Sets skeletal animation uniforms in the shader.
|
|
218
|
-
* @param shaderProgram - The WebGL shader program
|
|
219
|
-
* @param setUniform - Whether to set uniform values
|
|
220
|
-
* @param skeletalComponent - The skeletal component containing bone data
|
|
221
|
-
*/
|
|
222
|
-
protected setSkinning(config: Config, shaderProgram: WebGLProgram, setUniform: boolean, skeletalComponent?: SkeletalComponent): void;
|
|
223
|
-
/**
|
|
224
|
-
* Sets lighting information uniforms in the shader.
|
|
225
|
-
* @param shaderProgram - The WebGL shader program
|
|
226
|
-
* @param lightComponents - Array of light components
|
|
227
|
-
* @param material - The material instance
|
|
228
|
-
* @param setUniform - Whether to set uniform values
|
|
229
|
-
*/
|
|
230
|
-
protected setLightsInfo(config: Config, shaderProgram: WebGLProgram, lightComponents: LightComponent[], _material: Material, setUniform: boolean): void;
|
|
231
209
|
/**
|
|
232
210
|
* Sets morph target animation uniforms in the shader.
|
|
233
211
|
* @param shaderProgram - The WebGL shader program
|
|
@@ -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
|
/**
|