rhodonite 0.22.1 → 0.22.2
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/VERSION-FILE +1 -1
- package/dist/esm/foundation/components/SceneGraph/SceneGraphComponent.d.ts +26 -1
- package/dist/esm/foundation/core/ComponentRepository.d.ts +7 -0
- package/dist/esm/foundation/renderer/lightCluster/LightClusterBuilder.d.ts +7 -1
- package/dist/esm/foundation/renderer/lightCluster/LightClusterLayout.d.ts +11 -0
- package/dist/esm/foundation/renderer/lightCluster/LightClusterSystem.d.ts +22 -0
- package/dist/esm/index.js +204 -123
- package/dist/esm/webgl/WebGLStrategyWebGL2.d.ts +9 -5
- package/dist/esm/webgpu/convertFloat32ToFloat16Bits.d.ts +16 -0
- package/dist/esm/webgpu/packRgbaRowsForUpload.d.ts +23 -0
- package/dist/esmdev/foundation/components/SceneGraph/SceneGraphComponent.d.ts +26 -1
- package/dist/esmdev/foundation/core/ComponentRepository.d.ts +7 -0
- package/dist/esmdev/foundation/renderer/lightCluster/LightClusterBuilder.d.ts +7 -1
- package/dist/esmdev/foundation/renderer/lightCluster/LightClusterLayout.d.ts +11 -0
- package/dist/esmdev/foundation/renderer/lightCluster/LightClusterSystem.d.ts +22 -0
- package/dist/esmdev/index.js +693 -50
- package/dist/esmdev/webgl/WebGLStrategyWebGL2.d.ts +9 -5
- package/dist/esmdev/webgpu/convertFloat32ToFloat16Bits.d.ts +16 -0
- package/dist/esmdev/webgpu/packRgbaRowsForUpload.d.ts +23 -0
- package/package.json +1 -1
|
@@ -489,16 +489,20 @@ export declare class WebGLStrategyWebGL2 implements CGAPIStrategy, WebGLStrategy
|
|
|
489
489
|
* between draw calls and only updating GPU state when necessary.
|
|
490
490
|
*/
|
|
491
491
|
private __renderInner;
|
|
492
|
-
/**
|
|
493
|
-
* Uploads the currentComponentSIDs uniform unless the same values were already uploaded to the
|
|
494
|
-
* same program by the previous upload. Uniform values persist in the program object, so
|
|
495
|
-
* consecutive draws of the same material (e.g. a shadow pass) do not need to upload again.
|
|
496
|
-
*/
|
|
497
492
|
/**
|
|
498
493
|
* Uploads the light cluster view of the camera of the draw (`u_lightClusterView`) when the program uses it and
|
|
499
494
|
* the camera or the light cluster data changed since the last upload to the program.
|
|
495
|
+
*
|
|
496
|
+
* The 7 vec4 are [header (6 vec4)][(view vec4 index, 0, 0, 0)], or a view index of -1 when the camera has no
|
|
497
|
+
* clusters. Uniform values persist in the program object, so consecutive draws of the same camera skip the
|
|
498
|
+
* upload; the check keeps the per-draw cost to a comparison in the common case.
|
|
500
499
|
*/
|
|
501
500
|
private __uploadLightClusterView;
|
|
501
|
+
/**
|
|
502
|
+
* Uploads the currentComponentSIDs uniform unless the same values were already uploaded to the
|
|
503
|
+
* same program by the previous upload. Uniform values persist in the program object, so
|
|
504
|
+
* consecutive draws of the same material (e.g. a shadow pass) do not need to upload again.
|
|
505
|
+
*/
|
|
502
506
|
private __uploadCurrentComponentSIDs;
|
|
503
507
|
/**
|
|
504
508
|
* Binds the data texture to the WebGL context for shader access.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Converts Float32 values to IEEE 754 half-float (Float16) bits.
|
|
3
|
+
*
|
|
4
|
+
* HDR textures are uploaded as half floats on devices without the optional
|
|
5
|
+
* `float32-filterable` feature (e.g. iOS Safari). There an `rgba32float` texture cannot be
|
|
6
|
+
* bound with the default `sampleType: 'float'` of the texture bind group layouts, so every
|
|
7
|
+
* draw using it is rejected. Filtering 16-bit float textures is core WebGPU, so half floats
|
|
8
|
+
* work everywhere.
|
|
9
|
+
*
|
|
10
|
+
* The conversion rounds to nearest, ties to even, and handles denormals, Infinity and NaN
|
|
11
|
+
* exactly like the platform `Float16Array` conversion.
|
|
12
|
+
*
|
|
13
|
+
* @param src - Float32 values
|
|
14
|
+
* @returns The same values encoded as half-float bits
|
|
15
|
+
*/
|
|
16
|
+
export declare function convertFloat32ToFloat16Bits(src: Float32Array): Uint16Array;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/** RGBA float rows packed for GPUQueue.copyBufferToTexture. */
|
|
2
|
+
export type PackedRgbaRows = {
|
|
3
|
+
/** Padded rows, ready to copy into a mapped GPUBuffer. */
|
|
4
|
+
data: Uint16Array | Float32Array;
|
|
5
|
+
/** `bytesPerRow` for the copy, padded to the 256-byte alignment WebGPU requires. */
|
|
6
|
+
bytesPerRow: number;
|
|
7
|
+
/** Number of array elements per row (row stride of `data`). */
|
|
8
|
+
elementsPerRow: number;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Packs tightly packed RGBA Float32 rows into the padded layout that
|
|
12
|
+
* GPUQueue.copyBufferToTexture requires.
|
|
13
|
+
*
|
|
14
|
+
* Rows must be padded to a multiple of 256 bytes. A row also has to be copied at
|
|
15
|
+
* `elementsPerRow` in the destination array (components per row, including padding),
|
|
16
|
+
* not at the number of texels in the row.
|
|
17
|
+
*
|
|
18
|
+
* @param src - Tightly packed RGBA Float32 pixel data
|
|
19
|
+
* @param width - Width in pixels
|
|
20
|
+
* @param height - Height in pixels
|
|
21
|
+
* @param isFloat16 - Encode as half floats instead of 32-bit floats
|
|
22
|
+
*/
|
|
23
|
+
export declare function packRgbaRowsForUpload(src: Float32Array, width: number, height: number, isFloat16: boolean): PackedRgbaRows;
|