@driftengine/core 4.8.3 → 4.8.4
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/CHANGELOG.json +71 -0
- package/README.md +1 -1
- package/dist/geometry/meshConcat.js +2 -0
- package/dist/index.d.ts +10 -4
- package/dist/index.js +16 -1
- package/dist/math/scalar.js +1 -1
- package/dist/render/anisotropicLobe.d.ts +7 -0
- package/dist/render/anisotropicLobe.js +33 -0
- package/dist/render/backend/api.d.ts +41 -4
- package/dist/render/backend/select.js +8 -0
- package/dist/render/backend/webgl2/clothTextures.d.ts +27 -0
- package/dist/render/backend/webgl2/clothTextures.js +93 -0
- package/dist/render/backend/webgl2/renderer.d.ts +136 -3
- package/dist/render/backend/webgl2/renderer.js +604 -63
- package/dist/render/backend/webgl2/skinScatter.d.ts +50 -0
- package/dist/render/backend/webgl2/skinScatter.js +256 -0
- package/dist/render/backend/webgpu/buffers.d.ts +25 -11
- package/dist/render/backend/webgpu/buffers.js +98 -49
- package/dist/render/backend/webgpu/clothSolvePack.d.ts +27 -0
- package/dist/render/backend/webgpu/clothSolvePack.js +129 -0
- package/dist/render/backend/webgpu/clothTextures.d.ts +68 -0
- package/dist/render/backend/webgpu/clothTextures.js +145 -0
- package/dist/render/backend/webgpu/compressedUpload.d.ts +18 -0
- package/dist/render/backend/webgpu/compressedUpload.js +38 -0
- package/dist/render/backend/webgpu/computeHost.d.ts +21 -0
- package/dist/render/backend/webgpu/computeHost.js +5 -0
- package/dist/render/backend/webgpu/depthPass.d.ts +16 -6
- package/dist/render/backend/webgpu/depthPass.js +39 -9
- package/dist/render/backend/webgpu/drawCommand.js +6 -2
- package/dist/render/backend/webgpu/flatPass.d.ts +38 -4
- package/dist/render/backend/webgpu/flatPass.js +109 -12
- package/dist/render/backend/webgpu/gpuSkinnedCloth.d.ts +74 -0
- package/dist/render/backend/webgpu/gpuSkinnedCloth.js +452 -0
- package/dist/render/backend/webgpu/motionPass.d.ts +20 -0
- package/dist/render/backend/webgpu/motionPass.js +106 -9
- package/dist/render/backend/webgpu/postPass.d.ts +3 -1
- package/dist/render/backend/webgpu/postPass.js +6 -3
- package/dist/render/backend/webgpu/renderer.d.ts +113 -5
- package/dist/render/backend/webgpu/renderer.js +498 -48
- package/dist/render/backend/webgpu/shaders/clothSolve.wgsl.d.ts +33 -0
- package/dist/render/backend/webgpu/shaders/clothSolve.wgsl.js +469 -0
- package/dist/render/backend/webgpu/skinScatterPass.d.ts +51 -0
- package/dist/render/backend/webgpu/skinScatterPass.js +253 -0
- package/dist/render/backend/webgpu/surfaceTexturePass.d.ts +4 -1
- package/dist/render/backend/webgpu/surfaceTexturePass.js +37 -12
- package/dist/render/clothBindingData.d.ts +41 -0
- package/dist/render/clothBindingData.js +72 -0
- package/dist/render/clothPlacement.d.ts +25 -0
- package/dist/render/clothPlacement.js +85 -0
- package/dist/render/compressedSource.d.ts +66 -0
- package/dist/render/compressedSource.js +138 -0
- package/dist/render/cutoutCaster.d.ts +2 -0
- package/dist/render/cutoutCaster.js +2 -0
- package/dist/render/cutoutDither.d.ts +51 -0
- package/dist/render/cutoutDither.js +90 -0
- package/dist/render/eyeRefraction.d.ts +35 -0
- package/dist/render/eyeRefraction.js +40 -0
- package/dist/render/glCompressed.d.ts +27 -0
- package/dist/render/glCompressed.js +53 -0
- package/dist/render/hairLobes.d.ts +70 -0
- package/dist/render/hairLobes.js +120 -0
- package/dist/render/lightBudget.d.ts +22 -0
- package/dist/render/lightBudget.js +22 -0
- package/dist/render/mesh.d.ts +7 -0
- package/dist/render/mesh.js +24 -0
- package/dist/render/recon/motionVectors.d.ts +4 -2
- package/dist/render/recon/motionVectors.js +6 -3
- package/dist/render/renderQuality.d.ts +20 -0
- package/dist/render/renderQuality.js +5 -0
- package/dist/render/rendererHarness.js +4 -0
- package/dist/render/sceneTarget.d.ts +12 -0
- package/dist/render/sceneTarget.js +14 -0
- package/dist/render/shaders/clothBinding.d.ts +22 -0
- package/dist/render/shaders/clothBinding.js +80 -0
- package/dist/render/shaders/depth.js +42 -6
- package/dist/render/shaders/flat/anisotropic.d.ts +15 -0
- package/dist/render/shaders/flat/anisotropic.js +68 -0
- package/dist/render/shaders/flat/eye.d.ts +1 -0
- package/dist/render/shaders/flat/eye.js +81 -0
- package/dist/render/shaders/flat/hair.d.ts +1 -0
- package/dist/render/shaders/flat/hair.js +101 -0
- package/dist/render/shaders/flat/index.js +36 -2
- package/dist/render/shaders/flat/main.d.ts +1 -1
- package/dist/render/shaders/flat/main.js +113 -17
- package/dist/render/shaders/flat/models.d.ts +14 -0
- package/dist/render/shaders/flat/models.js +273 -0
- package/dist/render/shaders/flat/preamble.js +26 -24
- package/dist/render/shaders/flat/skin.d.ts +1 -0
- package/dist/render/shaders/flat/skin.js +114 -0
- package/dist/render/shaders/generated/depth.wgsl.d.ts +38 -16
- package/dist/render/shaders/generated/depth.wgsl.js +38 -16
- package/dist/render/shaders/generated/flat.wgsl.d.ts +1790 -1704
- package/dist/render/shaders/generated/flat.wgsl.js +1828 -1742
- package/dist/render/shaders/generated/skinBlur.wgsl.d.ts +48 -0
- package/dist/render/shaders/generated/skinBlur.wgsl.js +54 -0
- package/dist/render/shaders/recon/motion.wgsl.d.ts +1 -1
- package/dist/render/shaders/recon/motion.wgsl.js +102 -0
- package/dist/render/shaders/skinBlur.d.ts +1 -0
- package/dist/render/shaders/skinBlur.js +103 -0
- package/dist/render/shaders/skinning.d.ts +3 -1
- package/dist/render/shaders/skinning.js +31 -4
- package/dist/render/shadowCasters.d.ts +13 -1
- package/dist/render/skinBlur.d.ts +41 -0
- package/dist/render/skinBlur.js +49 -0
- package/dist/render/skinScatter.d.ts +67 -0
- package/dist/render/skinScatter.js +80 -0
- package/dist/render/skinnedClothRun.d.ts +26 -0
- package/dist/render/skinnedClothRun.js +84 -0
- package/dist/render/surfaceModel.d.ts +129 -0
- package/dist/render/surfaceModel.js +152 -0
- package/dist/render/surfaceTexture.d.ts +44 -4
- package/dist/render/surfaceTexture.js +60 -46
- package/dist/render/vertexDefaults.js +7 -0
- package/package.json +6 -6
- package/src/geometry/meshConcat.ts +2 -0
- package/src/index.ts +40 -1
- package/src/math/scalar.ts +1 -1
- package/src/render/anisotropicLobe.ts +41 -0
- package/src/render/backend/api.ts +52 -3
- package/src/render/backend/select.ts +8 -0
- package/src/render/backend/webgl2/clothTextures.ts +120 -0
- package/src/render/backend/webgl2/renderer.ts +693 -64
- package/src/render/backend/webgl2/skinScatter.ts +309 -0
- package/src/render/backend/webgpu/buffers.ts +137 -63
- package/src/render/backend/webgpu/clothSolvePack.ts +161 -0
- package/src/render/backend/webgpu/clothTextures.ts +194 -0
- package/src/render/backend/webgpu/compressedUpload.ts +65 -0
- package/src/render/backend/webgpu/computeHost.ts +25 -0
- package/src/render/backend/webgpu/depthPass.ts +39 -7
- package/src/render/backend/webgpu/drawCommand.ts +6 -2
- package/src/render/backend/webgpu/flatPass.ts +145 -7
- package/src/render/backend/webgpu/gpuSkinnedCloth.ts +502 -0
- package/src/render/backend/webgpu/motionPass.ts +128 -9
- package/src/render/backend/webgpu/postPass.ts +5 -1
- package/src/render/backend/webgpu/renderer.ts +663 -43
- package/src/render/backend/webgpu/shaders/clothSolve.wgsl.ts +470 -0
- package/src/render/backend/webgpu/skinScatterPass.ts +309 -0
- package/src/render/backend/webgpu/surfaceTexturePass.ts +42 -12
- package/src/render/clothBindingData.ts +89 -0
- package/src/render/clothPlacement.ts +114 -0
- package/src/render/compressedSource.ts +198 -0
- package/src/render/cutoutCaster.ts +5 -0
- package/src/render/cutoutDither.ts +99 -0
- package/src/render/eyeRefraction.ts +72 -0
- package/src/render/glCompressed.ts +86 -0
- package/src/render/hairLobes.ts +188 -0
- package/src/render/lightBudget.ts +25 -0
- package/src/render/mesh.ts +23 -0
- package/src/render/recon/motionVectors.ts +6 -3
- package/src/render/renderQuality.ts +28 -0
- package/src/render/rendererHarness.ts +4 -0
- package/src/render/sceneTarget.ts +21 -0
- package/src/render/shaders/clothBinding.ts +81 -0
- package/src/render/shaders/depth.ts +42 -6
- package/src/render/shaders/flat/anisotropic.ts +68 -0
- package/src/render/shaders/flat/eye.ts +82 -0
- package/src/render/shaders/flat/hair.ts +102 -0
- package/src/render/shaders/flat/index.ts +36 -2
- package/src/render/shaders/flat/main.ts +113 -17
- package/src/render/shaders/flat/models.ts +286 -0
- package/src/render/shaders/flat/preamble.ts +26 -24
- package/src/render/shaders/flat/skin.ts +116 -0
- package/src/render/shaders/generated/depth.wgsl.ts +38 -16
- package/src/render/shaders/generated/flat.wgsl.ts +1828 -1742
- package/src/render/shaders/generated/skinBlur.wgsl.ts +56 -0
- package/src/render/shaders/recon/motion.wgsl.ts +102 -0
- package/src/render/shaders/skinBlur.ts +105 -0
- package/src/render/shaders/skinning.ts +31 -4
- package/src/render/shadowCasters.ts +13 -0
- package/src/render/skinBlur.ts +53 -0
- package/src/render/skinScatter.ts +92 -0
- package/src/render/skinnedClothRun.ts +128 -0
- package/src/render/surfaceModel.ts +274 -0
- package/src/render/surfaceTexture.ts +123 -63
- package/src/render/vertexDefaults.ts +7 -0
- package/dist/math/exact.d.ts +0 -76
- package/dist/math/exact.js +0 -327
- package/src/math/exact.ts +0 -340
|
@@ -33,6 +33,8 @@ import type { WorldLightFieldOptions } from '../../driftLight/worldLightField.ts
|
|
|
33
33
|
* Beyond this the velocity is shortened and the direction kept.
|
|
34
34
|
*/
|
|
35
35
|
import type { RendererApi } from '../api.ts';
|
|
36
|
+
import type { ClothBindingData } from '../../clothBindingData.ts';
|
|
37
|
+
import { GlClothBinding, GlClothParticles } from './clothTextures.ts';
|
|
36
38
|
import type { ProbeBakeOptions } from '../../reflectionProbe.ts';
|
|
37
39
|
import type { ProbeGridOptions } from '../../probeGrid.ts';
|
|
38
40
|
import type { AreaLightBuffer, AreaLightSource } from '../../areaLights.ts';
|
|
@@ -45,6 +47,7 @@ import type { IncrementalMesh } from '../../mesh.ts';
|
|
|
45
47
|
import type { MeshData } from '../../mesh.ts';
|
|
46
48
|
import type { MeshOptions } from '../api.ts';
|
|
47
49
|
import { SurfaceTexture } from '../../surfaceTexture.ts';
|
|
50
|
+
import type { CompressedTextureFormat, SurfaceSource } from '../../compressedSource.ts';
|
|
48
51
|
import type { SurfaceMaterial, SurfaceTextureOptions } from '../../surfaceTexture.ts';
|
|
49
52
|
import { PlumeRenderer } from '../../plumeRenderer.ts';
|
|
50
53
|
import type { PlumeOptions, PlumePlacement } from '../../plumeRenderer.ts';
|
|
@@ -823,6 +826,17 @@ export declare class WebGL2Renderer implements RendererApi {
|
|
|
823
826
|
private flatMorphedUniforms;
|
|
824
827
|
private flatBothProgram;
|
|
825
828
|
private flatBothUniforms;
|
|
829
|
+
/**
|
|
830
|
+
* The two skinned variants built with `SKIN_EIGHT` on, for a rig whose vertices name eight
|
|
831
|
+
* joints: compiled the first time such a mesh is created, and only then. See `skinning.ts`.
|
|
832
|
+
*/
|
|
833
|
+
private flatSkinned8Program;
|
|
834
|
+
private flatSkinned8Uniforms;
|
|
835
|
+
private flatBoth8Program;
|
|
836
|
+
private flatBoth8Uniforms;
|
|
837
|
+
/** And its shadow caster, so the shadow parts from nothing the body does. */
|
|
838
|
+
private depthSkinned8Program;
|
|
839
|
+
private depthSkinned8Uniforms;
|
|
826
840
|
/** The morph weights the following draws use, or null for none. */
|
|
827
841
|
private morphWeights;
|
|
828
842
|
/**
|
|
@@ -856,6 +870,14 @@ export declare class WebGL2Renderer implements RendererApi {
|
|
|
856
870
|
* before this existed.
|
|
857
871
|
*/
|
|
858
872
|
private readonly sceneTarget;
|
|
873
|
+
/**
|
|
874
|
+
* Skin's screen-space scattering, made where the profile asks for it and has a composite to add
|
|
875
|
+
* into, and null otherwise — which is every profile by default. See `GlSkinScatter`.
|
|
876
|
+
*/
|
|
877
|
+
private readonly skinScatter;
|
|
878
|
+
/** Whether this frame has spread its skin: once, at its first blended draw or at its end. */
|
|
879
|
+
private skinScattered;
|
|
880
|
+
private readonly skinInverseProjection;
|
|
859
881
|
/** So the refusal below is once per renderer rather than once per frame. See `setColourGrade`. */
|
|
860
882
|
private warnedGradeWithoutComposite;
|
|
861
883
|
/** Scratch for a volume's `uDepthToLocal`. Built per draw and never allocated in the loop. */
|
|
@@ -878,6 +900,21 @@ export declare class WebGL2Renderer implements RendererApi {
|
|
|
878
900
|
private readonly skinPalette;
|
|
879
901
|
/** Whether a palette is currently chosen. Distinct from whether one was ever uploaded. */
|
|
880
902
|
private skinPaletteSet;
|
|
903
|
+
/**
|
|
904
|
+
* Cloth-bound skinned lit programs, keyed `eight|morphed`, compiled when a binding is made for a
|
|
905
|
+
* mesh of that kind; and their casters, keyed by `eight`. See `ensureClothPrograms`.
|
|
906
|
+
*/
|
|
907
|
+
private readonly clothFlat;
|
|
908
|
+
private readonly clothDepth;
|
|
909
|
+
/** The cloth the next skinned draws are placed by, or null. See `setCloth`. */
|
|
910
|
+
private cloth;
|
|
911
|
+
/**
|
|
912
|
+
* Each shading model's lit programs, keyed `variant|model` by the vertex variant they pair with,
|
|
913
|
+
* compiled the first time a draw asks for one. See `modelProgram`.
|
|
914
|
+
*/
|
|
915
|
+
private readonly modelFlat;
|
|
916
|
+
/** The last palette chosen, which an eye's axis is turned by. See `setSkinPalette`. */
|
|
917
|
+
private paletteData;
|
|
881
918
|
private readonly emptyTexture2D;
|
|
882
919
|
/** One glass resolution reused by every draw, so a pane allocates nothing. See `glass.ts`. */
|
|
883
920
|
private readonly glassScratch;
|
|
@@ -1303,6 +1340,22 @@ export declare class WebGL2Renderer implements RendererApi {
|
|
|
1303
1340
|
private materialHasMaps;
|
|
1304
1341
|
/** The material last set, so a lit program rebuilt for glass can be given it. */
|
|
1305
1342
|
private currentMaterial;
|
|
1343
|
+
/**
|
|
1344
|
+
* The frame a dithered cutout's pattern is offset by, advanced at `beginFrame` and wrapped at 64
|
|
1345
|
+
* so the noise's argument stays small. See `cutoutDither.ts`.
|
|
1346
|
+
*/
|
|
1347
|
+
private cutoutFrame;
|
|
1348
|
+
/** Scratch for `uCutout`, so a material write allocates nothing. */
|
|
1349
|
+
private readonly cutoutVector;
|
|
1350
|
+
/** The material's model numbers, `uModelParams`, packed by `packModel`. */
|
|
1351
|
+
private readonly modelParams;
|
|
1352
|
+
/** The material's four switches, `uMaterialFlags`: albedo, ORM map, emissive map, two-sided. */
|
|
1353
|
+
private readonly materialFlags;
|
|
1354
|
+
/**
|
|
1355
|
+
* The default framebuffer's sample count, read once, for a frame drawn with no scene target: a
|
|
1356
|
+
* dithered cutout there takes alpha-to-coverage when the canvas itself is multisampled.
|
|
1357
|
+
*/
|
|
1358
|
+
private readonly canvasSamples;
|
|
1306
1359
|
/**
|
|
1307
1360
|
* The lit stage's switches: what the lit programs were compiled with (`litOn`), and what the
|
|
1308
1361
|
* profile and the content have asked for since (`litWanted`).
|
|
@@ -1734,14 +1787,25 @@ export declare class WebGL2Renderer implements RendererApi {
|
|
|
1734
1787
|
* a canvas drawn procedurally at runtime, a decoded bitmap, a video frame — stays
|
|
1735
1788
|
* the consumer's decision. What it gains is a GPU object with sane sampler state.
|
|
1736
1789
|
*/
|
|
1737
|
-
createSurfaceTexture(source:
|
|
1790
|
+
createSurfaceTexture(source: SurfaceSource, options?: SurfaceTextureOptions): SurfaceTexture;
|
|
1791
|
+
private compressedCache;
|
|
1792
|
+
/**
|
|
1793
|
+
* The BC formats this device takes as blocks, each named with its colour space (`'bc7-srgb'`).
|
|
1794
|
+
*
|
|
1795
|
+
* **Ask before choosing**, because a phone usually answers none: a BC texture handed to
|
|
1796
|
+
* `createSurfaceTexture` where its format is not here is refused by name rather than decoded,
|
|
1797
|
+
* since core ships no decoder. `@driftengine/assets`' loader asks this for every BC texture in a
|
|
1798
|
+
* container and decodes at load where the answer is no. Read from the four extensions WebGL2
|
|
1799
|
+
* spreads BC across; see `glCompressed.ts`.
|
|
1800
|
+
*/
|
|
1801
|
+
get compressedFormats(): readonly CompressedTextureFormat[];
|
|
1738
1802
|
/**
|
|
1739
1803
|
* Upload several images of one size as the layers of one array, for a merged mesh that names a
|
|
1740
1804
|
* layer per vertex (`MeshData.layers`). One material binding then covers every image, which is
|
|
1741
1805
|
* what makes a block wearing forty facades one draw. Every layer must be the same size, and the
|
|
1742
1806
|
* refusal names the first that is not.
|
|
1743
1807
|
*/
|
|
1744
|
-
createSurfaceTextureArray(sources: readonly
|
|
1808
|
+
createSurfaceTextureArray(sources: readonly SurfaceSource[], options?: SurfaceTextureOptions): SurfaceTexture;
|
|
1745
1809
|
/**
|
|
1746
1810
|
* Replace a surface texture's pixels, keeping the GPU object and its sampler state.
|
|
1747
1811
|
*
|
|
@@ -1782,6 +1846,51 @@ export declare class WebGL2Renderer implements RendererApi {
|
|
|
1782
1846
|
* runtime out of core.
|
|
1783
1847
|
*/
|
|
1784
1848
|
setSkinPalette(palette: Float32Array | null): void;
|
|
1849
|
+
/**
|
|
1850
|
+
* The lit program for one vertex variant shading by a model: the standard program's vertex
|
|
1851
|
+
* stage, and the fragment stage with the model's switch on (`modelBound`). Compiled the first
|
|
1852
|
+
* time a draw asks — a scene that names no model compiles none — and fed the pass and the
|
|
1853
|
+
* material at once, as `ensureClothPrograms` feeds its own.
|
|
1854
|
+
*/
|
|
1855
|
+
private modelProgram;
|
|
1856
|
+
/**
|
|
1857
|
+
* An eye's axis in the world for this draw, into its program's `uModelParams`: the material's
|
|
1858
|
+
* own numbers with the axis turned by the draw's model matrix and the eye's joint. See
|
|
1859
|
+
* `eyeAxisInWorld`.
|
|
1860
|
+
*/
|
|
1861
|
+
private writeEyeAxis;
|
|
1862
|
+
/**
|
|
1863
|
+
* A mesh's cloth binding: which simulation triangle each of its vertices follows, where on it,
|
|
1864
|
+
* and by how much. See `ClothBindingData`.
|
|
1865
|
+
*
|
|
1866
|
+
* Refused by name for a mesh with no rig — a binding blends a vertex between its skinning and the
|
|
1867
|
+
* cloth — and for one that disagrees with the mesh. Compiles the programs that draw and cast it
|
|
1868
|
+
* here, at creation, so no frame ever waits on a compile.
|
|
1869
|
+
*/
|
|
1870
|
+
createClothBinding(mesh: Mesh, data: ClothBindingData): GlClothBinding;
|
|
1871
|
+
/** One character's particles, `count` of them, to be updated every frame. */
|
|
1872
|
+
createClothParticles(count: number): GlClothParticles;
|
|
1873
|
+
/**
|
|
1874
|
+
* This frame's particles, three floats each, world space; last frame's are kept for motion. A
|
|
1875
|
+
* simulation's output, as it is.
|
|
1876
|
+
*/
|
|
1877
|
+
updateClothParticles(particles: GlClothParticles, positions: Float32Array): void;
|
|
1878
|
+
/**
|
|
1879
|
+
* Place the following skinned draws by a cloth: `binding` the mesh's, `particles` the
|
|
1880
|
+
* character's. Null for none, which is every draw until this is called. Both or neither, and
|
|
1881
|
+
* the particles must be as many as the binding names.
|
|
1882
|
+
*/
|
|
1883
|
+
setCloth(binding: GlClothBinding | null, particles?: GlClothParticles | null): void;
|
|
1884
|
+
disposeClothBinding(binding: GlClothBinding): void;
|
|
1885
|
+
disposeClothParticles(particles: GlClothParticles): void;
|
|
1886
|
+
/**
|
|
1887
|
+
* The cloth-bound lit program and caster for a rig of this kind, once. Fed at once if a pass is
|
|
1888
|
+
* bound, for the reason `ensureVariant` gives: a program compiled after `bindMeshPass` would
|
|
1889
|
+
* otherwise carry every uniform at zero.
|
|
1890
|
+
*/
|
|
1891
|
+
private ensureClothPrograms;
|
|
1892
|
+
/** Bind the cloth's three textures to their units and name them to `u`. */
|
|
1893
|
+
private bindCloth;
|
|
1785
1894
|
/**
|
|
1786
1895
|
* Choose the morph weights the following `drawMesh` calls deform by, or null for none.
|
|
1787
1896
|
*
|
|
@@ -1791,6 +1900,14 @@ export declare class WebGL2Renderer implements RendererApi {
|
|
|
1791
1900
|
*/
|
|
1792
1901
|
setMorphWeights(weights: Float32Array | null): void;
|
|
1793
1902
|
setMaterial(material: SurfaceMaterial | null): void;
|
|
1903
|
+
/**
|
|
1904
|
+
* How a material's cutout edge is drawn this frame: the material's mode against what the frame can
|
|
1905
|
+
* resolve. A translucent draw tests hard whatever the material says, because a blended draw has
|
|
1906
|
+
* nothing to average a pattern with. See `cutoutDither.ts`.
|
|
1907
|
+
*/
|
|
1908
|
+
private cutoutResolveNow;
|
|
1909
|
+
/** The lit pass's `uCutout` for a material this frame, into scratch. See `uCutout`. */
|
|
1910
|
+
private cutoutUniform;
|
|
1794
1911
|
/**
|
|
1795
1912
|
* One flat program's view of the current material.
|
|
1796
1913
|
*
|
|
@@ -1813,7 +1930,7 @@ export declare class WebGL2Renderer implements RendererApi {
|
|
|
1813
1930
|
* Rebind `SURFACE_TEXTURE_UNIT` to whatever `setSurfaceTexture` last put there.
|
|
1814
1931
|
*
|
|
1815
1932
|
* Only `drawSdfText` calls this, after the atlas has finished borrowing the same unit.
|
|
1816
|
-
* No uniform is written here — the flat program's `uAlbedo
|
|
1933
|
+
* No uniform is written here — the flat program's `uAlbedo` and its flag in `uMaterialFlags` were never
|
|
1817
1934
|
* touched by the text draw and are still correct, since that draw runs its own separate
|
|
1818
1935
|
* program. What moved is unit 15's actual `WebGLTexture` binding, which is GL state, not
|
|
1819
1936
|
* program state, and this puts it back to what `currentSurfaceTexture` says it should be.
|
|
@@ -3311,6 +3428,22 @@ export declare class WebGL2Renderer implements RendererApi {
|
|
|
3311
3428
|
* neither read nor advanced.
|
|
3312
3429
|
*/
|
|
3313
3430
|
_previousModel?: ReadonlyMat4 | Mover | null): void;
|
|
3431
|
+
/**
|
|
3432
|
+
* Whether a skin draw now draws its two halves: the profile asked, the frame has not spread its
|
|
3433
|
+
* skin yet, this is the frame's own picture — not a mirror's or a probe's, nor an overlay after
|
|
3434
|
+
* the frame — and the blur's target can be had.
|
|
3435
|
+
*/
|
|
3436
|
+
private skinSplits;
|
|
3437
|
+
/**
|
|
3438
|
+
* Spread the frame's skin and add it back: once, at the first blended draw or at the frame's end.
|
|
3439
|
+
* Called first in every draw WebGPU records as blended — translucent meshes and batches, text,
|
|
3440
|
+
* particles, plumes, wind streaks, bolts, lines, caustics, film — so the two backends add skin at
|
|
3441
|
+
* the same point. The frame's depth is copied for the blur to read, and where it cannot be the
|
|
3442
|
+
* diffuse goes back unspread rather than not at all.
|
|
3443
|
+
*/
|
|
3444
|
+
private scatterSkin;
|
|
3445
|
+
/** One draw of a mesh, as `drawMesh` describes, of the half of a skin `half` names. */
|
|
3446
|
+
private drawMeshHalf;
|
|
3314
3447
|
/**
|
|
3315
3448
|
* Draw a mesh you can see through, in the same material as everything else by default.
|
|
3316
3449
|
*
|