@driftengine/core 4.9.0 → 4.11.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/CHANGELOG.json +133 -11
- package/README.md +43 -38
- package/dist/index.d.ts +7 -4
- package/dist/index.js +5 -4
- package/dist/render/ambientHarmonics.d.ts +1 -1
- package/dist/render/ambientHarmonics.js +1 -1
- package/dist/render/areaLights.d.ts +4 -4
- package/dist/render/areaLights.js +1 -1
- package/dist/render/backend/api.d.ts +10 -3
- package/dist/render/backend/select.js +11 -5
- package/dist/render/backend/webgl2/boneAnimations.d.ts +29 -0
- package/dist/render/backend/webgl2/boneAnimations.js +80 -0
- package/dist/render/backend/webgl2/instanced.d.ts +5 -1
- package/dist/render/backend/webgl2/instanced.js +13 -1
- package/dist/render/backend/webgl2/renderer.d.ts +189 -4
- package/dist/render/backend/webgl2/renderer.js +614 -66
- package/dist/render/backend/webgl2/skinPaletteTexture.d.ts +5 -3
- package/dist/render/backend/webgl2/skinPaletteTexture.js +6 -4
- package/dist/render/backend/webgpu/boneAnimations.d.ts +34 -0
- package/dist/render/backend/webgpu/boneAnimations.js +76 -0
- package/dist/render/backend/webgpu/buffers.d.ts +24 -4
- package/dist/render/backend/webgpu/buffers.js +116 -59
- package/dist/render/backend/webgpu/clothKernels.d.ts +8 -0
- package/dist/render/backend/webgpu/clothKernels.js +76 -0
- package/dist/render/backend/webgpu/clothOps.d.ts +39 -0
- package/dist/render/backend/webgpu/clothOps.js +78 -0
- package/dist/render/backend/webgpu/clothSetLayout.d.ts +25 -0
- package/dist/render/backend/webgpu/clothSetLayout.js +84 -0
- package/dist/render/backend/webgpu/clothSetPack.d.ts +33 -0
- package/dist/render/backend/webgpu/clothSetPack.js +144 -0
- package/dist/render/backend/webgpu/compressedUpload.d.ts +0 -1
- package/dist/render/backend/webgpu/compressedUpload.js +53 -8
- package/dist/render/backend/webgpu/depthPass.d.ts +59 -3
- package/dist/render/backend/webgpu/depthPass.js +49 -14
- package/dist/render/backend/webgpu/drawCommand.d.ts +20 -4
- package/dist/render/backend/webgpu/drawCommand.js +11 -3
- package/dist/render/backend/webgpu/flatPass.d.ts +85 -42
- package/dist/render/backend/webgpu/flatPass.js +137 -20
- package/dist/render/backend/webgpu/gpuClothSet.d.ts +80 -0
- package/dist/render/backend/webgpu/gpuClothSet.js +462 -0
- package/dist/render/backend/webgpu/instanced.d.ts +14 -1
- package/dist/render/backend/webgpu/instanced.js +24 -1
- package/dist/render/backend/webgpu/latePass.js +1 -0
- package/dist/render/backend/webgpu/materialStore.d.ts +101 -0
- package/dist/render/backend/webgpu/materialStore.js +265 -0
- package/dist/render/backend/webgpu/motionPass.js +15 -6
- package/dist/render/backend/webgpu/pipelineCache.d.ts +28 -1
- package/dist/render/backend/webgpu/pipelineCache.js +46 -1
- package/dist/render/backend/webgpu/postPass.d.ts +1 -1
- package/dist/render/backend/webgpu/renderer.d.ts +200 -35
- package/dist/render/backend/webgpu/renderer.js +993 -168
- package/dist/render/backend/webgpu/shaders/clothSolve.wgsl.d.ts +9 -2
- package/dist/render/backend/webgpu/shaders/clothSolve.wgsl.js +121 -47
- package/dist/render/backend/webgpu/skinPaletteRing.d.ts +7 -3
- package/dist/render/backend/webgpu/skinPaletteRing.js +13 -7
- package/dist/render/backend/webgpu/skinPaletteTexture.d.ts +6 -0
- package/dist/render/backend/webgpu/skinPaletteTexture.js +7 -1
- package/dist/render/backend/webgpu/staticBundles.d.ts +125 -0
- package/dist/render/backend/webgpu/staticBundles.js +242 -0
- package/dist/render/backend/webgpu/surfaceTexturePass.d.ts +10 -3
- package/dist/render/backend/webgpu/surfaceTexturePass.js +20 -2
- package/dist/render/backend/webgpu/uniformRing.d.ts +21 -0
- package/dist/render/backend/webgpu/uniformRing.js +9 -1
- package/dist/render/backend/webgpu/vertexFormats.d.ts +22 -0
- package/dist/render/backend/webgpu/vertexFormats.js +97 -0
- package/dist/render/bloomChain.d.ts +3 -3
- package/dist/render/boneAnimation.d.ts +92 -0
- package/dist/render/boneAnimation.js +133 -0
- package/dist/render/compressedSource.d.ts +33 -13
- package/dist/render/compressedSource.js +70 -25
- package/dist/render/glCompressed.js +83 -0
- package/dist/render/globalMediumPass.d.ts +2 -0
- package/dist/render/globalMediumPass.js +1 -0
- package/dist/render/indexWidth.d.ts +17 -0
- package/dist/render/indexWidth.js +23 -0
- package/dist/render/instances.d.ts +26 -0
- package/dist/render/lightBudget.d.ts +10 -0
- package/dist/render/lightBudget.js +10 -0
- package/dist/render/lightMatrix.d.ts +11 -0
- package/dist/render/lightMatrix.js +14 -0
- package/dist/render/lightmap.d.ts +1 -1
- package/dist/render/mesh.d.ts +14 -0
- package/dist/render/mesh.js +44 -14
- package/dist/render/pointLightSelection.d.ts +4 -4
- package/dist/render/renderQuality.d.ts +30 -0
- package/dist/render/renderQuality.js +5 -0
- package/dist/render/rendererHarness.d.ts +7 -0
- package/dist/render/rendererHarness.js +12 -0
- package/dist/render/screenSpaceReflection.d.ts +2 -1
- package/dist/render/shader.d.ts +15 -0
- package/dist/render/shader.js +41 -0
- package/dist/render/shaders/boneAnimation.d.ts +19 -0
- package/dist/render/shaders/boneAnimation.js +63 -0
- package/dist/render/shaders/depth.d.ts +7 -0
- package/dist/render/shaders/depth.js +35 -10
- package/dist/render/shaders/flat/directionalShadow.js +84 -10
- package/dist/render/shaders/flat/glassTint.d.ts +1 -1
- package/dist/render/shaders/flat/glassTint.js +3 -0
- package/dist/render/shaders/flat/index.d.ts +21 -0
- package/dist/render/shaders/flat/index.js +42 -7
- package/dist/render/shaders/flat/layered.d.ts +19 -0
- package/dist/render/shaders/flat/layered.js +115 -0
- package/dist/render/shaders/flat/main.d.ts +1 -1
- package/dist/render/shaders/flat/main.js +58 -21
- package/dist/render/shaders/flat/mapReads.d.ts +10 -0
- package/dist/render/shaders/flat/mapReads.js +38 -0
- package/dist/render/shaders/flat/models.js +1 -1
- package/dist/render/shaders/flat/movingSun.d.ts +21 -0
- package/dist/render/shaders/flat/movingSun.js +46 -0
- package/dist/render/shaders/flat/normalMap.d.ts +6 -2
- package/dist/render/shaders/flat/normalMap.js +14 -3
- package/dist/render/shaders/flat/overlay.d.ts +3 -2
- package/dist/render/shaders/flat/overlay.js +42 -20
- package/dist/render/shaders/flat/pointShadow.js +2 -2
- package/dist/render/shaders/flat/preamble.js +59 -27
- package/dist/render/shaders/flat/worldUv.d.ts +22 -0
- package/dist/render/shaders/flat/worldUv.js +113 -0
- package/dist/render/shaders/generated/depth.wgsl.d.ts +93 -0
- package/dist/render/shaders/generated/depth.wgsl.js +93 -0
- package/dist/render/shaders/generated/flat.wgsl.d.ts +3616 -3042
- package/dist/render/shaders/generated/flat.wgsl.js +3688 -3113
- package/dist/render/shaders/generated/globalMedium.wgsl.d.ts +8 -3
- package/dist/render/shaders/generated/globalMedium.wgsl.js +8 -3
- package/dist/render/shaders/generated/lightVolume.wgsl.d.ts +15 -10
- package/dist/render/shaders/generated/lightVolume.wgsl.js +16 -11
- package/dist/render/shaders/globalMedium.js +9 -1
- package/dist/render/shaders/lightVolume.js +9 -1
- package/dist/render/shaders/outputTransform.d.ts +7 -0
- package/dist/render/shaders/outputTransform.js +28 -14
- package/dist/render/shaders/tangentFrame.d.ts +1 -1
- package/dist/render/shaders/tangentFrame.js +16 -3
- package/dist/render/shaders/vertexChannel.d.ts +7 -0
- package/dist/render/shaders/vertexChannel.js +26 -0
- package/dist/render/skinnedClothRun.d.ts +28 -0
- package/dist/render/skinnedClothRun.js +103 -35
- package/dist/render/staticDraws.d.ts +47 -0
- package/dist/render/staticDraws.js +43 -0
- package/dist/render/surfaceLayers.d.ts +39 -0
- package/dist/render/surfaceLayers.js +26 -0
- package/dist/render/surfaceOverlay.d.ts +16 -3
- package/dist/render/surfaceOverlay.js +11 -6
- package/dist/render/surfaceProjection.d.ts +34 -0
- package/dist/render/surfaceProjection.js +30 -0
- package/dist/render/surfaceTexture.d.ts +68 -7
- package/dist/render/surfaceTexture.js +56 -17
- package/dist/render/vertexPacking.d.ts +48 -0
- package/dist/render/vertexPacking.js +68 -0
- package/package.json +6 -6
- package/src/index.ts +12 -4
- package/src/render/ambientHarmonics.ts +1 -1
- package/src/render/areaLights.ts +4 -4
- package/src/render/backend/api.ts +13 -3
- package/src/render/backend/select.ts +10 -5
- package/src/render/backend/webgl2/boneAnimations.ts +105 -0
- package/src/render/backend/webgl2/instanced.ts +20 -1
- package/src/render/backend/webgl2/renderer.ts +723 -79
- package/src/render/backend/webgl2/skinPaletteTexture.ts +6 -4
- package/src/render/backend/webgpu/boneAnimations.ts +97 -0
- package/src/render/backend/webgpu/buffers.ts +195 -70
- package/src/render/backend/webgpu/clothKernels.ts +86 -0
- package/src/render/backend/webgpu/clothOps.ts +86 -0
- package/src/render/backend/webgpu/clothSetLayout.ts +102 -0
- package/src/render/backend/webgpu/clothSetPack.ts +197 -0
- package/src/render/backend/webgpu/compressedUpload.ts +59 -9
- package/src/render/backend/webgpu/depthPass.ts +51 -10
- package/src/render/backend/webgpu/drawCommand.ts +25 -4
- package/src/render/backend/webgpu/flatPass.ts +212 -41
- package/src/render/backend/webgpu/gpuClothSet.ts +564 -0
- package/src/render/backend/webgpu/instanced.ts +32 -1
- package/src/render/backend/webgpu/latePass.ts +1 -0
- package/src/render/backend/webgpu/materialStore.ts +276 -0
- package/src/render/backend/webgpu/motionPass.ts +18 -7
- package/src/render/backend/webgpu/pipelineCache.ts +53 -7
- package/src/render/backend/webgpu/renderer.ts +1201 -202
- package/src/render/backend/webgpu/shaders/clothSolve.wgsl.ts +121 -47
- package/src/render/backend/webgpu/skinPaletteRing.ts +13 -7
- package/src/render/backend/webgpu/skinPaletteTexture.ts +7 -1
- package/src/render/backend/webgpu/staticBundles.ts +364 -0
- package/src/render/backend/webgpu/surfaceTexturePass.ts +29 -3
- package/src/render/backend/webgpu/uniformRing.ts +10 -1
- package/src/render/backend/webgpu/vertexFormats.ts +113 -0
- package/src/render/bloomChain.ts +3 -3
- package/src/render/boneAnimation.ts +223 -0
- package/src/render/compressedSource.ts +121 -29
- package/src/render/glCompressed.ts +83 -0
- package/src/render/globalMediumPass.ts +7 -0
- package/src/render/indexWidth.ts +27 -0
- package/src/render/instances.ts +27 -0
- package/src/render/lightBudget.ts +11 -0
- package/src/render/lightMatrix.ts +15 -0
- package/src/render/lightmap.ts +1 -1
- package/src/render/mesh.ts +72 -14
- package/src/render/pointLightSelection.ts +4 -4
- package/src/render/renderQuality.ts +38 -0
- package/src/render/rendererHarness.ts +15 -0
- package/src/render/screenSpaceReflection.ts +2 -1
- package/src/render/shader.ts +59 -0
- package/src/render/shaders/boneAnimation.ts +63 -0
- package/src/render/shaders/depth.ts +45 -10
- package/src/render/shaders/flat/directionalShadow.ts +84 -10
- package/src/render/shaders/flat/glassTint.ts +7 -1
- package/src/render/shaders/flat/index.ts +63 -7
- package/src/render/shaders/flat/layered.ts +115 -0
- package/src/render/shaders/flat/main.ts +58 -21
- package/src/render/shaders/flat/mapReads.ts +38 -0
- package/src/render/shaders/flat/models.ts +1 -1
- package/src/render/shaders/flat/movingSun.ts +46 -0
- package/src/render/shaders/flat/normalMap.ts +14 -3
- package/src/render/shaders/flat/overlay.ts +42 -20
- package/src/render/shaders/flat/pointShadow.ts +2 -2
- package/src/render/shaders/flat/preamble.ts +59 -27
- package/src/render/shaders/flat/worldUv.ts +113 -0
- package/src/render/shaders/generated/depth.wgsl.ts +95 -0
- package/src/render/shaders/generated/flat.wgsl.ts +3688 -3113
- package/src/render/shaders/generated/globalMedium.wgsl.ts +8 -3
- package/src/render/shaders/generated/lightVolume.wgsl.ts +16 -11
- package/src/render/shaders/globalMedium.ts +9 -1
- package/src/render/shaders/lightVolume.ts +9 -1
- package/src/render/shaders/outputTransform.ts +30 -14
- package/src/render/shaders/tangentFrame.ts +16 -3
- package/src/render/shaders/vertexChannel.ts +27 -0
- package/src/render/skinnedClothRun.ts +138 -38
- package/src/render/staticDraws.ts +95 -0
- package/src/render/surfaceLayers.ts +57 -0
- package/src/render/surfaceOverlay.ts +24 -7
- package/src/render/surfaceProjection.ts +57 -0
- package/src/render/surfaceTexture.ts +124 -27
- package/src/render/vertexPacking.ts +109 -0
- package/dist/render/backend/webgpu/gpuSkinnedCloth.d.ts +0 -74
- package/dist/render/backend/webgpu/gpuSkinnedCloth.js +0 -452
- package/src/render/backend/webgpu/gpuSkinnedCloth.ts +0 -502
|
@@ -108,9 +108,20 @@ uniform sampler2D uRefractScene;
|
|
|
108
108
|
* gives up, and four separate floats cost half the shadowed lights such a device can have. The tints
|
|
109
109
|
* stay colours of their own. Zero transmission is not glass — see glass.ts.
|
|
110
110
|
*/
|
|
111
|
-
uniform vec4 uSeeThrough;
|
|
112
|
-
|
|
113
|
-
|
|
111
|
+
uniform vec4 uSeeThrough; // wgsl:material
|
|
112
|
+
/*
|
|
113
|
+
* What a metre of the medium leaves of each channel (rgb), and in w which way this frame's rows run
|
|
114
|
+
* up the screen: +1 where the first row is the bottom (WebGL2), -1 where it is the top (WebGPU). The
|
|
115
|
+
* bend is taken in view space, whose y is up whatever the framebuffer says, so it is turned here to
|
|
116
|
+
* the rows a screen coordinate counts. A vec4 where a vec3 already spent the row.
|
|
117
|
+
*/
|
|
118
|
+
uniform vec4 uRefractTint; // wgsl:material
|
|
119
|
+
/*
|
|
120
|
+
* A pane's colour (rgb), and in w how much light from behind an opaque thin surface lets through:
|
|
121
|
+
* \`SurfaceMaterial.diffuseTransmission\`, read where the draw is not glass. A vec4 where a vec3
|
|
122
|
+
* already spent the row.
|
|
123
|
+
*/
|
|
124
|
+
uniform vec4 uGlassTint; // wgsl:material
|
|
114
125
|
flat in int vHasTangents;
|
|
115
126
|
|
|
116
127
|
/**
|
|
@@ -141,7 +152,7 @@ uniform mediump sampler2DArray uAlbedo;
|
|
|
141
152
|
* card. Its draw culls nothing, and a back face is lit as a front, with the shading normal turned
|
|
142
153
|
* toward the viewer.
|
|
143
154
|
*/
|
|
144
|
-
uniform ivec4 uMaterialFlags;
|
|
155
|
+
uniform ivec4 uMaterialFlags; // wgsl:material
|
|
145
156
|
/**
|
|
146
157
|
* Alpha below which a textured fragment is thrown away entirely, 0 to disable.
|
|
147
158
|
*
|
|
@@ -155,13 +166,17 @@ uniform ivec4 uMaterialFlags;
|
|
|
155
166
|
* else changes.
|
|
156
167
|
*
|
|
157
168
|
* **Four numbers in one row**: x is the cutoff, y how this frame resolves the edge (0 the hard test,
|
|
158
|
-
* 1 a dither the temporal resolve averages, 2 alpha-to-coverage; see \`cutoutDither.ts\`), z
|
|
159
|
-
*
|
|
160
|
-
*
|
|
161
|
-
*
|
|
162
|
-
*
|
|
169
|
+
* 1 a dither the temporal resolve averages, 2 alpha-to-coverage; see \`cutoutDither.ts\`), z unused,
|
|
170
|
+
* w the material's lighting channels — a mask a light shades it only where its own shares a bit
|
|
171
|
+
* with (\`SurfaceMaterial.lightChannels\`, 1 unless a material names others). One vector rather than
|
|
172
|
+
* a float and three more, because every loose scalar is a row of WebGL2's 224 that the light budget
|
|
173
|
+
* gives up.
|
|
174
|
+
*
|
|
175
|
+
* **z was the frame the dither's pattern is offset by until 4.10.0**, and that made every material
|
|
176
|
+
* new every frame: a material is kept on WebGPU by its numbers, and one of them changed with the
|
|
177
|
+
* clock. The frame is the pass's, in \`uHighlightMin.w\`.
|
|
163
178
|
*/
|
|
164
|
-
uniform vec4 uCutout;
|
|
179
|
+
uniform vec4 uCutout; // wgsl:material
|
|
165
180
|
/**
|
|
166
181
|
* A draw's own ambient, as nine spherical-harmonic coefficients of incoming radiance, red green blue
|
|
167
182
|
* in turn, twenty-seven floats, and in the last of the twenty-eight a 1 where they are on — 0 is the
|
|
@@ -169,7 +184,7 @@ uniform vec4 uCutout;
|
|
|
169
184
|
* and the basis, and its tests hold this to it. Seven rows of the material block, which is per draw
|
|
170
185
|
* as far as anything here is: \`setAmbientSH\` moves it between two draws as \`setMaterial\` does.
|
|
171
186
|
*/
|
|
172
|
-
uniform vec4 uAmbientSH[7];
|
|
187
|
+
uniform vec4 uAmbientSH[7]; // wgsl:material
|
|
173
188
|
|
|
174
189
|
/** The ambient a surface facing \`n\` receives from \`uAmbientSH\`: \`ambientFromSH\`'s arithmetic. */
|
|
175
190
|
vec3 ambientHarmonics(vec3 n) {
|
|
@@ -216,7 +231,7 @@ uniform highp sampler2DArray uNormalMap;
|
|
|
216
231
|
* shadow samplers, where a profile with shadows off should declare none of them; it is the wrong
|
|
217
232
|
* tool for one image on a shader that already declares one.
|
|
218
233
|
*/
|
|
219
|
-
uniform float uNormalStrength;
|
|
234
|
+
uniform float uNormalStrength; // wgsl:material
|
|
220
235
|
|
|
221
236
|
/**
|
|
222
237
|
* Occlusion, roughness and metallic in one image. glTF's packing, because that is what an import
|
|
@@ -237,7 +252,7 @@ uniform highp sampler2DArray uOrmMap;
|
|
|
237
252
|
* occlusionTexture.strength is: 1 + strength * (texel - 1). A multiply at 0 means fully occluded,
|
|
238
253
|
* which is the opposite of what a caller asking for no occlusion means.
|
|
239
254
|
*/
|
|
240
|
-
uniform vec3 uOrmScale;
|
|
255
|
+
uniform vec3 uOrmScale; // wgsl:material
|
|
241
256
|
/**
|
|
242
257
|
* 1 when \`uEnvironment\` holds the GGX-prefiltered cube, 0 when it holds the capture's box chain.
|
|
243
258
|
*
|
|
@@ -253,7 +268,7 @@ uniform vec3 uOrmScale;
|
|
|
253
268
|
* (\`uniformVectorBudget.ts\`). y is how much of the environment the material mirrors, z how
|
|
254
269
|
* bright what it mirrors is.
|
|
255
270
|
*/
|
|
256
|
-
uniform vec3 uEnvironmentDials;
|
|
271
|
+
uniform vec3 uEnvironmentDials; // wgsl:material
|
|
257
272
|
|
|
258
273
|
/**
|
|
259
274
|
* Where a surface glows, and in what colour.
|
|
@@ -275,7 +290,7 @@ uniform highp sampler2DArray uEmissiveMap;
|
|
|
275
290
|
* The counterpart of \`uOrmScale\`: a factor that multiplies a texture is not a value, and this is
|
|
276
291
|
* where the multiplier lives once an image supplies the shape.
|
|
277
292
|
*/
|
|
278
|
-
uniform vec3 uEmissiveScale;
|
|
293
|
+
uniform vec3 uEmissiveScale; // wgsl:material
|
|
279
294
|
|
|
280
295
|
#if DIRECTIONAL_SHADOWS
|
|
281
296
|
/*
|
|
@@ -362,7 +377,7 @@ uniform vec4 uSurfaceScene;
|
|
|
362
377
|
* draw moves it), y the night factor emission is gated on. One row where two floats were two
|
|
363
378
|
* (\`uniformVectorBudget.ts\`).
|
|
364
379
|
*/
|
|
365
|
-
uniform vec2 uEmission;
|
|
380
|
+
uniform vec2 uEmission; // wgsl:material
|
|
366
381
|
#if NIGHT_EMISSIVE
|
|
367
382
|
/**
|
|
368
383
|
* Emission that only shows where the dominant light does not reach. 0 is off and is the default.
|
|
@@ -387,7 +402,7 @@ uniform float uNightEmissive;
|
|
|
387
402
|
* of that to change one channel is how a renderer ends up with two shaders that
|
|
388
403
|
* disagree about the sun. The caller owns the blend state; this owns the number.
|
|
389
404
|
*/
|
|
390
|
-
uniform float uOpacity;
|
|
405
|
+
uniform float uOpacity; // wgsl:material
|
|
391
406
|
|
|
392
407
|
/**
|
|
393
408
|
* Two per-draw switches on how a fragment is *written* rather than what colour it is, sharing one
|
|
@@ -418,17 +433,30 @@ uniform float uOpacity;
|
|
|
418
433
|
* the grain is mirrored between backends and nothing else about it differs. What it gives up: a
|
|
419
434
|
* crossfade reads as grain for as long as it lasts, which is why it should be short; and a blended
|
|
420
435
|
* draw that asks for it is dithered too, since the test is a discard.
|
|
436
|
+
*
|
|
437
|
+
* **\`.z\` — whether this draw spends its own opacity on the same screen door**: 1 keeps the cells
|
|
438
|
+
* under \`vAlpha\` (an instance's \`MeshInstances.alphas\`, a vertex's channel alpha) and blends none
|
|
439
|
+
* of it, so an opaque or cut-out draw can fade one instance at a time. 0 is off. **The same pattern
|
|
440
|
+
* as the fade, and that is the point**: a pixel is kept where its one threshold sits under both, so
|
|
441
|
+
* a crossfade at \`t\` and \`-t\` of an instance at opacity \`a\` still covers each pixel of the
|
|
442
|
+
* instance's share \`a\` once. Two independent patterns would leave holes where they disagree.
|
|
421
443
|
*/
|
|
422
|
-
uniform
|
|
444
|
+
uniform vec3 uWriteMode; // wgsl:material
|
|
423
445
|
|
|
424
|
-
/**
|
|
425
|
-
|
|
446
|
+
/** Where this fragment's cell of the 8×8 Bayer pattern falls, in (0, 1). Integer arithmetic,
|
|
447
|
+
per the device rule. */
|
|
448
|
+
float ditherThreshold() {
|
|
426
449
|
uvec2 p = uvec2(gl_FragCoord.xy) & 7u;
|
|
427
450
|
uint a = p.x ^ p.y;
|
|
428
451
|
uint b = p.y;
|
|
429
452
|
uint cell = ((a & 1u) << 5) | ((b & 1u) << 4) | ((a & 2u) << 2) | ((b & 2u) << 1) |
|
|
430
453
|
((a & 4u) >> 1) | ((b & 4u) >> 2);
|
|
431
|
-
|
|
454
|
+
return (float(cell) + 0.5) / 64.0;
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
/** Whether this fragment is one \`uWriteMode.y\` keeps. */
|
|
458
|
+
bool ditherKeeps(float amount) {
|
|
459
|
+
float threshold = ditherThreshold();
|
|
432
460
|
return amount > 0.0 ? threshold < amount : threshold >= -amount;
|
|
433
461
|
}
|
|
434
462
|
|
|
@@ -452,7 +480,7 @@ bool ditherKeeps(float amount) {
|
|
|
452
480
|
* one uniform skips the untaken side rather than computing both and discarding one, which is
|
|
453
481
|
* only true because nothing here reads it through a *varying*-dependent branch.
|
|
454
482
|
*/
|
|
455
|
-
uniform int uLightingEnabled;
|
|
483
|
+
uniform int uLightingEnabled; // wgsl:material
|
|
456
484
|
/**
|
|
457
485
|
* How this draw meets the medium: the atmospheric haze and the underwater tint both, folded
|
|
458
486
|
* together because both are the *camera's* medium rather than a property of the surface — see
|
|
@@ -474,7 +502,7 @@ uniform int uLightingEnabled;
|
|
|
474
502
|
* is what "exactly as its colour says" has to mean for it; the cost is that such a draw will
|
|
475
503
|
* not tint if the camera goes under water, unlike everything else in the frame.
|
|
476
504
|
*/
|
|
477
|
-
uniform int uFogEnabled;
|
|
505
|
+
uniform int uFogEnabled; // wgsl:material
|
|
478
506
|
|
|
479
507
|
/**
|
|
480
508
|
* A pass-level scale over the grain the geometry declared, 0 to 1.
|
|
@@ -484,7 +512,7 @@ uniform int uFogEnabled;
|
|
|
484
512
|
* imported model that declares nothing is drawn with the pass's own answer, and a scene
|
|
485
513
|
* can dial a whole draw down without rebuilding its geometry.
|
|
486
514
|
*/
|
|
487
|
-
uniform float uGrain;
|
|
515
|
+
uniform float uGrain; // wgsl:material
|
|
488
516
|
/*
|
|
489
517
|
* The material's own relief: how strong, and how many bumps to a metre.
|
|
490
518
|
*
|
|
@@ -493,7 +521,7 @@ uniform float uGrain;
|
|
|
493
521
|
* between them, and the geometry carrying them is identical in all three cases. See
|
|
494
522
|
* Renderer.setSurfaceRelief. x is the strength and y the bumps to a metre, in one row.
|
|
495
523
|
*/
|
|
496
|
-
uniform vec2 uRelief;
|
|
524
|
+
uniform vec2 uRelief; // wgsl:material
|
|
497
525
|
/**
|
|
498
526
|
* How hard the bound surface texture's own luminance turns the shading normal, 0 for not at all.
|
|
499
527
|
*
|
|
@@ -516,7 +544,7 @@ uniform vec2 uRelief;
|
|
|
516
544
|
* 0..1 like its neighbours for the same reason: this is an amplitude against a luminance
|
|
517
545
|
* gradient, not a fraction of anything.
|
|
518
546
|
*/
|
|
519
|
-
uniform float uTextureRelief;
|
|
547
|
+
uniform float uTextureRelief; // wgsl:material
|
|
520
548
|
|
|
521
549
|
/**
|
|
522
550
|
* How much of the environment this material mirrors, 0 to 1.
|
|
@@ -651,8 +679,12 @@ uniform vec3 uProbeGridSets;
|
|
|
651
679
|
/**
|
|
652
680
|
* A world-space box that lights up regardless of time of day: its corners, and in the far corner's
|
|
653
681
|
* w the gain — one row where a loose float was another (\`uniformVectorBudget.ts\`).
|
|
682
|
+
*
|
|
683
|
+
* **And in the near corner's w the frame the cutout dither's pattern is offset by**, for the same
|
|
684
|
+
* reason: a row the lit stage already pays for, holding a number the pass sets and no material does.
|
|
685
|
+
* See \`uCutout\`.
|
|
654
686
|
*/
|
|
655
|
-
uniform
|
|
687
|
+
uniform vec4 uHighlightMin;
|
|
656
688
|
uniform vec4 uHighlightMax;
|
|
657
689
|
|
|
658
690
|
/*
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A material's maps placed by where a point is in the world rather than by the mesh's texture
|
|
3
|
+
* coordinates: `SurfaceMaterial.projection`, packed into `uWorldUv` by `surfaceProjection.ts`.
|
|
4
|
+
*
|
|
5
|
+
* **Planar** takes the two horizontal axes, `x` and `z`, at so many repeats a metre: a floor whose
|
|
6
|
+
* mesh carries no useful coordinates, or one coordinate for the whole of it, shows its texture at
|
|
7
|
+
* the size the material asks. **Triplanar** reads every map three times, on the planes across `x`,
|
|
8
|
+
* `y` and `z`, and blends them by how squarely the surface faces each — the geometric normal raised
|
|
9
|
+
* to a sharpness — so a wall, a cliff and a rock wear it as a floor does. A normal map on three
|
|
10
|
+
* planes is turned into the world by the whiteout blend, each plane's tangent-space normal added to
|
|
11
|
+
* the surface's own swizzled into that plane, which keeps the detail of each without a tangent
|
|
12
|
+
* frame per plane.
|
|
13
|
+
*
|
|
14
|
+
* **A lit switch, `WORLD_UVS`**, off until a material first asks and then on for good, declared
|
|
15
|
+
* last so every switch before it keeps its id. Compiled out, its vector is not declared and its
|
|
16
|
+
* calls are constants, so a scene that never asks pays nothing.
|
|
17
|
+
*
|
|
18
|
+
* **What it gives up**: a projection is the world's, so a mesh that moves slides under its own
|
|
19
|
+
* texture, which is right for ground and wrong for a crate; triplanar reads each map three times;
|
|
20
|
+
* and a map that is an array reads one layer for the whole surface, the one the face names.
|
|
21
|
+
*/
|
|
22
|
+
export declare function worldUvGlsl(on: boolean): string;
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A material's maps placed by where a point is in the world rather than by the mesh's texture
|
|
3
|
+
* coordinates: `SurfaceMaterial.projection`, packed into `uWorldUv` by `surfaceProjection.ts`.
|
|
4
|
+
*
|
|
5
|
+
* **Planar** takes the two horizontal axes, `x` and `z`, at so many repeats a metre: a floor whose
|
|
6
|
+
* mesh carries no useful coordinates, or one coordinate for the whole of it, shows its texture at
|
|
7
|
+
* the size the material asks. **Triplanar** reads every map three times, on the planes across `x`,
|
|
8
|
+
* `y` and `z`, and blends them by how squarely the surface faces each — the geometric normal raised
|
|
9
|
+
* to a sharpness — so a wall, a cliff and a rock wear it as a floor does. A normal map on three
|
|
10
|
+
* planes is turned into the world by the whiteout blend, each plane's tangent-space normal added to
|
|
11
|
+
* the surface's own swizzled into that plane, which keeps the detail of each without a tangent
|
|
12
|
+
* frame per plane.
|
|
13
|
+
*
|
|
14
|
+
* **A lit switch, `WORLD_UVS`**, off until a material first asks and then on for good, declared
|
|
15
|
+
* last so every switch before it keeps its id. Compiled out, its vector is not declared and its
|
|
16
|
+
* calls are constants, so a scene that never asks pays nothing.
|
|
17
|
+
*
|
|
18
|
+
* **What it gives up**: a projection is the world's, so a mesh that moves slides under its own
|
|
19
|
+
* texture, which is right for ground and wrong for a crate; triplanar reads each map three times;
|
|
20
|
+
* and a map that is an array reads one layer for the whole surface, the one the face names.
|
|
21
|
+
*/
|
|
22
|
+
export function worldUvGlsl(on) {
|
|
23
|
+
if (!on) {
|
|
24
|
+
return /* glsl */ `
|
|
25
|
+
const bool WORLD_UVS = false; // wgsl:override
|
|
26
|
+
bool projected() { return false; }
|
|
27
|
+
bool triplanar() { return false; }
|
|
28
|
+
vec2 planarAt() { return vec2(0.0); }
|
|
29
|
+
vec4 triplanarAlbedo(float layer) { return vec4(0.0); }
|
|
30
|
+
vec3 triplanarOrm(float layer) { return vec3(0.0); }
|
|
31
|
+
vec3 triplanarEmissive(float layer) { return vec3(0.0); }
|
|
32
|
+
vec3 triplanarNormal(vec3 n, float layer) { return n; }
|
|
33
|
+
`;
|
|
34
|
+
}
|
|
35
|
+
return /* glsl */ `
|
|
36
|
+
/* Whether this program places maps by the world. Off but where a material has asked: worldUv.ts. */
|
|
37
|
+
const bool WORLD_UVS = true; // wgsl:override
|
|
38
|
+
/* x: 0 the mesh's coordinates, 1 planar, 2 triplanar; y: repeats a metre; z: the blend's sharpness. */
|
|
39
|
+
uniform vec4 uWorldUv; // wgsl:material
|
|
40
|
+
|
|
41
|
+
bool projected() {
|
|
42
|
+
return uWorldUv.x > 0.5;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
bool triplanar() {
|
|
46
|
+
return uWorldUv.x > 1.5;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/* The horizontal axes, scaled: u along +x, v along +z. */
|
|
50
|
+
vec2 planarAt() {
|
|
51
|
+
return vWorldPos.xz * uWorldUv.y;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/* How much each plane counts: the geometric normal's components, sharpened, summing to one. */
|
|
55
|
+
vec3 triplanarWeights() {
|
|
56
|
+
vec3 w = pow(abs(normalize(vNormal)), vec3(uWorldUv.z));
|
|
57
|
+
return w / max(w.x + w.y + w.z, 1e-5);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/*
|
|
61
|
+
* Each map read on the three planes and blended: a function a map rather than one taking the
|
|
62
|
+
* sampler, whose precision differs between them. Under a branch on a uniform, as every map read
|
|
63
|
+
* is, so the implicit level each read takes is legal: AGENTS.md 2026-08-07.
|
|
64
|
+
*/
|
|
65
|
+
vec4 triplanarAlbedo(float layer) {
|
|
66
|
+
vec3 w = triplanarWeights();
|
|
67
|
+
vec3 p = vWorldPos * uWorldUv.y;
|
|
68
|
+
return texture(uAlbedo, vec3(p.zy, layer)) * w.x + texture(uAlbedo, vec3(p.xz, layer)) * w.y +
|
|
69
|
+
texture(uAlbedo, vec3(p.xy, layer)) * w.z;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
vec3 triplanarOrm(float layer) {
|
|
73
|
+
vec3 w = triplanarWeights();
|
|
74
|
+
vec3 p = vWorldPos * uWorldUv.y;
|
|
75
|
+
return texture(uOrmMap, vec3(p.zy, layer)).rgb * w.x +
|
|
76
|
+
texture(uOrmMap, vec3(p.xz, layer)).rgb * w.y + texture(uOrmMap, vec3(p.xy, layer)).rgb * w.z;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
vec3 triplanarEmissive(float layer) {
|
|
80
|
+
vec3 w = triplanarWeights();
|
|
81
|
+
vec3 p = vWorldPos * uWorldUv.y;
|
|
82
|
+
return texture(uEmissiveMap, vec3(p.zy, layer)).rgb * w.x +
|
|
83
|
+
texture(uEmissiveMap, vec3(p.xz, layer)).rgb * w.y +
|
|
84
|
+
texture(uEmissiveMap, vec3(p.xy, layer)).rgb * w.z;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/* A tangent-space normal off the map, its z rebuilt where a two-channel map stored none. */
|
|
88
|
+
vec3 triplanarTexel(vec2 at, float layer) {
|
|
89
|
+
vec3 t = texture(uNormalMap, vec3(at, layer)).xyz * 2.0 - 1.0;
|
|
90
|
+
t.z = t.z > 0.0 ? t.z : sqrt(max(0.0, 1.0 - dot(t.xy, t.xy)));
|
|
91
|
+
return t;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/*
|
|
95
|
+
* The normal map on three planes, by the whiteout blend: each plane's texel added to the surface
|
|
96
|
+
* normal swizzled into that plane, its z scaled by the normal's own, and swizzled back. Each plane's
|
|
97
|
+
* coordinates run along the same world axes from both sides, so a texel's axes are the world's and
|
|
98
|
+
* nothing is flipped; what that gives up is a texture mirrored on a plane's negative side.
|
|
99
|
+
*/
|
|
100
|
+
vec3 triplanarNormal(vec3 n, float layer) {
|
|
101
|
+
vec3 w = triplanarWeights();
|
|
102
|
+
vec3 p = vWorldPos * uWorldUv.y;
|
|
103
|
+
vec3 tx = triplanarTexel(p.zy, layer);
|
|
104
|
+
vec3 ty = triplanarTexel(p.xz, layer);
|
|
105
|
+
vec3 tz = triplanarTexel(p.xy, layer);
|
|
106
|
+
tx = vec3(tx.xy + n.zy, abs(tx.z) * n.x);
|
|
107
|
+
ty = vec3(ty.xy + n.xz, abs(ty.z) * n.y);
|
|
108
|
+
tz = vec3(tz.xy + n.xy, abs(tz.z) * n.z);
|
|
109
|
+
vec3 blended = normalize(tx.zyx * w.x + ty.xzy * w.y + tz.xyz * w.z);
|
|
110
|
+
return normalize(mix(n, blended, uNormalStrength));
|
|
111
|
+
}
|
|
112
|
+
`;
|
|
113
|
+
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export declare const DEPTH_CUTOUT_FRAG_WGSL = "struct Uniforms {\n uPeelShadowLayer: i32,\n}\n\nvar<private> vUv_1: vec3<f32>;\n@group(0) @binding(34) \nvar uCutoutMap_t: texture_2d_array<f32>;\n@group(0) @binding(35) \nvar uCutoutMap_s: sampler;\n@group(0) @binding(1) \nvar<uniform> unnamed: Uniforms;\nvar<private> vLightPosition_1: vec4<f32>;\n@group(0) @binding(32) \nvar uPreviousShadowMap_t: texture_2d_array<f32>;\n@group(0) @binding(33) \nvar uPreviousShadowMap_s: sampler;\nvar<private> gl_FragCoord_1: vec4<f32>;\nvar<private> vAlphaCutout_1: vec2<f32>;\n\nfn cutoutKeeps_u0028_f1_u003b_vf2_u003b_f1_u003b(share: ptr<function, f32>, pixel: ptr<function, vec2<f32>>, frame: ptr<function, f32>) -> bool {\n var p: vec2<f32>;\n var noise: f32;\n\n let _e31 = (*pixel);\n let _e32 = (*frame);\n p = (_e31 + vec2((5.588238f * _e32)));\n let _e36 = p;\n noise = fract((52.982918f * fract(dot(_e36, vec2<f32>(0.06711056f, 0.00583715f)))));\n let _e41 = (*share);\n let _e42 = noise;\n return (_e41 > _e42);\n}\n\nfn cutoutShare_u0028_f1_u003b_f1_u003b(alpha: ptr<function, f32>, cutoff: ptr<function, f32>) -> f32 {\n var band: f32;\n\n let _e29 = (*cutoff);\n let _e30 = (*cutoff);\n band = max((2f * min(_e29, (1f - _e30))), 0.0001f);\n let _e35 = (*alpha);\n let _e36 = (*cutoff);\n let _e38 = band;\n return clamp((((_e35 - _e36) / _e38) + 0.5f), 0f, 1f);\n}\n\nfn cutoutAlpha_u0028_f1_u003b_vf2_u003b(alpha_1: ptr<function, f32>, texels: ptr<function, vec2<f32>>) -> f32 {\n var dx: vec2<f32>;\n var dy: vec2<f32>;\n var level: f32;\n\n let _e31 = (*texels);\n let _e32 = dpdx(_e31);\n dx = _e32;\n let _e33 = (*texels);\n let _e34 = dpdy(_e33);\n dy = _e34;\n let _e35 = dx;\n let _e36 = dx;\n let _e38 = dy;\n let _e39 = dy;\n level = max(0f, (0.5f * log2(max(dot(_e35, _e36), dot(_e38, _e39)))));\n let _e45 = (*alpha_1);\n let _e46 = level;\n return (_e45 * (1f + (_e46 * 0.25f)));\n}\n\nfn main_1() {\n var at: vec3<f32>;\n var alpha_2: f32;\n var param: f32;\n var param_1: vec2<f32>;\n var p_1: vec3<f32>;\n var uv: vec2<f32>;\n var previousDepth: f32;\n var param_2: f32;\n var param_3: f32;\n var param_4: f32;\n var param_5: vec2<f32>;\n var param_6: f32;\n\n let _e38 = vUv_1;\n let _e39 = _e38.xy;\n let _e41 = vUv_1[2u];\n at = vec3<f32>(_e39.x, _e39.y, floor((_e41 + 0.5f)));\n let _e47 = at;\n let _e53 = textureSample(uCutoutMap_t, uCutoutMap_s, vec2<f32>(_e47.x, _e47.y), i32(_e47.z));\n let _e54 = vUv_1;\n let _e56 = textureDimensions(uCutoutMap_t, 0i);\n param = _e53.w;\n param_1 = (_e54.xy * vec2<f32>(vec2<i32>(_e56).xy));\n let _e62 = cutoutAlpha_u0028_f1_u003b_vf2_u003b((¶m), (¶m_1));\n alpha_2 = _e62;\n let _e64 = unnamed.uPeelShadowLayer;\n if (_e64 != 0i) {\n let _e66 = vLightPosition_1;\n let _e69 = vLightPosition_1[3u];\n p_1 = (_e66.xyz / vec3(_e69));\n let _e72 = p_1;\n uv = ((_e72.xy * 0.5f) + vec2(0.5f));\n let _e77 = uv;\n let _e80 = vec3<f32>(_e77.x, _e77.y, 0f);\n let _e86 = textureSampleLevel(uPreviousShadowMap_t, uPreviousShadowMap_s, vec2<f32>(_e80.x, _e80.y), i32(_e80.z), 0f);\n previousDepth = _e86.x;\n let _e89 = gl_FragCoord_1[2u];\n let _e90 = previousDepth;\n if (_e89 <= (_e90 + 0.00001f)) {\n discard;\n }\n }\n let _e94 = vAlphaCutout_1[1u];\n if (_e94 > 0.5f) {\n let _e96 = alpha_2;\n param_2 = _e96;\n let _e98 = vAlphaCutout_1[0u];\n param_3 = _e98;\n let _e99 = cutoutShare_u0028_f1_u003b_f1_u003b((¶m_2), (¶m_3));\n param_4 = _e99;\n let _e100 = gl_FragCoord_1;\n param_5 = _e100.xy;\n param_6 = 0f;\n let _e102 = cutoutKeeps_u0028_f1_u003b_vf2_u003b_f1_u003b((¶m_4), (¶m_5), (¶m_6));\n if !(_e102) {\n discard;\n }\n } else {\n let _e104 = alpha_2;\n let _e106 = vAlphaCutout_1[0u];\n if (_e104 < _e106) {\n discard;\n }\n }\n return;\n}\n\n@fragment \nfn main(@location(1) vUv: vec3<f32>, @location(0) vLightPosition: vec4<f32>, @builtin(position) gl_FragCoord: vec4<f32>, @location(2) @interpolate(flat) vAlphaCutout: vec2<f32>) {\n vUv_1 = vUv;\n vLightPosition_1 = vLightPosition;\n gl_FragCoord_1 = gl_FragCoord;\n vAlphaCutout_1 = vAlphaCutout;\n main_1();\n}\n";
|
|
2
2
|
export declare const DEPTH_CUTOUT_VERT_WGSL = "struct Uniforms {\n uLightViewProj: mat4x4<f32>,\n uModel: mat4x4<f32>,\n uWindDirection: vec2<f32>,\n uWindSpeed: f32,\n uWindGust: f32,\n uWindTime: f32,\n uWindSpatialPhase: vec2<f32>,\n uUvScale: vec2<f32>,\n uUvOffset: vec2<f32>,\n uAlphaCutout: vec2<f32>,\n}\n\nstruct gl_PerVertex {\n @builtin(position) gl_Position: vec4<f32>,\n gl_PointSize: f32,\n}\n\nstruct VertexOutput {\n @location(0) member: vec4<f32>,\n @builtin(position) gl_Position: vec4<f32>,\n @location(1) member_1: vec3<f32>,\n @location(2) @interpolate(flat) member_2: vec2<f32>,\n}\n\n@group(0) @binding(0) \nvar<uniform> unnamed: Uniforms;\nvar<private> aPosition_1: vec3<f32>;\nvar<private> aChannel_1: vec4<f32>;\nvar<private> vLightPosition: vec4<f32>;\nvar<private> unnamed_1: gl_PerVertex = gl_PerVertex(vec4<f32>(0f, 0f, 0f, 1f), 1f);\nvar<private> vUv: vec3<f32>;\nvar<private> aUv_1: vec3<f32>;\nvar<private> vAlphaCutout: vec2<f32>;\n\nfn channelBend_u0028_vf3_u003b_f1_u003b(worldPos: ptr<function, vec3<f32>>, sway: ptr<function, f32>) -> vec3<f32> {\n var phase: f32;\n var bend: f32;\n\n let _e28 = (*sway);\n if (_e28 <= 0f) {\n let _e30 = (*worldPos);\n return _e30;\n }\n let _e31 = (*worldPos);\n let _e34 = unnamed.uWindSpatialPhase;\n let _e37 = unnamed.uWindTime;\n phase = (dot(_e31.xz, _e34) + _e37);\n let _e40 = unnamed.uWindSpeed;\n let _e42 = unnamed.uWindGust;\n let _e44 = phase;\n let _e47 = (*sway);\n bend = (((_e40 + _e42) * sin(_e44)) * _e47);\n let _e50 = (*worldPos)[0u];\n let _e53 = unnamed.uWindDirection[0u];\n let _e54 = bend;\n let _e58 = (*worldPos)[1u];\n let _e60 = (*worldPos)[2u];\n let _e63 = unnamed.uWindDirection[1u];\n let _e64 = bend;\n return vec3<f32>((_e50 + (_e53 * _e54)), _e58, (_e60 + (_e63 * _e64)));\n}\n\nfn main_1() {\n var local: vec4<f32>;\n var model: mat4x4<f32>;\n var world: vec4<f32>;\n var bent: vec3<f32>;\n var param: vec3<f32>;\n var param_1: f32;\n\n let _e30 = aPosition_1;\n local = vec4<f32>(_e30.x, _e30.y, _e30.z, 1f);\n let _e36 = unnamed.uModel;\n model = _e36;\n let _e37 = model;\n let _e38 = local;\n world = (_e37 * _e38);\n let _e40 = world;\n param = _e40.xyz;\n let _e43 = aChannel_1[0u];\n param_1 = _e43;\n let _e44 = channelBend_u0028_vf3_u003b_f1_u003b((¶m), (¶m_1));\n bent = _e44;\n let _e46 = unnamed.uLightViewProj;\n let _e47 = bent;\n let _e49 = world[3u];\n vLightPosition = (_e46 * vec4<f32>(_e47.x, _e47.y, _e47.z, _e49));\n let _e55 = vLightPosition;\n unnamed_1.gl_Position = _e55;\n let _e57 = aUv_1;\n let _e60 = unnamed.uUvScale;\n let _e63 = unnamed.uUvOffset;\n let _e64 = ((_e57.xy * _e60) + _e63);\n let _e66 = aUv_1[2u];\n vUv = vec3<f32>(_e64.x, _e64.y, _e66);\n let _e71 = unnamed.uAlphaCutout;\n vAlphaCutout = _e71;\n return;\n}\n\n@vertex \nfn main(@location(0) aPosition: vec3<f32>, @location(13) aChannel: vec4<f32>, @location(5) aUv: vec3<f32>) -> VertexOutput {\n aPosition_1 = aPosition;\n aChannel_1 = aChannel;\n aUv_1 = aUv;\n main_1();\n let _e12 = unnamed_1.gl_Position.y;\n unnamed_1.gl_Position.y = -(_e12);\n let _e14 = vLightPosition;\n let _e15 = unnamed_1.gl_Position;\n let _e16 = vUv;\n let _e17 = vAlphaCutout;\n return VertexOutput(_e14, _e15, _e16, _e17);\n}\n";
|
|
3
3
|
export declare const DEPTH_FRAG_WGSL = "struct Uniforms {\n uPeelShadowLayer: i32,\n}\n\n@group(0) @binding(1) \nvar<uniform> unnamed: Uniforms;\nvar<private> vLightPosition_1: vec4<f32>;\n@group(0) @binding(32) \nvar uPreviousShadowMap_t: texture_2d_array<f32>;\n@group(0) @binding(33) \nvar uPreviousShadowMap_s: sampler;\nvar<private> gl_FragCoord_1: vec4<f32>;\n\nfn main_1() {\n var p: vec3<f32>;\n var uv: vec2<f32>;\n var previousDepth: f32;\n\n let _e16 = unnamed.uPeelShadowLayer;\n if (_e16 != 0i) {\n let _e18 = vLightPosition_1;\n let _e21 = vLightPosition_1[3u];\n p = (_e18.xyz / vec3(_e21));\n let _e24 = p;\n uv = ((_e24.xy * 0.5f) + vec2(0.5f));\n let _e29 = uv;\n let _e32 = vec3<f32>(_e29.x, _e29.y, 0f);\n let _e38 = textureSample(uPreviousShadowMap_t, uPreviousShadowMap_s, vec2<f32>(_e32.x, _e32.y), i32(_e32.z));\n previousDepth = _e38.x;\n let _e41 = gl_FragCoord_1[2u];\n let _e42 = previousDepth;\n if (_e41 <= (_e42 + 0.00001f)) {\n discard;\n }\n }\n return;\n}\n\n@fragment \nfn main(@location(0) vLightPosition: vec4<f32>, @builtin(position) gl_FragCoord: vec4<f32>) {\n vLightPosition_1 = vLightPosition;\n gl_FragCoord_1 = gl_FragCoord;\n main_1();\n}\n";
|
|
4
|
+
export declare const DEPTH_INSTANCED_ANIMATED_CUTOUT_VERT_WGSL = "struct Uniforms {\n uLightViewProj: mat4x4<f32>,\n uUvScale: vec2<f32>,\n uUvOffset: vec2<f32>,\n uAlphaCutout: vec2<f32>,\n uSceneTime: f32,\n uBoneClip: vec2<f32>,\n}\n\nstruct gl_PerVertex {\n @builtin(position) gl_Position: vec4<f32>,\n gl_PointSize: f32,\n}\n\nstruct VertexOutput {\n @location(0) member: vec4<f32>,\n @builtin(position) gl_Position: vec4<f32>,\n @location(1) member_1: vec3<f32>,\n @location(2) @interpolate(flat) member_2: vec2<f32>,\n}\n\n@group(0) @binding(16) \nvar uBonePlaces_t: texture_2d<f32>;\n@group(0) @binding(20) \nvar uInstanceClocks_t: texture_2d<f32>;\nvar<private> gl_InstanceIndex_1: i32;\n@group(0) @binding(0) \nvar<uniform> unnamed: Uniforms;\nvar<private> aGrain_1: f32;\n@group(0) @binding(18) \nvar uBoneTurns_t: texture_2d<f32>;\nvar<private> aPosition_1: vec3<f32>;\nvar<private> aInstanceModel0_1: vec4<f32>;\nvar<private> aInstanceModel1_1: vec4<f32>;\nvar<private> aInstanceModel2_1: vec4<f32>;\nvar<private> aInstanceModel3_1: vec4<f32>;\nvar<private> vLightPosition: vec4<f32>;\nvar<private> unnamed_1: gl_PerVertex = gl_PerVertex(vec4<f32>(0f, 0f, 0f, 1f), 1f);\nvar<private> vUv: vec3<f32>;\nvar<private> aUv_1: vec3<f32>;\nvar<private> vAlphaCutout: vec2<f32>;\n@group(0) @binding(17) \nvar uBonePlaces_s: sampler;\n@group(0) @binding(19) \nvar uBoneTurns_s: sampler;\n@group(0) @binding(21) \nvar uInstanceClocks_s: sampler;\n\nfn boneTurn_u0028_vf4_u003b_vf3_u003b(q: ptr<function, vec4<f32>>, v: ptr<function, vec3<f32>>) -> vec3<f32> {\n let _e38 = (*v);\n let _e39 = (*q);\n let _e41 = (*q);\n let _e43 = (*v);\n let _e46 = (*q)[3u];\n let _e47 = (*v);\n return (_e38 + (cross(_e39.xyz, (cross(_e41.xyz, _e43) + (_e47 * _e46))) * 2f));\n}\n\nfn boneAnimate_u0028_vf3_u003b_vf3_u003b_vf3_u003b(position: ptr<function, vec3<f32>>, normal: ptr<function, vec3<f32>>, tangent: ptr<function, vec3<f32>>) -> vec3<f32> {\n var size: vec2<i32>;\n var clocksWidth: i32;\n var clock: vec2<f32>;\n var moment: f32;\n var frames: f32;\n var wrapped: f32;\n var first: i32;\n var second: i32;\n var local: i32;\n var blend: f32;\n var bone: i32;\n var q0_: vec4<f32>;\n var q1_: vec4<f32>;\n var q_1: vec4<f32>;\n var place: vec3<f32>;\n var param: vec4<f32>;\n var param_1: vec3<f32>;\n var param_2: vec4<f32>;\n var param_3: vec3<f32>;\n var param_4: vec4<f32>;\n var param_5: vec3<f32>;\n\n let _e60 = textureDimensions(uBonePlaces_t, 0i);\n size = vec2<i32>(_e60);\n let _e62 = textureDimensions(uInstanceClocks_t, 0i);\n clocksWidth = vec2<i32>(_e62).x;\n let _e65 = gl_InstanceIndex_1;\n let _e66 = clocksWidth;\n let _e74 = gl_InstanceIndex_1;\n let _e75 = clocksWidth;\n let _e78 = textureLoad(uInstanceClocks_t, vec2<i32>((_e65 - (i32(floor((f32(_e65) / f32(_e66)))) * _e66)), (_e74 / _e75)), 0i);\n clock = _e78.xy;\n let _e81 = unnamed.uSceneTime;\n let _e83 = clock[1u];\n let _e86 = clock[0u];\n let _e90 = unnamed.uBoneClip[0u];\n moment = (((_e81 * _e83) + _e86) * _e90);\n let _e93 = size[1u];\n frames = f32(_e93);\n let _e95 = moment;\n let _e96 = frames;\n let _e97 = moment;\n let _e98 = frames;\n wrapped = (_e95 - (_e96 * floor((_e97 / _e98))));\n let _e103 = wrapped;\n let _e107 = size[1u];\n first = min(i32(floor(_e103)), (_e107 - 1i));\n let _e110 = first;\n let _e113 = size[1u];\n if ((_e110 + 1i) == _e113) {\n local = 0i;\n } else {\n let _e115 = first;\n local = (_e115 + 1i);\n }\n let _e117 = local;\n second = _e117;\n let _e118 = wrapped;\n let _e119 = first;\n blend = clamp((_e118 - f32(_e119)), 0f, 1f);\n let _e123 = aGrain_1;\n let _e127 = unnamed.uBoneClip[1u];\n let _e133 = size[0u];\n bone = clamp(i32(floor((((-1f - _e123) * _e127) + 0.5f))), 0i, (_e133 - 1i));\n let _e136 = bone;\n let _e137 = first;\n let _e139 = textureLoad(uBoneTurns_t, vec2<i32>(_e136, _e137), 0i);\n q0_ = _e139;\n let _e140 = bone;\n let _e141 = second;\n let _e143 = textureLoad(uBoneTurns_t, vec2<i32>(_e140, _e141), 0i);\n q1_ = _e143;\n let _e144 = q0_;\n let _e145 = q1_;\n if (dot(_e144, _e145) < 0f) {\n let _e148 = q1_;\n q1_ = -(_e148);\n }\n let _e150 = q0_;\n let _e151 = q1_;\n let _e152 = blend;\n q_1 = normalize(mix(_e150, _e151, vec4(_e152)));\n let _e156 = bone;\n let _e157 = first;\n let _e159 = textureLoad(uBonePlaces_t, vec2<i32>(_e156, _e157), 0i);\n let _e161 = bone;\n let _e162 = second;\n let _e164 = textureLoad(uBonePlaces_t, vec2<i32>(_e161, _e162), 0i);\n let _e166 = blend;\n place = mix(_e159.xyz, _e164.xyz, vec3(_e166));\n let _e169 = q_1;\n param = _e169;\n let _e170 = (*normal);\n param_1 = _e170;\n let _e171 = boneTurn_u0028_vf4_u003b_vf3_u003b((¶m), (¶m_1));\n (*normal) = _e171;\n let _e172 = q_1;\n param_2 = _e172;\n let _e173 = (*tangent);\n param_3 = _e173;\n let _e174 = boneTurn_u0028_vf4_u003b_vf3_u003b((¶m_2), (¶m_3));\n (*tangent) = _e174;\n let _e175 = q_1;\n param_4 = _e175;\n let _e176 = (*position);\n param_5 = _e176;\n let _e177 = boneTurn_u0028_vf4_u003b_vf3_u003b((¶m_4), (¶m_5));\n let _e178 = place;\n return (_e177 + _e178);\n}\n\nfn main_1() {\n var local_1: vec4<f32>;\n var animatedNormal: vec3<f32>;\n var animatedTangent: vec3<f32>;\n var param_6: vec3<f32>;\n var param_7: vec3<f32>;\n var param_8: vec3<f32>;\n var model: mat4x4<f32>;\n var instanceCell: vec4<f32>;\n var world: vec4<f32>;\n var bent: vec3<f32>;\n\n let _e46 = aPosition_1;\n local_1 = vec4<f32>(_e46.x, _e46.y, _e46.z, 1f);\n animatedNormal = vec3<f32>(0f, 1f, 0f);\n animatedTangent = vec3<f32>(1f, 0f, 0f);\n let _e51 = local_1;\n param_6 = _e51.xyz;\n let _e53 = animatedNormal;\n param_7 = _e53;\n let _e54 = animatedTangent;\n param_8 = _e54;\n let _e55 = boneAnimate_u0028_vf3_u003b_vf3_u003b_vf3_u003b((¶m_6), (¶m_7), (¶m_8));\n let _e56 = param_7;\n animatedNormal = _e56;\n let _e57 = param_8;\n animatedTangent = _e57;\n local_1 = vec4<f32>(_e55.x, _e55.y, _e55.z, 1f);\n let _e62 = aInstanceModel0_1;\n let _e63 = aInstanceModel1_1;\n let _e64 = aInstanceModel2_1;\n let _e65 = aInstanceModel3_1;\n model = mat4x4<f32>(vec4<f32>(_e62.x, _e62.y, _e62.z, _e62.w), vec4<f32>(_e63.x, _e63.y, _e63.z, _e63.w), vec4<f32>(_e64.x, _e64.y, _e64.z, _e64.w), vec4<f32>(_e65.x, _e65.y, _e65.z, _e65.w));\n let _e89 = model[0][3u];\n let _e92 = model[1][3u];\n let _e95 = model[2][3u];\n let _e98 = model[3][3u];\n instanceCell = vec4<f32>(_e89, _e92, _e95, _e98);\n model[0][3u] = 0f;\n model[1][3u] = 0f;\n model[2][3u] = 0f;\n model[3][3u] = 1f;\n let _e108 = model;\n let _e109 = local_1;\n world = (_e108 * _e109);\n let _e111 = world;\n bent = _e111.xyz;\n let _e114 = unnamed.uLightViewProj;\n let _e115 = bent;\n let _e117 = world[3u];\n vLightPosition = (_e114 * vec4<f32>(_e115.x, _e115.y, _e115.z, _e117));\n let _e123 = vLightPosition;\n unnamed_1.gl_Position = _e123;\n let _e125 = aUv_1;\n let _e127 = instanceCell;\n let _e130 = instanceCell;\n let _e134 = unnamed.uUvScale;\n let _e137 = unnamed.uUvOffset;\n let _e138 = ((((_e125.xy * _e127.xy) + _e130.zw) * _e134) + _e137);\n let _e140 = aUv_1[2u];\n vUv = vec3<f32>(_e138.x, _e138.y, _e140);\n let _e145 = unnamed.uAlphaCutout;\n vAlphaCutout = _e145;\n return;\n}\n\n@vertex \nfn main(@builtin(instance_index) gl_InstanceIndex: u32, @location(8) aGrain: f32, @location(0) aPosition: vec3<f32>, @location(11) aInstanceModel0_: vec4<f32>, @location(12) aInstanceModel1_: vec4<f32>, @location(13) aInstanceModel2_: vec4<f32>, @location(14) aInstanceModel3_: vec4<f32>, @location(5) aUv: vec3<f32>) -> VertexOutput {\n gl_InstanceIndex_1 = i32(gl_InstanceIndex);\n aGrain_1 = aGrain;\n aPosition_1 = aPosition;\n aInstanceModel0_1 = aInstanceModel0_;\n aInstanceModel1_1 = aInstanceModel1_;\n aInstanceModel2_1 = aInstanceModel2_;\n aInstanceModel3_1 = aInstanceModel3_;\n aUv_1 = aUv;\n main_1();\n let _e23 = unnamed_1.gl_Position.y;\n unnamed_1.gl_Position.y = -(_e23);\n let _e25 = vLightPosition;\n let _e26 = unnamed_1.gl_Position;\n let _e27 = vUv;\n let _e28 = vAlphaCutout;\n return VertexOutput(_e25, _e26, _e27, _e28);\n}\n";
|
|
5
|
+
export declare const DEPTH_INSTANCED_ANIMATED_VERT_WGSL = "struct Uniforms {\n uLightViewProj: mat4x4<f32>,\n uSceneTime: f32,\n uBoneClip: vec2<f32>,\n}\n\nstruct gl_PerVertex {\n @builtin(position) gl_Position: vec4<f32>,\n gl_PointSize: f32,\n}\n\nstruct VertexOutput {\n @location(0) member: vec4<f32>,\n @builtin(position) gl_Position: vec4<f32>,\n}\n\n@group(0) @binding(16) \nvar uBonePlaces_t: texture_2d<f32>;\n@group(0) @binding(20) \nvar uInstanceClocks_t: texture_2d<f32>;\nvar<private> gl_InstanceIndex_1: i32;\n@group(0) @binding(0) \nvar<uniform> unnamed: Uniforms;\nvar<private> aGrain_1: f32;\n@group(0) @binding(18) \nvar uBoneTurns_t: texture_2d<f32>;\nvar<private> aPosition_1: vec3<f32>;\nvar<private> aInstanceModel0_1: vec4<f32>;\nvar<private> aInstanceModel1_1: vec4<f32>;\nvar<private> aInstanceModel2_1: vec4<f32>;\nvar<private> aInstanceModel3_1: vec4<f32>;\nvar<private> vLightPosition: vec4<f32>;\nvar<private> unnamed_1: gl_PerVertex = gl_PerVertex(vec4<f32>(0f, 0f, 0f, 1f), 1f);\n@group(0) @binding(17) \nvar uBonePlaces_s: sampler;\n@group(0) @binding(19) \nvar uBoneTurns_s: sampler;\n@group(0) @binding(21) \nvar uInstanceClocks_s: sampler;\n\nfn boneTurn_u0028_vf4_u003b_vf3_u003b(q: ptr<function, vec4<f32>>, v: ptr<function, vec3<f32>>) -> vec3<f32> {\n let _e32 = (*v);\n let _e33 = (*q);\n let _e35 = (*q);\n let _e37 = (*v);\n let _e40 = (*q)[3u];\n let _e41 = (*v);\n return (_e32 + (cross(_e33.xyz, (cross(_e35.xyz, _e37) + (_e41 * _e40))) * 2f));\n}\n\nfn boneAnimate_u0028_vf3_u003b_vf3_u003b_vf3_u003b(position: ptr<function, vec3<f32>>, normal: ptr<function, vec3<f32>>, tangent: ptr<function, vec3<f32>>) -> vec3<f32> {\n var size: vec2<i32>;\n var clocksWidth: i32;\n var clock: vec2<f32>;\n var moment: f32;\n var frames: f32;\n var wrapped: f32;\n var first: i32;\n var second: i32;\n var local: i32;\n var blend: f32;\n var bone: i32;\n var q0_: vec4<f32>;\n var q1_: vec4<f32>;\n var q_1: vec4<f32>;\n var place: vec3<f32>;\n var param: vec4<f32>;\n var param_1: vec3<f32>;\n var param_2: vec4<f32>;\n var param_3: vec3<f32>;\n var param_4: vec4<f32>;\n var param_5: vec3<f32>;\n\n let _e54 = textureDimensions(uBonePlaces_t, 0i);\n size = vec2<i32>(_e54);\n let _e56 = textureDimensions(uInstanceClocks_t, 0i);\n clocksWidth = vec2<i32>(_e56).x;\n let _e59 = gl_InstanceIndex_1;\n let _e60 = clocksWidth;\n let _e68 = gl_InstanceIndex_1;\n let _e69 = clocksWidth;\n let _e72 = textureLoad(uInstanceClocks_t, vec2<i32>((_e59 - (i32(floor((f32(_e59) / f32(_e60)))) * _e60)), (_e68 / _e69)), 0i);\n clock = _e72.xy;\n let _e75 = unnamed.uSceneTime;\n let _e77 = clock[1u];\n let _e80 = clock[0u];\n let _e84 = unnamed.uBoneClip[0u];\n moment = (((_e75 * _e77) + _e80) * _e84);\n let _e87 = size[1u];\n frames = f32(_e87);\n let _e89 = moment;\n let _e90 = frames;\n let _e91 = moment;\n let _e92 = frames;\n wrapped = (_e89 - (_e90 * floor((_e91 / _e92))));\n let _e97 = wrapped;\n let _e101 = size[1u];\n first = min(i32(floor(_e97)), (_e101 - 1i));\n let _e104 = first;\n let _e107 = size[1u];\n if ((_e104 + 1i) == _e107) {\n local = 0i;\n } else {\n let _e109 = first;\n local = (_e109 + 1i);\n }\n let _e111 = local;\n second = _e111;\n let _e112 = wrapped;\n let _e113 = first;\n blend = clamp((_e112 - f32(_e113)), 0f, 1f);\n let _e117 = aGrain_1;\n let _e121 = unnamed.uBoneClip[1u];\n let _e127 = size[0u];\n bone = clamp(i32(floor((((-1f - _e117) * _e121) + 0.5f))), 0i, (_e127 - 1i));\n let _e130 = bone;\n let _e131 = first;\n let _e133 = textureLoad(uBoneTurns_t, vec2<i32>(_e130, _e131), 0i);\n q0_ = _e133;\n let _e134 = bone;\n let _e135 = second;\n let _e137 = textureLoad(uBoneTurns_t, vec2<i32>(_e134, _e135), 0i);\n q1_ = _e137;\n let _e138 = q0_;\n let _e139 = q1_;\n if (dot(_e138, _e139) < 0f) {\n let _e142 = q1_;\n q1_ = -(_e142);\n }\n let _e144 = q0_;\n let _e145 = q1_;\n let _e146 = blend;\n q_1 = normalize(mix(_e144, _e145, vec4(_e146)));\n let _e150 = bone;\n let _e151 = first;\n let _e153 = textureLoad(uBonePlaces_t, vec2<i32>(_e150, _e151), 0i);\n let _e155 = bone;\n let _e156 = second;\n let _e158 = textureLoad(uBonePlaces_t, vec2<i32>(_e155, _e156), 0i);\n let _e160 = blend;\n place = mix(_e153.xyz, _e158.xyz, vec3(_e160));\n let _e163 = q_1;\n param = _e163;\n let _e164 = (*normal);\n param_1 = _e164;\n let _e165 = boneTurn_u0028_vf4_u003b_vf3_u003b((¶m), (¶m_1));\n (*normal) = _e165;\n let _e166 = q_1;\n param_2 = _e166;\n let _e167 = (*tangent);\n param_3 = _e167;\n let _e168 = boneTurn_u0028_vf4_u003b_vf3_u003b((¶m_2), (¶m_3));\n (*tangent) = _e168;\n let _e169 = q_1;\n param_4 = _e169;\n let _e170 = (*position);\n param_5 = _e170;\n let _e171 = boneTurn_u0028_vf4_u003b_vf3_u003b((¶m_4), (¶m_5));\n let _e172 = place;\n return (_e171 + _e172);\n}\n\nfn main_1() {\n var local_1: vec4<f32>;\n var animatedNormal: vec3<f32>;\n var animatedTangent: vec3<f32>;\n var param_6: vec3<f32>;\n var param_7: vec3<f32>;\n var param_8: vec3<f32>;\n var model: mat4x4<f32>;\n var instanceCell: vec4<f32>;\n var world: vec4<f32>;\n var bent: vec3<f32>;\n\n let _e40 = aPosition_1;\n local_1 = vec4<f32>(_e40.x, _e40.y, _e40.z, 1f);\n animatedNormal = vec3<f32>(0f, 1f, 0f);\n animatedTangent = vec3<f32>(1f, 0f, 0f);\n let _e45 = local_1;\n param_6 = _e45.xyz;\n let _e47 = animatedNormal;\n param_7 = _e47;\n let _e48 = animatedTangent;\n param_8 = _e48;\n let _e49 = boneAnimate_u0028_vf3_u003b_vf3_u003b_vf3_u003b((¶m_6), (¶m_7), (¶m_8));\n let _e50 = param_7;\n animatedNormal = _e50;\n let _e51 = param_8;\n animatedTangent = _e51;\n local_1 = vec4<f32>(_e49.x, _e49.y, _e49.z, 1f);\n let _e56 = aInstanceModel0_1;\n let _e57 = aInstanceModel1_1;\n let _e58 = aInstanceModel2_1;\n let _e59 = aInstanceModel3_1;\n model = mat4x4<f32>(vec4<f32>(_e56.x, _e56.y, _e56.z, _e56.w), vec4<f32>(_e57.x, _e57.y, _e57.z, _e57.w), vec4<f32>(_e58.x, _e58.y, _e58.z, _e58.w), vec4<f32>(_e59.x, _e59.y, _e59.z, _e59.w));\n let _e83 = model[0][3u];\n let _e86 = model[1][3u];\n let _e89 = model[2][3u];\n let _e92 = model[3][3u];\n instanceCell = vec4<f32>(_e83, _e86, _e89, _e92);\n model[0][3u] = 0f;\n model[1][3u] = 0f;\n model[2][3u] = 0f;\n model[3][3u] = 1f;\n let _e102 = model;\n let _e103 = local_1;\n world = (_e102 * _e103);\n let _e105 = world;\n bent = _e105.xyz;\n let _e108 = unnamed.uLightViewProj;\n let _e109 = bent;\n let _e111 = world[3u];\n vLightPosition = (_e108 * vec4<f32>(_e109.x, _e109.y, _e109.z, _e111));\n let _e117 = vLightPosition;\n unnamed_1.gl_Position = _e117;\n return;\n}\n\n@vertex \nfn main(@builtin(instance_index) gl_InstanceIndex: u32, @location(8) aGrain: f32, @location(0) aPosition: vec3<f32>, @location(11) aInstanceModel0_: vec4<f32>, @location(12) aInstanceModel1_: vec4<f32>, @location(13) aInstanceModel2_: vec4<f32>, @location(14) aInstanceModel3_: vec4<f32>) -> VertexOutput {\n gl_InstanceIndex_1 = i32(gl_InstanceIndex);\n aGrain_1 = aGrain;\n aPosition_1 = aPosition;\n aInstanceModel0_1 = aInstanceModel0_;\n aInstanceModel1_1 = aInstanceModel1_;\n aInstanceModel2_1 = aInstanceModel2_;\n aInstanceModel3_1 = aInstanceModel3_;\n main_1();\n let _e19 = unnamed_1.gl_Position.y;\n unnamed_1.gl_Position.y = -(_e19);\n let _e21 = vLightPosition;\n let _e22 = unnamed_1.gl_Position;\n return VertexOutput(_e21, _e22);\n}\n";
|
|
4
6
|
export declare const DEPTH_INSTANCED_CUTOUT_VERT_WGSL = "struct Uniforms {\n uLightViewProj: mat4x4<f32>,\n uUvScale: vec2<f32>,\n uUvOffset: vec2<f32>,\n uAlphaCutout: vec2<f32>,\n}\n\nstruct gl_PerVertex {\n @builtin(position) gl_Position: vec4<f32>,\n gl_PointSize: f32,\n}\n\nstruct VertexOutput {\n @location(0) member: vec4<f32>,\n @builtin(position) gl_Position: vec4<f32>,\n @location(1) member_1: vec3<f32>,\n @location(2) @interpolate(flat) member_2: vec2<f32>,\n}\n\nvar<private> aPosition_1: vec3<f32>;\nvar<private> aInstanceModel0_1: vec4<f32>;\nvar<private> aInstanceModel1_1: vec4<f32>;\nvar<private> aInstanceModel2_1: vec4<f32>;\nvar<private> aInstanceModel3_1: vec4<f32>;\nvar<private> vLightPosition: vec4<f32>;\n@group(0) @binding(0) \nvar<uniform> unnamed: Uniforms;\nvar<private> unnamed_1: gl_PerVertex = gl_PerVertex(vec4<f32>(0f, 0f, 0f, 1f), 1f);\nvar<private> vUv: vec3<f32>;\nvar<private> aUv_1: vec3<f32>;\nvar<private> vAlphaCutout: vec2<f32>;\n\nfn main_1() {\n var local: vec4<f32>;\n var model: mat4x4<f32>;\n var instanceCell: vec4<f32>;\n var world: vec4<f32>;\n var bent: vec3<f32>;\n\n let _e24 = aPosition_1;\n local = vec4<f32>(_e24.x, _e24.y, _e24.z, 1f);\n let _e29 = aInstanceModel0_1;\n let _e30 = aInstanceModel1_1;\n let _e31 = aInstanceModel2_1;\n let _e32 = aInstanceModel3_1;\n model = mat4x4<f32>(vec4<f32>(_e29.x, _e29.y, _e29.z, _e29.w), vec4<f32>(_e30.x, _e30.y, _e30.z, _e30.w), vec4<f32>(_e31.x, _e31.y, _e31.z, _e31.w), vec4<f32>(_e32.x, _e32.y, _e32.z, _e32.w));\n let _e56 = model[0][3u];\n let _e59 = model[1][3u];\n let _e62 = model[2][3u];\n let _e65 = model[3][3u];\n instanceCell = vec4<f32>(_e56, _e59, _e62, _e65);\n model[0][3u] = 0f;\n model[1][3u] = 0f;\n model[2][3u] = 0f;\n model[3][3u] = 1f;\n let _e75 = model;\n let _e76 = local;\n world = (_e75 * _e76);\n let _e78 = world;\n bent = _e78.xyz;\n let _e81 = unnamed.uLightViewProj;\n let _e82 = bent;\n let _e84 = world[3u];\n vLightPosition = (_e81 * vec4<f32>(_e82.x, _e82.y, _e82.z, _e84));\n let _e90 = vLightPosition;\n unnamed_1.gl_Position = _e90;\n let _e92 = aUv_1;\n let _e94 = instanceCell;\n let _e97 = instanceCell;\n let _e101 = unnamed.uUvScale;\n let _e104 = unnamed.uUvOffset;\n let _e105 = ((((_e92.xy * _e94.xy) + _e97.zw) * _e101) + _e104);\n let _e107 = aUv_1[2u];\n vUv = vec3<f32>(_e105.x, _e105.y, _e107);\n let _e112 = unnamed.uAlphaCutout;\n vAlphaCutout = _e112;\n return;\n}\n\n@vertex \nfn main(@location(0) aPosition: vec3<f32>, @location(11) aInstanceModel0_: vec4<f32>, @location(12) aInstanceModel1_: vec4<f32>, @location(13) aInstanceModel2_: vec4<f32>, @location(14) aInstanceModel3_: vec4<f32>, @location(5) aUv: vec3<f32>) -> VertexOutput {\n aPosition_1 = aPosition;\n aInstanceModel0_1 = aInstanceModel0_;\n aInstanceModel1_1 = aInstanceModel1_;\n aInstanceModel2_1 = aInstanceModel2_;\n aInstanceModel3_1 = aInstanceModel3_;\n aUv_1 = aUv;\n main_1();\n let _e18 = unnamed_1.gl_Position.y;\n unnamed_1.gl_Position.y = -(_e18);\n let _e20 = vLightPosition;\n let _e21 = unnamed_1.gl_Position;\n let _e22 = vUv;\n let _e23 = vAlphaCutout;\n return VertexOutput(_e20, _e21, _e22, _e23);\n}\n";
|
|
5
7
|
export declare const DEPTH_INSTANCED_VERT_WGSL = "struct Uniforms {\n uLightViewProj: mat4x4<f32>,\n}\n\nstruct gl_PerVertex {\n @builtin(position) gl_Position: vec4<f32>,\n gl_PointSize: f32,\n}\n\nstruct VertexOutput {\n @location(0) member: vec4<f32>,\n @builtin(position) gl_Position: vec4<f32>,\n}\n\nvar<private> aPosition_1: vec3<f32>;\nvar<private> aInstanceModel0_1: vec4<f32>;\nvar<private> aInstanceModel1_1: vec4<f32>;\nvar<private> aInstanceModel2_1: vec4<f32>;\nvar<private> aInstanceModel3_1: vec4<f32>;\nvar<private> vLightPosition: vec4<f32>;\n@group(0) @binding(0) \nvar<uniform> unnamed: Uniforms;\nvar<private> unnamed_1: gl_PerVertex = gl_PerVertex(vec4<f32>(0f, 0f, 0f, 1f), 1f);\n\nfn main_1() {\n var local: vec4<f32>;\n var model: mat4x4<f32>;\n var instanceCell: vec4<f32>;\n var world: vec4<f32>;\n var bent: vec3<f32>;\n\n let _e20 = aPosition_1;\n local = vec4<f32>(_e20.x, _e20.y, _e20.z, 1f);\n let _e25 = aInstanceModel0_1;\n let _e26 = aInstanceModel1_1;\n let _e27 = aInstanceModel2_1;\n let _e28 = aInstanceModel3_1;\n model = mat4x4<f32>(vec4<f32>(_e25.x, _e25.y, _e25.z, _e25.w), vec4<f32>(_e26.x, _e26.y, _e26.z, _e26.w), vec4<f32>(_e27.x, _e27.y, _e27.z, _e27.w), vec4<f32>(_e28.x, _e28.y, _e28.z, _e28.w));\n let _e52 = model[0][3u];\n let _e55 = model[1][3u];\n let _e58 = model[2][3u];\n let _e61 = model[3][3u];\n instanceCell = vec4<f32>(_e52, _e55, _e58, _e61);\n model[0][3u] = 0f;\n model[1][3u] = 0f;\n model[2][3u] = 0f;\n model[3][3u] = 1f;\n let _e71 = model;\n let _e72 = local;\n world = (_e71 * _e72);\n let _e74 = world;\n bent = _e74.xyz;\n let _e77 = unnamed.uLightViewProj;\n let _e78 = bent;\n let _e80 = world[3u];\n vLightPosition = (_e77 * vec4<f32>(_e78.x, _e78.y, _e78.z, _e80));\n let _e86 = vLightPosition;\n unnamed_1.gl_Position = _e86;\n return;\n}\n\n@vertex \nfn main(@location(0) aPosition: vec3<f32>, @location(11) aInstanceModel0_: vec4<f32>, @location(12) aInstanceModel1_: vec4<f32>, @location(13) aInstanceModel2_: vec4<f32>, @location(14) aInstanceModel3_: vec4<f32>) -> VertexOutput {\n aPosition_1 = aPosition;\n aInstanceModel0_1 = aInstanceModel0_;\n aInstanceModel1_1 = aInstanceModel1_;\n aInstanceModel2_1 = aInstanceModel2_;\n aInstanceModel3_1 = aInstanceModel3_;\n main_1();\n let _e14 = unnamed_1.gl_Position.y;\n unnamed_1.gl_Position.y = -(_e14);\n let _e16 = vLightPosition;\n let _e17 = unnamed_1.gl_Position;\n return VertexOutput(_e16, _e17);\n}\n";
|
|
6
8
|
export declare const DEPTH_SKINNED_VERT_WGSL = "struct Uniforms {\n uLightViewProj: mat4x4<f32>,\n uModel: mat4x4<f32>,\n uWindDirection: vec2<f32>,\n uWindSpeed: f32,\n uWindGust: f32,\n uWindTime: f32,\n uWindSpatialPhase: vec2<f32>,\n}\n\nstruct gl_PerVertex {\n @builtin(position) gl_Position: vec4<f32>,\n gl_PointSize: f32,\n}\n\nstruct VertexOutput {\n @location(0) member: vec4<f32>,\n @builtin(position) gl_Position: vec4<f32>,\n}\n\n@id(0) override SKIN_EIGHT: bool = false;\n@id(1) override CLOTH_BOUND: bool = false;\n\n@group(0) @binding(16) \nvar uJointPalette_t: texture_2d<f32>;\nvar<private> aJoints_1: vec4<f32>;\nvar<private> aWeights_1: vec4<f32>;\nvar<private> aJoints2_1: vec4<f32>;\nvar<private> aWeights2_1: vec4<f32>;\n@group(0) @binding(18) \nvar uClothBinding_t: texture_2d<f32>;\n@group(0) @binding(20) \nvar uClothParticles_t: texture_2d<f32>;\n@group(0) @binding(22) \nvar uClothRest_t: texture_2d<f32>;\nvar<private> gl_VertexIndex_1: i32;\n@group(0) @binding(0) \nvar<uniform> unnamed: Uniforms;\nvar<private> aPosition_1: vec3<f32>;\nvar<private> aChannel_1: vec4<f32>;\nvar<private> vLightPosition: vec4<f32>;\nvar<private> unnamed_1: gl_PerVertex = gl_PerVertex(vec4<f32>(0f, 0f, 0f, 1f), 1f);\n@group(0) @binding(17) \nvar uJointPalette_s: sampler;\n@group(0) @binding(19) \nvar uClothBinding_s: sampler;\n@group(0) @binding(21) \nvar uClothParticles_s: sampler;\n@group(0) @binding(23) \nvar uClothRest_s: sampler;\n\nfn clothFrame_u0028_vf3_u003b_vf3_u003b_vf3_u003b(a: ptr<function, vec3<f32>>, b: ptr<function, vec3<f32>>, c: ptr<function, vec3<f32>>) -> mat3x3<f32> {\n var edge: vec3<f32>;\n var n: vec3<f32>;\n var t: vec3<f32>;\n\n let _e43 = (*b);\n let _e44 = (*a);\n edge = (_e43 - _e44);\n let _e46 = edge;\n let _e47 = (*c);\n let _e48 = (*a);\n n = normalize(cross(_e46, (_e47 - _e48)));\n let _e52 = edge;\n t = normalize(_e52);\n let _e54 = t;\n let _e55 = n;\n let _e56 = t;\n let _e57 = cross(_e55, _e56);\n let _e58 = n;\n return mat3x3<f32>(vec3<f32>(_e54.x, _e54.y, _e54.z), vec3<f32>(_e57.x, _e57.y, _e57.z), vec3<f32>(_e58.x, _e58.y, _e58.z));\n}\n\nfn clothTexel_u0028_i1_u003b_i1_u003b(i: ptr<function, i32>, width: ptr<function, i32>) -> vec2<i32> {\n let _e39 = (*i);\n let _e40 = (*width);\n let _e48 = (*i);\n let _e49 = (*width);\n return vec2<i32>((_e39 - (i32(floor((f32(_e39) / f32(_e40)))) * _e40)), (_e48 / _e49));\n}\n\nfn clothPlace_u0028_vf3_u003b_mf33_u003b(position: ptr<function, vec3<f32>>, turn: ptr<function, mat3x3<f32>>) -> f32 {\n var bindingWidth: i32;\n var particleWidth: i32;\n var restWidth: i32;\n var indices: vec4<f32>;\n var param: i32;\n var param_1: i32;\n var at: vec4<f32>;\n var param_2: i32;\n var param_3: i32;\n var a_1: i32;\n var b_1: i32;\n var c_1: i32;\n var pa: vec3<f32>;\n var param_4: i32;\n var param_5: i32;\n var pb: vec3<f32>;\n var param_6: i32;\n var param_7: i32;\n var pc: vec3<f32>;\n var param_8: i32;\n var param_9: i32;\n var now: mat3x3<f32>;\n var param_10: vec3<f32>;\n var param_11: vec3<f32>;\n var param_12: vec3<f32>;\n var rest: mat3x3<f32>;\n var param_13: i32;\n var param_14: i32;\n var param_15: i32;\n var param_16: i32;\n var param_17: i32;\n var param_18: i32;\n var param_19: vec3<f32>;\n var param_20: vec3<f32>;\n var param_21: vec3<f32>;\n\n let _e74 = textureDimensions(uClothBinding_t, 0i);\n bindingWidth = vec2<i32>(_e74).x;\n let _e77 = textureDimensions(uClothParticles_t, 0i);\n particleWidth = vec2<i32>(_e77).x;\n let _e80 = textureDimensions(uClothRest_t, 0i);\n restWidth = vec2<i32>(_e80).x;\n let _e83 = gl_VertexIndex_1;\n param = (_e83 * 2i);\n let _e85 = bindingWidth;\n param_1 = _e85;\n let _e86 = clothTexel_u0028_i1_u003b_i1_u003b((¶m), (¶m_1));\n let _e87 = textureLoad(uClothBinding_t, _e86, 0i);\n indices = _e87;\n let _e88 = gl_VertexIndex_1;\n param_2 = ((_e88 * 2i) + 1i);\n let _e91 = bindingWidth;\n param_3 = _e91;\n let _e92 = clothTexel_u0028_i1_u003b_i1_u003b((¶m_2), (¶m_3));\n let _e93 = textureLoad(uClothBinding_t, _e92, 0i);\n at = _e93;\n let _e95 = indices[0u];\n a_1 = i32(_e95);\n let _e98 = indices[1u];\n b_1 = i32(_e98);\n let _e101 = indices[2u];\n c_1 = i32(_e101);\n let _e103 = a_1;\n param_4 = _e103;\n let _e104 = particleWidth;\n param_5 = _e104;\n let _e105 = clothTexel_u0028_i1_u003b_i1_u003b((¶m_4), (¶m_5));\n let _e106 = textureLoad(uClothParticles_t, _e105, 0i);\n pa = _e106.xyz;\n let _e108 = a_1;\n let _e109 = b_1;\n let _e111 = b_1;\n let _e112 = c_1;\n if ((_e108 == _e109) && (_e111 == _e112)) {\n let _e115 = pa;\n (*position) = _e115;\n (*turn) = mat3x3<f32>(vec3<f32>(1f, 0f, 0f), vec3<f32>(0f, 1f, 0f), vec3<f32>(0f, 0f, 1f));\n let _e117 = indices[3u];\n return _e117;\n }\n let _e118 = b_1;\n param_6 = _e118;\n let _e119 = particleWidth;\n param_7 = _e119;\n let _e120 = clothTexel_u0028_i1_u003b_i1_u003b((¶m_6), (¶m_7));\n let _e121 = textureLoad(uClothParticles_t, _e120, 0i);\n pb = _e121.xyz;\n let _e123 = c_1;\n param_8 = _e123;\n let _e124 = particleWidth;\n param_9 = _e124;\n let _e125 = clothTexel_u0028_i1_u003b_i1_u003b((¶m_8), (¶m_9));\n let _e126 = textureLoad(uClothParticles_t, _e125, 0i);\n pc = _e126.xyz;\n let _e128 = pa;\n param_10 = _e128;\n let _e129 = pb;\n param_11 = _e129;\n let _e130 = pc;\n param_12 = _e130;\n let _e131 = clothFrame_u0028_vf3_u003b_vf3_u003b_vf3_u003b((¶m_10), (¶m_11), (¶m_12));\n now = _e131;\n let _e132 = a_1;\n param_13 = _e132;\n let _e133 = restWidth;\n param_14 = _e133;\n let _e134 = clothTexel_u0028_i1_u003b_i1_u003b((¶m_13), (¶m_14));\n let _e135 = textureLoad(uClothRest_t, _e134, 0i);\n let _e136 = b_1;\n param_15 = _e136;\n let _e137 = restWidth;\n param_16 = _e137;\n let _e138 = clothTexel_u0028_i1_u003b_i1_u003b((¶m_15), (¶m_16));\n let _e139 = textureLoad(uClothRest_t, _e138, 0i);\n let _e140 = c_1;\n param_17 = _e140;\n let _e141 = restWidth;\n param_18 = _e141;\n let _e142 = clothTexel_u0028_i1_u003b_i1_u003b((¶m_17), (¶m_18));\n let _e143 = textureLoad(uClothRest_t, _e142, 0i);\n param_19 = _e135.xyz;\n param_20 = _e139.xyz;\n param_21 = _e143.xyz;\n let _e147 = clothFrame_u0028_vf3_u003b_vf3_u003b_vf3_u003b((¶m_19), (¶m_20), (¶m_21));\n rest = _e147;\n let _e148 = pa;\n let _e150 = at[0u];\n let _e153 = at[1u];\n let _e156 = pb;\n let _e158 = at[0u];\n let _e161 = pc;\n let _e163 = at[1u];\n let _e167 = now[2];\n let _e169 = at[2u];\n (*position) = ((((_e148 * ((1f - _e150) - _e153)) + (_e156 * _e158)) + (_e161 * _e163)) + (_e167 * _e169));\n let _e172 = now;\n let _e173 = rest;\n (*turn) = (_e172 * transpose(_e173));\n let _e177 = indices[3u];\n return _e177;\n}\n\nfn channelBend_u0028_vf3_u003b_f1_u003b(worldPos: ptr<function, vec3<f32>>, sway: ptr<function, f32>) -> vec3<f32> {\n var phase: f32;\n var bend: f32;\n\n let _e41 = (*sway);\n if (_e41 <= 0f) {\n let _e43 = (*worldPos);\n return _e43;\n }\n let _e44 = (*worldPos);\n let _e47 = unnamed.uWindSpatialPhase;\n let _e50 = unnamed.uWindTime;\n phase = (dot(_e44.xz, _e47) + _e50);\n let _e53 = unnamed.uWindSpeed;\n let _e55 = unnamed.uWindGust;\n let _e57 = phase;\n let _e60 = (*sway);\n bend = (((_e53 + _e55) * sin(_e57)) * _e60);\n let _e63 = (*worldPos)[0u];\n let _e66 = unnamed.uWindDirection[0u];\n let _e67 = bend;\n let _e71 = (*worldPos)[1u];\n let _e73 = (*worldPos)[2u];\n let _e76 = unnamed.uWindDirection[1u];\n let _e77 = bend;\n return vec3<f32>((_e63 + (_e66 * _e67)), _e71, (_e73 + (_e76 * _e77)));\n}\n\nfn jointMatrix_u0028_i1_u003b(index: ptr<function, i32>) -> mat4x4<f32> {\n var x: i32;\n\n let _e39 = (*index);\n x = (_e39 * 4i);\n let _e41 = x;\n let _e43 = textureLoad(uJointPalette_t, vec2<i32>(_e41, 0i), 0i);\n let _e44 = x;\n let _e47 = textureLoad(uJointPalette_t, vec2<i32>((_e44 + 1i), 0i), 0i);\n let _e48 = x;\n let _e51 = textureLoad(uJointPalette_t, vec2<i32>((_e48 + 2i), 0i), 0i);\n let _e52 = x;\n let _e55 = textureLoad(uJointPalette_t, vec2<i32>((_e52 + 3i), 0i), 0i);\n return mat4x4<f32>(vec4<f32>(_e43.x, _e43.y, _e43.z, _e43.w), vec4<f32>(_e47.x, _e47.y, _e47.z, _e47.w), vec4<f32>(_e51.x, _e51.y, _e51.z, _e51.w), vec4<f32>(_e55.x, _e55.y, _e55.z, _e55.w));\n}\n\nfn skinMatrix_u0028_() -> mat4x4<f32> {\n var m: mat4x4<f32>;\n var param_22: i32;\n var param_23: i32;\n var param_24: i32;\n var param_25: i32;\n var param_26: i32;\n var param_27: i32;\n var param_28: i32;\n var param_29: i32;\n\n let _e47 = aJoints_1[0u];\n param_22 = i32(_e47);\n let _e49 = jointMatrix_u0028_i1_u003b((¶m_22));\n let _e51 = aWeights_1[0u];\n let _e52 = (_e49 * _e51);\n let _e54 = aJoints_1[1u];\n param_23 = i32(_e54);\n let _e56 = jointMatrix_u0028_i1_u003b((¶m_23));\n let _e58 = aWeights_1[1u];\n let _e59 = (_e56 * _e58);\n let _e72 = mat4x4<f32>((_e52[0] + _e59[0]), (_e52[1] + _e59[1]), (_e52[2] + _e59[2]), (_e52[3] + _e59[3]));\n let _e74 = aJoints_1[2u];\n param_24 = i32(_e74);\n let _e76 = jointMatrix_u0028_i1_u003b((¶m_24));\n let _e78 = aWeights_1[2u];\n let _e79 = (_e76 * _e78);\n let _e92 = mat4x4<f32>((_e72[0] + _e79[0]), (_e72[1] + _e79[1]), (_e72[2] + _e79[2]), (_e72[3] + _e79[3]));\n let _e94 = aJoints_1[3u];\n param_25 = i32(_e94);\n let _e96 = jointMatrix_u0028_i1_u003b((¶m_25));\n let _e98 = aWeights_1[3u];\n let _e99 = (_e96 * _e98);\n m = mat4x4<f32>((_e92[0] + _e99[0]), (_e92[1] + _e99[1]), (_e92[2] + _e99[2]), (_e92[3] + _e99[3]));\n if SKIN_EIGHT {\n let _e114 = aJoints2_1[0u];\n param_26 = i32(_e114);\n let _e116 = jointMatrix_u0028_i1_u003b((¶m_26));\n let _e118 = aWeights2_1[0u];\n let _e119 = (_e116 * _e118);\n let _e121 = aJoints2_1[1u];\n param_27 = i32(_e121);\n let _e123 = jointMatrix_u0028_i1_u003b((¶m_27));\n let _e125 = aWeights2_1[1u];\n let _e126 = (_e123 * _e125);\n let _e139 = mat4x4<f32>((_e119[0] + _e126[0]), (_e119[1] + _e126[1]), (_e119[2] + _e126[2]), (_e119[3] + _e126[3]));\n let _e141 = aJoints2_1[2u];\n param_28 = i32(_e141);\n let _e143 = jointMatrix_u0028_i1_u003b((¶m_28));\n let _e145 = aWeights2_1[2u];\n let _e146 = (_e143 * _e145);\n let _e159 = mat4x4<f32>((_e139[0] + _e146[0]), (_e139[1] + _e146[1]), (_e139[2] + _e146[2]), (_e139[3] + _e146[3]));\n let _e161 = aJoints2_1[3u];\n param_29 = i32(_e161);\n let _e163 = jointMatrix_u0028_i1_u003b((¶m_29));\n let _e165 = aWeights2_1[3u];\n let _e166 = (_e163 * _e165);\n let _e179 = mat4x4<f32>((_e159[0] + _e166[0]), (_e159[1] + _e166[1]), (_e159[2] + _e166[2]), (_e159[3] + _e166[3]));\n let _e180 = m;\n m = mat4x4<f32>((_e180[0] + _e179[0]), (_e180[1] + _e179[1]), (_e180[2] + _e179[2]), (_e180[3] + _e179[3]));\n }\n let _e194 = m;\n return _e194;\n}\n\nfn main_1() {\n var local: vec4<f32>;\n var model: mat4x4<f32>;\n var world: vec4<f32>;\n var bent: vec3<f32>;\n var param_30: vec3<f32>;\n var param_31: f32;\n var follow: f32;\n var clothPosition: vec3<f32>;\n var turn_1: mat3x3<f32>;\n var param_32: vec3<f32>;\n var param_33: mat3x3<f32>;\n\n let _e48 = skinMatrix_u0028_();\n let _e49 = aPosition_1;\n local = (_e48 * vec4<f32>(_e49.x, _e49.y, _e49.z, 1f));\n let _e56 = unnamed.uModel;\n model = _e56;\n let _e57 = model;\n let _e58 = local;\n world = (_e57 * _e58);\n let _e60 = world;\n param_30 = _e60.xyz;\n let _e63 = aChannel_1[0u];\n param_31 = _e63;\n let _e64 = channelBend_u0028_vf3_u003b_f1_u003b((¶m_30), (¶m_31));\n bent = _e64;\n if CLOTH_BOUND {\n let _e65 = clothPlace_u0028_vf3_u003b_mf33_u003b((¶m_32), (¶m_33));\n let _e66 = param_32;\n clothPosition = _e66;\n let _e67 = param_33;\n turn_1 = _e67;\n follow = _e65;\n let _e68 = bent;\n let _e69 = clothPosition;\n let _e70 = follow;\n bent = mix(_e68, _e69, vec3(_e70));\n }\n let _e74 = unnamed.uLightViewProj;\n let _e75 = bent;\n let _e77 = world[3u];\n vLightPosition = (_e74 * vec4<f32>(_e75.x, _e75.y, _e75.z, _e77));\n let _e83 = vLightPosition;\n unnamed_1.gl_Position = _e83;\n return;\n}\n\n@vertex \nfn main(@location(11) aJoints: vec4<f32>, @location(12) aWeights: vec4<f32>, @location(14) aJoints2_: vec4<f32>, @location(15) aWeights2_: vec4<f32>, @builtin(vertex_index) gl_VertexIndex: u32, @location(0) aPosition: vec3<f32>, @location(13) aChannel: vec4<f32>) -> VertexOutput {\n aJoints_1 = aJoints;\n aWeights_1 = aWeights;\n aJoints2_1 = aJoints2_;\n aWeights2_1 = aWeights2_;\n gl_VertexIndex_1 = i32(gl_VertexIndex);\n aPosition_1 = aPosition;\n aChannel_1 = aChannel;\n main_1();\n let _e19 = unnamed_1.gl_Position.y;\n unnamed_1.gl_Position.y = -(_e19);\n let _e21 = vLightPosition;\n let _e22 = unnamed_1.gl_Position;\n return VertexOutput(_e21, _e22);\n}\n";
|
|
@@ -116,6 +118,97 @@ export declare const DEPTH_BINDINGS: {
|
|
|
116
118
|
};
|
|
117
119
|
};
|
|
118
120
|
};
|
|
121
|
+
readonly DEPTH_INSTANCED_ANIMATED_CUTOUT_VERT: {
|
|
122
|
+
readonly uniforms: 0;
|
|
123
|
+
readonly uniformSize: 112;
|
|
124
|
+
readonly fields: {
|
|
125
|
+
readonly uLightViewProj: {
|
|
126
|
+
readonly offset: 0;
|
|
127
|
+
readonly size: 64;
|
|
128
|
+
readonly type: "mat4";
|
|
129
|
+
};
|
|
130
|
+
readonly uUvScale: {
|
|
131
|
+
readonly offset: 64;
|
|
132
|
+
readonly size: 8;
|
|
133
|
+
readonly type: "vec2";
|
|
134
|
+
};
|
|
135
|
+
readonly uUvOffset: {
|
|
136
|
+
readonly offset: 72;
|
|
137
|
+
readonly size: 8;
|
|
138
|
+
readonly type: "vec2";
|
|
139
|
+
};
|
|
140
|
+
readonly uAlphaCutout: {
|
|
141
|
+
readonly offset: 80;
|
|
142
|
+
readonly size: 8;
|
|
143
|
+
readonly type: "vec2";
|
|
144
|
+
};
|
|
145
|
+
readonly uSceneTime: {
|
|
146
|
+
readonly offset: 88;
|
|
147
|
+
readonly size: 4;
|
|
148
|
+
readonly type: "float";
|
|
149
|
+
};
|
|
150
|
+
readonly uBoneClip: {
|
|
151
|
+
readonly offset: 96;
|
|
152
|
+
readonly size: 8;
|
|
153
|
+
readonly type: "vec2";
|
|
154
|
+
};
|
|
155
|
+
};
|
|
156
|
+
readonly textures: {
|
|
157
|
+
readonly uBonePlaces: {
|
|
158
|
+
readonly texture: 16;
|
|
159
|
+
readonly sampler: 17;
|
|
160
|
+
readonly type: "sampler2D";
|
|
161
|
+
};
|
|
162
|
+
readonly uBoneTurns: {
|
|
163
|
+
readonly texture: 18;
|
|
164
|
+
readonly sampler: 19;
|
|
165
|
+
readonly type: "sampler2D";
|
|
166
|
+
};
|
|
167
|
+
readonly uInstanceClocks: {
|
|
168
|
+
readonly texture: 20;
|
|
169
|
+
readonly sampler: 21;
|
|
170
|
+
readonly type: "sampler2D";
|
|
171
|
+
};
|
|
172
|
+
};
|
|
173
|
+
};
|
|
174
|
+
readonly DEPTH_INSTANCED_ANIMATED_VERT: {
|
|
175
|
+
readonly uniforms: 0;
|
|
176
|
+
readonly uniformSize: 80;
|
|
177
|
+
readonly fields: {
|
|
178
|
+
readonly uLightViewProj: {
|
|
179
|
+
readonly offset: 0;
|
|
180
|
+
readonly size: 64;
|
|
181
|
+
readonly type: "mat4";
|
|
182
|
+
};
|
|
183
|
+
readonly uSceneTime: {
|
|
184
|
+
readonly offset: 64;
|
|
185
|
+
readonly size: 4;
|
|
186
|
+
readonly type: "float";
|
|
187
|
+
};
|
|
188
|
+
readonly uBoneClip: {
|
|
189
|
+
readonly offset: 72;
|
|
190
|
+
readonly size: 8;
|
|
191
|
+
readonly type: "vec2";
|
|
192
|
+
};
|
|
193
|
+
};
|
|
194
|
+
readonly textures: {
|
|
195
|
+
readonly uBonePlaces: {
|
|
196
|
+
readonly texture: 16;
|
|
197
|
+
readonly sampler: 17;
|
|
198
|
+
readonly type: "sampler2D";
|
|
199
|
+
};
|
|
200
|
+
readonly uBoneTurns: {
|
|
201
|
+
readonly texture: 18;
|
|
202
|
+
readonly sampler: 19;
|
|
203
|
+
readonly type: "sampler2D";
|
|
204
|
+
};
|
|
205
|
+
readonly uInstanceClocks: {
|
|
206
|
+
readonly texture: 20;
|
|
207
|
+
readonly sampler: 21;
|
|
208
|
+
readonly type: "sampler2D";
|
|
209
|
+
};
|
|
210
|
+
};
|
|
211
|
+
};
|
|
119
212
|
readonly DEPTH_INSTANCED_CUTOUT_VERT: {
|
|
120
213
|
readonly uniforms: 0;
|
|
121
214
|
readonly uniformSize: 96;
|