@onerjs/core 8.51.3 → 8.51.5
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/Animations/animationGroup.d.ts +2 -1
- package/Animations/animationGroup.js +3 -2
- package/Animations/animationGroup.js.map +1 -1
- package/Animations/animatorAvatar.d.ts +2 -0
- package/Animations/animatorAvatar.js +163 -94
- package/Animations/animatorAvatar.js.map +1 -1
- package/Engines/WebGPU/webgpuSnapshotRendering.js +7 -3
- package/Engines/WebGPU/webgpuSnapshotRendering.js.map +1 -1
- package/Engines/constants.d.ts +10 -0
- package/Engines/constants.js +10 -0
- package/Engines/constants.js.map +1 -1
- package/Events/deviceInputEvents.d.ts +5 -0
- package/Events/deviceInputEvents.js.map +1 -1
- package/FlowGraph/Blocks/Data/flowGraphIsKeyPressedBlock.d.ts +65 -0
- package/FlowGraph/Blocks/Data/flowGraphIsKeyPressedBlock.js +74 -0
- package/FlowGraph/Blocks/Data/flowGraphIsKeyPressedBlock.js.map +1 -0
- package/FlowGraph/Blocks/Data/index.d.ts +1 -0
- package/FlowGraph/Blocks/Data/index.js +1 -0
- package/FlowGraph/Blocks/Data/index.js.map +1 -1
- package/FlowGraph/Blocks/Event/flowGraphKeyDownEventBlock.d.ts +39 -0
- package/FlowGraph/Blocks/Event/flowGraphKeyDownEventBlock.js +42 -0
- package/FlowGraph/Blocks/Event/flowGraphKeyDownEventBlock.js.map +1 -0
- package/FlowGraph/Blocks/Event/flowGraphKeyUpEventBlock.d.ts +19 -0
- package/FlowGraph/Blocks/Event/flowGraphKeyUpEventBlock.js +25 -0
- package/FlowGraph/Blocks/Event/flowGraphKeyUpEventBlock.js.map +1 -0
- package/FlowGraph/Blocks/Event/flowGraphKeyboardEventBlock.d.ts +64 -0
- package/FlowGraph/Blocks/Event/flowGraphKeyboardEventBlock.js +50 -0
- package/FlowGraph/Blocks/Event/flowGraphKeyboardEventBlock.js.map +1 -0
- package/FlowGraph/Blocks/Event/index.d.ts +3 -0
- package/FlowGraph/Blocks/Event/index.js +3 -0
- package/FlowGraph/Blocks/Event/index.js.map +1 -1
- package/FlowGraph/Blocks/flowGraphBlockFactory.js +7 -0
- package/FlowGraph/Blocks/flowGraphBlockFactory.js.map +1 -1
- package/FlowGraph/Blocks/flowGraphBlockNames.d.ts +3 -0
- package/FlowGraph/Blocks/flowGraphBlockNames.js +3 -0
- package/FlowGraph/Blocks/flowGraphBlockNames.js.map +1 -1
- package/FlowGraph/flowGraph.d.ts +6 -0
- package/FlowGraph/flowGraph.js +10 -1
- package/FlowGraph/flowGraph.js.map +1 -1
- package/FlowGraph/flowGraphContext.d.ts +8 -0
- package/FlowGraph/flowGraphContext.js.map +1 -1
- package/FlowGraph/flowGraphEventType.d.ts +2 -0
- package/FlowGraph/flowGraphEventType.js +2 -0
- package/FlowGraph/flowGraphEventType.js.map +1 -1
- package/FlowGraph/flowGraphSceneEventCoordinator.d.ts +14 -0
- package/FlowGraph/flowGraphSceneEventCoordinator.js +56 -0
- package/FlowGraph/flowGraphSceneEventCoordinator.js.map +1 -1
- package/FlowGraph/utils.d.ts +7 -0
- package/FlowGraph/utils.js +8 -0
- package/FlowGraph/utils.js.map +1 -1
- package/Materials/GaussianSplatting/gaussianSplattingMaterial.js +6 -0
- package/Materials/GaussianSplatting/gaussianSplattingMaterial.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/perturbNormalBlock.js +6 -3
- package/Materials/Node/Blocks/Fragment/perturbNormalBlock.js.map +1 -1
- package/Materials/PBR/openpbrMaterial.d.ts +8 -0
- package/Materials/PBR/openpbrMaterial.js +16 -0
- package/Materials/PBR/openpbrMaterial.js.map +1 -1
- package/Materials/PBR/pbrBaseMaterial.d.ts +1 -0
- package/Materials/PBR/pbrBaseMaterial.js +8 -0
- package/Materials/PBR/pbrBaseMaterial.js.map +1 -1
- package/Materials/Textures/Procedurals/proceduralTexture.d.ts +6 -0
- package/Materials/Textures/Procedurals/proceduralTexture.js +3 -1
- package/Materials/Textures/Procedurals/proceduralTexture.js.map +1 -1
- package/Materials/Textures/index.d.ts +1 -0
- package/Materials/Textures/index.js +1 -0
- package/Materials/Textures/index.js.map +1 -1
- package/Materials/Textures/textureMerger.js +1 -0
- package/Materials/Textures/textureMerger.js.map +1 -1
- package/Materials/Textures/textureProcessor.d.ts +315 -0
- package/Materials/Textures/textureProcessor.js +792 -0
- package/Materials/Textures/textureProcessor.js.map +1 -0
- package/Materials/material.d.ts +24 -0
- package/Materials/material.js +39 -0
- package/Materials/material.js.map +1 -1
- package/Materials/standardMaterial.d.ts +1 -0
- package/Materials/standardMaterial.js +6 -0
- package/Materials/standardMaterial.js.map +1 -1
- package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.js +30 -8
- package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.js.map +1 -1
- package/Misc/snapshotRenderingHelper.d.ts +4 -2
- package/Misc/snapshotRenderingHelper.js +33 -22
- package/Misc/snapshotRenderingHelper.js.map +1 -1
- package/Particles/thinParticleSystem.d.ts +6 -1
- package/Particles/thinParticleSystem.js +23 -6
- package/Particles/thinParticleSystem.js.map +1 -1
- package/Physics/v2/characterController.d.ts +104 -7
- package/Physics/v2/characterController.js +355 -7
- package/Physics/v2/characterController.js.map +1 -1
- package/Shaders/ShadersInclude/bumpFragment.js +3 -3
- package/Shaders/ShadersInclude/bumpFragment.js.map +1 -1
- package/Shaders/ShadersInclude/bumpFragmentMainFunctions.js +5 -1
- package/Shaders/ShadersInclude/bumpFragmentMainFunctions.js.map +1 -1
- package/Shaders/ShadersInclude/defaultFragmentDeclaration.js +3 -0
- package/Shaders/ShadersInclude/defaultFragmentDeclaration.js.map +1 -1
- package/Shaders/ShadersInclude/defaultUboDeclaration.js +1 -1
- package/Shaders/ShadersInclude/defaultUboDeclaration.js.map +1 -1
- package/Shaders/ShadersInclude/defaultVertexDeclaration.js +1 -1
- package/Shaders/ShadersInclude/defaultVertexDeclaration.js.map +1 -1
- package/Shaders/ShadersInclude/openpbrAmbientOcclusionData.js +1 -1
- package/Shaders/ShadersInclude/openpbrAmbientOcclusionData.js.map +1 -1
- package/Shaders/ShadersInclude/openpbrBackgroundTransmission.js +1 -1
- package/Shaders/ShadersInclude/openpbrBackgroundTransmission.js.map +1 -1
- package/Shaders/ShadersInclude/openpbrBaseLayerData.js +14 -14
- package/Shaders/ShadersInclude/openpbrBaseLayerData.js.map +1 -1
- package/Shaders/ShadersInclude/openpbrCoatLayerData.js +6 -6
- package/Shaders/ShadersInclude/openpbrCoatLayerData.js.map +1 -1
- package/Shaders/ShadersInclude/openpbrDirectLighting.js +1 -1
- package/Shaders/ShadersInclude/openpbrDirectLighting.js.map +1 -1
- package/Shaders/ShadersInclude/openpbrEnvironmentLighting.js +1 -1
- package/Shaders/ShadersInclude/openpbrEnvironmentLighting.js.map +1 -1
- package/Shaders/ShadersInclude/openpbrFragmentDeclaration.js +3 -0
- package/Shaders/ShadersInclude/openpbrFragmentDeclaration.js.map +1 -1
- package/Shaders/ShadersInclude/openpbrFuzzLayerData.js +3 -3
- package/Shaders/ShadersInclude/openpbrFuzzLayerData.js.map +1 -1
- package/Shaders/ShadersInclude/openpbrNormalMapFragment.js +4 -4
- package/Shaders/ShadersInclude/openpbrNormalMapFragment.js.map +1 -1
- package/Shaders/ShadersInclude/openpbrSubsurfaceLayerData.js +7 -3
- package/Shaders/ShadersInclude/openpbrSubsurfaceLayerData.js.map +1 -1
- package/Shaders/ShadersInclude/openpbrThinFilmLayerData.js +2 -2
- package/Shaders/ShadersInclude/openpbrThinFilmLayerData.js.map +1 -1
- package/Shaders/ShadersInclude/openpbrTransmissionLayerData.js +5 -5
- package/Shaders/ShadersInclude/openpbrTransmissionLayerData.js.map +1 -1
- package/Shaders/ShadersInclude/openpbrUboDeclaration.js +1 -1
- package/Shaders/ShadersInclude/openpbrUboDeclaration.js.map +1 -1
- package/Shaders/ShadersInclude/openpbrVertexDeclaration.js +1 -1
- package/Shaders/ShadersInclude/openpbrVertexDeclaration.js.map +1 -1
- package/Shaders/ShadersInclude/pbrBlockFinalUnlitComponents.js +1 -1
- package/Shaders/ShadersInclude/pbrBlockFinalUnlitComponents.js.map +1 -1
- package/Shaders/ShadersInclude/pbrBlockLightmapInit.js +1 -1
- package/Shaders/ShadersInclude/pbrBlockLightmapInit.js.map +1 -1
- package/Shaders/ShadersInclude/pbrFragmentDeclaration.js +3 -0
- package/Shaders/ShadersInclude/pbrFragmentDeclaration.js.map +1 -1
- package/Shaders/ShadersInclude/pbrHelperFunctions.js +4 -0
- package/Shaders/ShadersInclude/pbrHelperFunctions.js.map +1 -1
- package/Shaders/ShadersInclude/pbrUboDeclaration.js +1 -1
- package/Shaders/ShadersInclude/pbrUboDeclaration.js.map +1 -1
- package/Shaders/ShadersInclude/pbrVertexDeclaration.js +1 -1
- package/Shaders/ShadersInclude/pbrVertexDeclaration.js.map +1 -1
- package/Shaders/ShadersInclude/textureRepetitionFunctions.d.ts +5 -0
- package/Shaders/ShadersInclude/textureRepetitionFunctions.js +52 -0
- package/Shaders/ShadersInclude/textureRepetitionFunctions.js.map +1 -0
- package/Shaders/default.fragment.d.ts +1 -0
- package/Shaders/default.fragment.js +8 -6
- package/Shaders/default.fragment.js.map +1 -1
- package/Shaders/geometry.fragment.js +3 -3
- package/Shaders/geometry.fragment.js.map +1 -1
- package/Shaders/openpbr.fragment.d.ts +1 -0
- package/Shaders/openpbr.fragment.js +4 -2
- package/Shaders/openpbr.fragment.js.map +1 -1
- package/Shaders/pbr.fragment.d.ts +1 -0
- package/Shaders/pbr.fragment.js +24 -22
- package/Shaders/pbr.fragment.js.map +1 -1
- package/Shaders/textureProcessor.fragment.d.ts +5 -0
- package/Shaders/textureProcessor.fragment.js +156 -0
- package/Shaders/textureProcessor.fragment.js.map +1 -0
- package/ShadersWGSL/ShadersInclude/bumpFragment.js +3 -3
- package/ShadersWGSL/ShadersInclude/bumpFragment.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/bumpFragmentMainFunctions.js +5 -1
- package/ShadersWGSL/ShadersInclude/bumpFragmentMainFunctions.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/defaultUboDeclaration.js +1 -1
- package/ShadersWGSL/ShadersInclude/defaultUboDeclaration.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/openpbrAmbientOcclusionData.js +1 -1
- package/ShadersWGSL/ShadersInclude/openpbrAmbientOcclusionData.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/openpbrBackgroundTransmission.js +1 -1
- package/ShadersWGSL/ShadersInclude/openpbrBackgroundTransmission.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/openpbrBaseLayerData.js +15 -15
- package/ShadersWGSL/ShadersInclude/openpbrBaseLayerData.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/openpbrCoatLayerData.js +7 -7
- package/ShadersWGSL/ShadersInclude/openpbrCoatLayerData.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/openpbrDirectLighting.js +1 -1
- package/ShadersWGSL/ShadersInclude/openpbrDirectLighting.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/openpbrEnvironmentLighting.js +1 -1
- package/ShadersWGSL/ShadersInclude/openpbrEnvironmentLighting.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/openpbrFuzzLayerData.js +4 -4
- package/ShadersWGSL/ShadersInclude/openpbrFuzzLayerData.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/openpbrIblFunctions.js +3 -3
- package/ShadersWGSL/ShadersInclude/openpbrIblFunctions.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/openpbrNormalMapFragment.js +4 -4
- package/ShadersWGSL/ShadersInclude/openpbrNormalMapFragment.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/openpbrSubsurfaceLayerData.js +7 -3
- package/ShadersWGSL/ShadersInclude/openpbrSubsurfaceLayerData.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/openpbrThinFilmLayerData.js +2 -2
- package/ShadersWGSL/ShadersInclude/openpbrThinFilmLayerData.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/openpbrTransmissionLayerData.js +6 -6
- package/ShadersWGSL/ShadersInclude/openpbrTransmissionLayerData.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/openpbrUboDeclaration.js +1 -1
- package/ShadersWGSL/ShadersInclude/openpbrUboDeclaration.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/pbrBlockFinalUnlitComponents.js +1 -1
- package/ShadersWGSL/ShadersInclude/pbrBlockFinalUnlitComponents.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/pbrBlockLightmapInit.js +1 -1
- package/ShadersWGSL/ShadersInclude/pbrBlockLightmapInit.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/pbrHelperFunctions.js +4 -0
- package/ShadersWGSL/ShadersInclude/pbrHelperFunctions.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/pbrUboDeclaration.js +1 -1
- package/ShadersWGSL/ShadersInclude/pbrUboDeclaration.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/textureRepetitionFunctions.d.ts +5 -0
- package/ShadersWGSL/ShadersInclude/textureRepetitionFunctions.js +52 -0
- package/ShadersWGSL/ShadersInclude/textureRepetitionFunctions.js.map +1 -0
- package/ShadersWGSL/default.fragment.d.ts +1 -0
- package/ShadersWGSL/default.fragment.js +8 -6
- package/ShadersWGSL/default.fragment.js.map +1 -1
- package/ShadersWGSL/geometry.fragment.js +3 -3
- package/ShadersWGSL/geometry.fragment.js.map +1 -1
- package/ShadersWGSL/openpbr.fragment.d.ts +1 -0
- package/ShadersWGSL/openpbr.fragment.js +5 -3
- package/ShadersWGSL/openpbr.fragment.js.map +1 -1
- package/ShadersWGSL/openpbr.vertex.js +1 -1
- package/ShadersWGSL/openpbr.vertex.js.map +1 -1
- package/ShadersWGSL/pbr.fragment.d.ts +1 -0
- package/ShadersWGSL/pbr.fragment.js +24 -22
- package/ShadersWGSL/pbr.fragment.js.map +1 -1
- package/ShadersWGSL/textureProcessor.fragment.d.ts +5 -0
- package/ShadersWGSL/textureProcessor.fragment.js +161 -0
- package/ShadersWGSL/textureProcessor.fragment.js.map +1 -0
- package/SmartAssets/index.d.ts +2 -0
- package/SmartAssets/index.js +2 -0
- package/SmartAssets/index.js.map +1 -0
- package/SmartAssets/smartAssetManager.d.ts +156 -0
- package/SmartAssets/smartAssetManager.js +531 -0
- package/SmartAssets/smartAssetManager.js.map +1 -0
- package/SmartAssets/smartAssetSerializer.d.ts +61 -0
- package/SmartAssets/smartAssetSerializer.js +97 -0
- package/SmartAssets/smartAssetSerializer.js.map +1 -0
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,315 @@
|
|
|
1
|
+
import { type Scene } from "../../scene.js";
|
|
2
|
+
import { type BaseTexture } from "./baseTexture.js";
|
|
3
|
+
import { type Nullable } from "../../types.js";
|
|
4
|
+
import { Color4 } from "../../Maths/math.color.js";
|
|
5
|
+
/**
|
|
6
|
+
* Specifies the color space of a texture operand.
|
|
7
|
+
* When `sRGB` is set the sampled RGB values are converted to linear space before any channel
|
|
8
|
+
* swizzle, factor multiplication, or arithmetic operation. Alpha is always treated as linear.
|
|
9
|
+
*/
|
|
10
|
+
export declare enum TextureColorSpace {
|
|
11
|
+
/** Texture data is already in linear space (default). No conversion applied. */
|
|
12
|
+
Linear = 0,
|
|
13
|
+
/** Texture data is in sRGB (gamma) space. RGB channels are linearized (IEC 61966-2-1) before use. */
|
|
14
|
+
SRGB = 1
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Bitmask controlling which channels are written to the output texture by a processing operation.
|
|
18
|
+
* Channels excluded from the mask receive a sensible default: `0.0` for RGB channels, `1.0` for alpha.
|
|
19
|
+
* Use `ChannelMask.RGBA` (or omit the parameter) to pass all channels through unchanged.
|
|
20
|
+
*
|
|
21
|
+
* | Flag | Channels written | Excluded channels |
|
|
22
|
+
* |------|-----------------|-------------------|
|
|
23
|
+
* | R | red | G=0, B=0, A=1 |
|
|
24
|
+
* | G | green | R=0, B=0, A=1 |
|
|
25
|
+
* | B | blue | R=0, G=0, A=1 |
|
|
26
|
+
* | A | alpha | R=0, G=0, B=0 |
|
|
27
|
+
* | RGB | red, green, blue | A=1 |
|
|
28
|
+
* | RGBA | all four | (none) |
|
|
29
|
+
*/
|
|
30
|
+
export declare enum ChannelMask {
|
|
31
|
+
/** Pass only the red channel; G=0, B=0, A=1. */
|
|
32
|
+
R = 1,
|
|
33
|
+
/** Pass only the green channel; R=0, B=0, A=1. */
|
|
34
|
+
G = 2,
|
|
35
|
+
/** Pass only the blue channel; R=0, G=0, A=1. */
|
|
36
|
+
B = 4,
|
|
37
|
+
/** Pass only the alpha channel; R=0, G=0, B=0. */
|
|
38
|
+
A = 8,
|
|
39
|
+
/** Pass red, green, and blue; alpha is forced to 1.0. */
|
|
40
|
+
RGB = 7,
|
|
41
|
+
/** Pass all four channels unchanged (default — no masking). */
|
|
42
|
+
RGBA = 15
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Specifies which channel of a texture to read for an operation.
|
|
46
|
+
* When a single channel is selected its scalar value is broadcast to RGB; alpha
|
|
47
|
+
* is either preserved from the original sample or replicated when `A` is chosen.
|
|
48
|
+
*
|
|
49
|
+
* | Value | Swizzle |
|
|
50
|
+
* |-------|---------|
|
|
51
|
+
* | RGBA | (r, g, b, a) — no swizzle (default) |
|
|
52
|
+
* | R | (r, r, r, a) |
|
|
53
|
+
* | G | (g, g, g, a) |
|
|
54
|
+
* | B | (b, b, b, a) |
|
|
55
|
+
* | A | (a, a, a, a) |
|
|
56
|
+
*/
|
|
57
|
+
export declare enum TextureChannel {
|
|
58
|
+
/** Use all four channels as sampled (default). */
|
|
59
|
+
RGBA = 0,
|
|
60
|
+
/** Broadcast the red channel to RGB; preserve alpha: RRRA. */
|
|
61
|
+
R = 1,
|
|
62
|
+
/** Broadcast the green channel to RGB; preserve alpha: GGGA. */
|
|
63
|
+
G = 2,
|
|
64
|
+
/** Broadcast the blue channel to RGB; preserve alpha: BBBA. */
|
|
65
|
+
B = 3,
|
|
66
|
+
/** Broadcast the alpha channel to all four components: AAAA. */
|
|
67
|
+
A = 4
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Represents an operand for a texture processing operation, or the result of one.
|
|
71
|
+
*
|
|
72
|
+
* As an operand, the value evaluates to a vec4 per texel:
|
|
73
|
+
* - `texture` only → `sample(texture)`
|
|
74
|
+
* - `factor` only → `factor` (constant)
|
|
75
|
+
* - both → `sample(texture) * factor`
|
|
76
|
+
*
|
|
77
|
+
* As a result returned by a processing function:
|
|
78
|
+
* - `texture` holds the GPU-processed output; `dispose()` releases it when no longer needed.
|
|
79
|
+
* - `factor` holds a CPU-folded constant when all inputs were texture-free; no `dispose` is set.
|
|
80
|
+
*
|
|
81
|
+
* Results are directly usable as operands to subsequent operations. When a result with a
|
|
82
|
+
* `dispose` function is passed as an operand, the next operation automatically calls `dispose`
|
|
83
|
+
* after consuming it, so intermediate textures are cleaned up without manual tracking.
|
|
84
|
+
*
|
|
85
|
+
* At least one of `texture` or `factor` must be provided when used as an operand.
|
|
86
|
+
*/
|
|
87
|
+
export interface ITextureProcessOperand {
|
|
88
|
+
/**
|
|
89
|
+
* Texture to sample. When combined with `factor`, the sampled value is multiplied
|
|
90
|
+
* component-wise by the factor. Null when the operand or result is a constant.
|
|
91
|
+
*/
|
|
92
|
+
texture: Nullable<BaseTexture>;
|
|
93
|
+
/**
|
|
94
|
+
* Optional constant RGBA factor. If `texture` is also set, the sampled value is
|
|
95
|
+
* multiplied by this factor. If `texture` is not set, this becomes the constant output.
|
|
96
|
+
* When omitted and `texture` is set, defaults to (1, 1, 1, 1) — no scaling.
|
|
97
|
+
*/
|
|
98
|
+
factor?: Color4;
|
|
99
|
+
/**
|
|
100
|
+
* Optional channel selection applied to the sampled texture value before any factor
|
|
101
|
+
* multiplication. When omitted or set to `TextureChannel.RGBA`, the sample is used
|
|
102
|
+
* as-is. When set to a single channel, that channel's scalar is broadcast to RGB
|
|
103
|
+
* (or all four components for `TextureChannel.A`). Only meaningful when `texture` is set.
|
|
104
|
+
*/
|
|
105
|
+
channel?: TextureChannel;
|
|
106
|
+
/**
|
|
107
|
+
* Color space of the texture data. When set to `TextureColorSpace.SRGB`, the sampled
|
|
108
|
+
* RGB channels are converted from sRGB to linear space (IEC 61966-2-1) before the channel
|
|
109
|
+
* swizzle, factor multiplication, and any arithmetic operation. Alpha is always linear.
|
|
110
|
+
* Defaults to `TextureColorSpace.Linear` (no conversion). Only meaningful when `texture` is set.
|
|
111
|
+
*/
|
|
112
|
+
colorSpace?: TextureColorSpace;
|
|
113
|
+
/**
|
|
114
|
+
* Disposes the texture produced by a processing operation. Only present on results
|
|
115
|
+
* returned by the texture processing functions. When a result is passed as an operand
|
|
116
|
+
* to the next operation in a chain, its `dispose` is called automatically after the
|
|
117
|
+
* GPU pass completes. Call `dispose` explicitly on the final result when the texture
|
|
118
|
+
* is no longer needed (or skip it if transferring ownership to a material).
|
|
119
|
+
*/
|
|
120
|
+
dispose?: () => void;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Create an operand from a texture alone (no constant factor scaling).
|
|
124
|
+
* @param texture - The texture to sample, or null to produce an identity (1,1,1,1) constant operand
|
|
125
|
+
* @param channel - Optional channel selection. When set, the sampled value is swizzled before use
|
|
126
|
+
* (e.g. `TextureChannel.R` → RRRA). Defaults to `TextureChannel.RGBA` (no swizzle).
|
|
127
|
+
* @param colorSpace - Optional color space. When `TextureColorSpace.SRGB`, the sampled RGB channels
|
|
128
|
+
* are linearized before use. Defaults to `TextureColorSpace.Linear`.
|
|
129
|
+
* @returns An operand that evaluates to the sampled texture value
|
|
130
|
+
*/
|
|
131
|
+
export declare function CreateTextureOperand(texture: Nullable<BaseTexture>, channel?: TextureChannel, colorSpace?: TextureColorSpace): ITextureProcessOperand;
|
|
132
|
+
/**
|
|
133
|
+
* Create an operand from a constant RGBA factor with no texture.
|
|
134
|
+
* @param factor - The constant RGBA value
|
|
135
|
+
* @returns An operand that evaluates to the constant factor
|
|
136
|
+
*/
|
|
137
|
+
export declare function CreateFactorOperand(factor: Color4): ITextureProcessOperand;
|
|
138
|
+
/**
|
|
139
|
+
* Create an operand from a texture multiplied by a constant RGBA factor.
|
|
140
|
+
* This is the standard glTF pattern (e.g. baseColorTexture * baseColorFactor).
|
|
141
|
+
* If `texture` is null, returns a factor-only operand.
|
|
142
|
+
* @param texture - The texture to sample, or null to use the factor alone
|
|
143
|
+
* @param factor - The constant factor to multiply by
|
|
144
|
+
* @param channel - Optional channel selection. When set, the sampled value is swizzled before
|
|
145
|
+
* factor multiplication (e.g. `TextureChannel.G` → GGGA, then multiplied by factor).
|
|
146
|
+
* Defaults to `TextureChannel.RGBA` (no swizzle).
|
|
147
|
+
* @param colorSpace - Optional color space. When `TextureColorSpace.SRGB`, the sampled RGB channels
|
|
148
|
+
* are linearized before factor multiplication. Defaults to `TextureColorSpace.Linear`.
|
|
149
|
+
* @returns An operand that evaluates to `sample(texture) * factor`, or `factor` if texture is null
|
|
150
|
+
*/
|
|
151
|
+
export declare function CreateTextureWithFactorOperand(texture: Nullable<BaseTexture>, factor: Color4, channel?: TextureChannel, colorSpace?: TextureColorSpace): ITextureProcessOperand;
|
|
152
|
+
/**
|
|
153
|
+
* Multiply two texture operands together, component-wise: `result = a * b`.
|
|
154
|
+
*
|
|
155
|
+
* Each operand can be a texture, a constant factor, or a texture scaled by a factor.
|
|
156
|
+
* This is useful for applying glTF-style factors to textures (e.g. `baseColorTexture * baseColorFactor`),
|
|
157
|
+
* or for modulating one texture by another.
|
|
158
|
+
*
|
|
159
|
+
* If both operands are constant (no textures), the multiplication is performed on the CPU and
|
|
160
|
+
* the result is returned as a factor-only operand with no texture allocated.
|
|
161
|
+
*
|
|
162
|
+
* When operands are results of previous operations (i.e. they carry a `dispose` function),
|
|
163
|
+
* their intermediate textures are automatically released after the GPU pass completes.
|
|
164
|
+
*
|
|
165
|
+
* @param name - Name for the resulting procedural texture (used only when a GPU pass is needed)
|
|
166
|
+
* @param a - First operand
|
|
167
|
+
* @param b - Second operand
|
|
168
|
+
* @param scene - Scene to create the texture in (used only when a GPU pass is needed)
|
|
169
|
+
* @param outputColorSpace - Optional output color space. When `TextureColorSpace.SRGB`, the linear
|
|
170
|
+
* result is converted to sRGB (IEC 61966-2-1) before being written. Defaults to `TextureColorSpace.Linear`.
|
|
171
|
+
* @param outputChannelMask - Optional bitmask of channels to write. Excluded color channels are set to
|
|
172
|
+
* `0.0`; excluded alpha is set to `1.0`. Defaults to `ChannelMask.RGBA` (all channels written).
|
|
173
|
+
* @returns An operand whose `texture` holds the GPU result, or whose `factor` holds the CPU-folded constant
|
|
174
|
+
*/
|
|
175
|
+
export declare function MultiplyTexturesAsync(name: string, a: ITextureProcessOperand, b: ITextureProcessOperand, scene: Scene, outputColorSpace?: TextureColorSpace, outputChannelMask?: ChannelMask): Promise<ITextureProcessOperand>;
|
|
176
|
+
/**
|
|
177
|
+
* Take the component-wise maximum of two texture operands: `result = max(a, b)`.
|
|
178
|
+
*
|
|
179
|
+
* Each operand can be a texture, a constant factor, or a texture scaled by a factor.
|
|
180
|
+
* Useful for operations such as combining ambient occlusion maps or taking the
|
|
181
|
+
* brightest contribution from two sources.
|
|
182
|
+
*
|
|
183
|
+
* If both operands are constant (no textures), the operation is performed on the CPU and
|
|
184
|
+
* the result is returned as a factor-only operand with no texture allocated.
|
|
185
|
+
*
|
|
186
|
+
* When operands are results of previous operations (i.e. they carry a `dispose` function),
|
|
187
|
+
* their intermediate textures are automatically released after the GPU pass completes.
|
|
188
|
+
*
|
|
189
|
+
* @param name - Name for the resulting procedural texture (used only when a GPU pass is needed)
|
|
190
|
+
* @param a - First operand
|
|
191
|
+
* @param b - Second operand
|
|
192
|
+
* @param scene - Scene to create the texture in (used only when a GPU pass is needed)
|
|
193
|
+
* @param outputColorSpace - Optional output color space. When `TextureColorSpace.SRGB`, the linear
|
|
194
|
+
* result is converted to sRGB (IEC 61966-2-1) before being written. Defaults to `TextureColorSpace.Linear`.
|
|
195
|
+
* @param outputChannelMask - Optional bitmask of channels to write. Excluded color channels are set to
|
|
196
|
+
* `0.0`; excluded alpha is set to `1.0`. Defaults to `ChannelMask.RGBA` (all channels written).
|
|
197
|
+
* @returns An operand whose `texture` holds the GPU result, or whose `factor` holds the CPU-folded constant
|
|
198
|
+
*/
|
|
199
|
+
export declare function MaxTexturesAsync(name: string, a: ITextureProcessOperand, b: ITextureProcessOperand, scene: Scene, outputColorSpace?: TextureColorSpace, outputChannelMask?: ChannelMask): Promise<ITextureProcessOperand>;
|
|
200
|
+
/**
|
|
201
|
+
* Linearly interpolate between two texture operands: `result = mix(a, b, t)`.
|
|
202
|
+
*
|
|
203
|
+
* Each operand can be a texture, a constant factor, or a texture scaled by a factor.
|
|
204
|
+
* The `t` operand controls the blend weight per texel, per channel — a value of 0 returns `a`,
|
|
205
|
+
* a value of 1 returns `b`. Use a grayscale texture or a scalar `Color4(v, v, v, v)` for
|
|
206
|
+
* uniform blending across all channels.
|
|
207
|
+
*
|
|
208
|
+
* If all three operands are constant (no textures), the interpolation is performed on the CPU and
|
|
209
|
+
* the result is returned as a factor-only operand with no texture allocated.
|
|
210
|
+
*
|
|
211
|
+
* When operands are results of previous operations (i.e. they carry a `dispose` function),
|
|
212
|
+
* their intermediate textures are automatically released after the GPU pass completes.
|
|
213
|
+
*
|
|
214
|
+
* @param name - Name for the resulting procedural texture (used only when a GPU pass is needed)
|
|
215
|
+
* @param a - Start value operand (returned when t = 0)
|
|
216
|
+
* @param b - End value operand (returned when t = 1)
|
|
217
|
+
* @param t - Blend weight operand. Each channel independently controls the blend for the corresponding output channel.
|
|
218
|
+
* @param scene - Scene to create the texture in (used only when a GPU pass is needed)
|
|
219
|
+
* @param outputColorSpace - Optional output color space. When `TextureColorSpace.SRGB`, the linear
|
|
220
|
+
* result is converted to sRGB (IEC 61966-2-1) before being written. Defaults to `TextureColorSpace.Linear`.
|
|
221
|
+
* @param outputChannelMask - Optional bitmask of channels to write. Excluded color channels are set to
|
|
222
|
+
* `0.0`; excluded alpha is set to `1.0`. Defaults to `ChannelMask.RGBA` (all channels written).
|
|
223
|
+
* @returns An operand whose `texture` holds the GPU result, or whose `factor` holds the CPU-folded constant
|
|
224
|
+
*/
|
|
225
|
+
export declare function LerpTexturesAsync(name: string, a: ITextureProcessOperand, b: ITextureProcessOperand, t: ITextureProcessOperand, scene: Scene, outputColorSpace?: TextureColorSpace, outputChannelMask?: ChannelMask): Promise<ITextureProcessOperand>;
|
|
226
|
+
/**
|
|
227
|
+
* Invert selected channels of a texture operand: `result[ch] = 1 - input[ch]`.
|
|
228
|
+
*
|
|
229
|
+
* The `channels` bitmask selects which channels are inverted; unselected channels pass through
|
|
230
|
+
* unchanged. Use `ChannelMask.RGB` for the common roughness↔smoothness conversion, or
|
|
231
|
+
* `ChannelMask.RGBA` (the default) to invert the entire texture.
|
|
232
|
+
*
|
|
233
|
+
* This is a unary operation — only operand A is used. Any `colorSpace` or `channel` properties
|
|
234
|
+
* on the input operand are honoured (sRGB linearization and channel swizzle applied before
|
|
235
|
+
* the invert).
|
|
236
|
+
*
|
|
237
|
+
* If the input is constant (no texture), the invert is performed on the CPU.
|
|
238
|
+
*
|
|
239
|
+
* When the input is the result of a previous operation (i.e. it carries a `dispose` function),
|
|
240
|
+
* its intermediate texture is automatically released after the GPU pass completes.
|
|
241
|
+
*
|
|
242
|
+
* @param name - Name for the resulting procedural texture (used only when a GPU pass is needed)
|
|
243
|
+
* @param input - Operand to invert
|
|
244
|
+
* @param scene - Scene to create the texture in (used only when a GPU pass is needed)
|
|
245
|
+
* @param channels - Bitmask of channels to invert. Defaults to `ChannelMask.RGBA`.
|
|
246
|
+
* @param outputColorSpace - Optional output color space. When `TextureColorSpace.SRGB`, the linear
|
|
247
|
+
* result is converted to sRGB (IEC 61966-2-1) before being written. Defaults to `TextureColorSpace.Linear`.
|
|
248
|
+
* @param outputChannelMask - Optional bitmask of channels to write. Excluded color channels are set to
|
|
249
|
+
* `0.0`; excluded alpha is set to `1.0`. Defaults to `ChannelMask.RGBA` (all channels written).
|
|
250
|
+
* @returns An operand whose `texture` holds the GPU result, or whose `factor` holds the CPU-folded constant
|
|
251
|
+
*/
|
|
252
|
+
export declare function InvertTextureAsync(name: string, input: ITextureProcessOperand, scene: Scene, channels?: ChannelMask, outputColorSpace?: TextureColorSpace, outputChannelMask?: ChannelMask): Promise<ITextureProcessOperand>;
|
|
253
|
+
/**
|
|
254
|
+
* Extract the per-texel maximum channel value from a texture and broadcast it to all output
|
|
255
|
+
* channels, producing a single-value (greyscale) texture in a single GPU pass.
|
|
256
|
+
*
|
|
257
|
+
* For each texel, computes `max(r, g, b)` — or `max(r, g, b, a)` when `includeAlpha` is true —
|
|
258
|
+
* and writes that scalar to the output:
|
|
259
|
+
* - `includeAlpha = false` (default): output is `(m, m, m, a)` where `m = max(r, g, b)`
|
|
260
|
+
* - `includeAlpha = true`: output is `(m, m, m, m)` where `m = max(r, g, b, a)`
|
|
261
|
+
*
|
|
262
|
+
* This is more efficient than chaining `ExtractChannelAsync` calls through `MaxTexturesAsync`,
|
|
263
|
+
* which would require multiple intermediate textures and GPU passes.
|
|
264
|
+
*
|
|
265
|
+
* Any `colorSpace` or `channel` properties on the input operand are honoured (sRGB linearization
|
|
266
|
+
* and channel swizzle applied before the max reduction).
|
|
267
|
+
*
|
|
268
|
+
* If the input is constant (no texture), the reduction is performed on the CPU.
|
|
269
|
+
*
|
|
270
|
+
* When the input is the result of a previous operation (i.e. it carries a `dispose` function),
|
|
271
|
+
* its intermediate texture is automatically released after the GPU pass completes.
|
|
272
|
+
*
|
|
273
|
+
* @param name - Name for the resulting procedural texture (used only when a GPU pass is needed)
|
|
274
|
+
* @param input - Operand to reduce
|
|
275
|
+
* @param scene - Scene to create the texture in (used only when a GPU pass is needed)
|
|
276
|
+
* @param includeAlpha - When true, alpha participates in the max and is also set to the result.
|
|
277
|
+
* Defaults to false (alpha is preserved from the input).
|
|
278
|
+
* @param outputColorSpace - Optional output color space. When `TextureColorSpace.SRGB`, the linear
|
|
279
|
+
* result is converted to sRGB (IEC 61966-2-1) before being written. Defaults to `TextureColorSpace.Linear`.
|
|
280
|
+
* @param outputChannelMask - Optional bitmask of channels to write. Excluded color channels are set to
|
|
281
|
+
* `0.0`; excluded alpha is set to `1.0`. Defaults to `ChannelMask.RGBA` (all channels written).
|
|
282
|
+
* @returns An operand whose `texture` holds the GPU result, or whose `factor` holds the CPU-folded constant
|
|
283
|
+
*/
|
|
284
|
+
export declare function ExtractMaxChannelAsync(name: string, input: ITextureProcessOperand, scene: Scene, includeAlpha?: boolean, outputColorSpace?: TextureColorSpace, outputChannelMask?: ChannelMask): Promise<ITextureProcessOperand>;
|
|
285
|
+
/**
|
|
286
|
+
* Extract a single channel from a texture and broadcast it to RGB (or all four components for
|
|
287
|
+
* `TextureChannel.A`), producing a new texture. This is a convenience wrapper over
|
|
288
|
+
* `MultiplyTexturesAsync` with a `(1,1,1,1)` factor and the requested channel swizzle applied
|
|
289
|
+
* to the input.
|
|
290
|
+
*
|
|
291
|
+
* Swizzle results per channel:
|
|
292
|
+
* - `TextureChannel.R` → (r, r, r, a)
|
|
293
|
+
* - `TextureChannel.G` → (g, g, g, a)
|
|
294
|
+
* - `TextureChannel.B` → (b, b, b, a)
|
|
295
|
+
* - `TextureChannel.A` → (a, a, a, a)
|
|
296
|
+
*
|
|
297
|
+
* If the input is constant (no texture), the swizzle is applied on the CPU.
|
|
298
|
+
*
|
|
299
|
+
* Any `colorSpace` property on the input operand is honoured (sRGB linearization applied before
|
|
300
|
+
* the swizzle). Any existing `channel` on the input is replaced by the `channel` argument.
|
|
301
|
+
*
|
|
302
|
+
* When the input is the result of a previous operation (i.e. it carries a `dispose` function),
|
|
303
|
+
* its intermediate texture is automatically released after the GPU pass completes.
|
|
304
|
+
*
|
|
305
|
+
* @param name - Name for the resulting procedural texture (used only when a GPU pass is needed)
|
|
306
|
+
* @param input - Operand to extract the channel from
|
|
307
|
+
* @param channel - The channel to extract and broadcast
|
|
308
|
+
* @param scene - Scene to create the texture in (used only when a GPU pass is needed)
|
|
309
|
+
* @param outputColorSpace - Optional output color space. When `TextureColorSpace.SRGB`, the linear
|
|
310
|
+
* result is converted to sRGB (IEC 61966-2-1) before being written. Defaults to `TextureColorSpace.Linear`.
|
|
311
|
+
* @param outputChannelMask - Optional bitmask of channels to write. Excluded color channels are set to
|
|
312
|
+
* `0.0`; excluded alpha is set to `1.0`. Defaults to `ChannelMask.RGBA` (all channels written).
|
|
313
|
+
* @returns An operand whose `texture` holds the GPU result, or whose `factor` holds the CPU-folded constant
|
|
314
|
+
*/
|
|
315
|
+
export declare function ExtractChannelAsync(name: string, input: ITextureProcessOperand, channel: TextureChannel, scene: Scene, outputColorSpace?: TextureColorSpace, outputChannelMask?: ChannelMask): Promise<ITextureProcessOperand>;
|