@flighthq/scene3d-wgpu 0.2.1-next.840.857425c
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/dist/anisotropyPbrWgpuMeshMaterialRenderer.d.ts +4 -0
- package/dist/anisotropyPbrWgpuMeshMaterialRenderer.d.ts.map +1 -0
- package/dist/anisotropyPbrWgpuMeshMaterialRenderer.js +52 -0
- package/dist/anisotropyPbrWgpuMeshMaterialRenderer.js.map +1 -0
- package/dist/blinnPhongWgpuMeshMaterialRenderer.d.ts +4 -0
- package/dist/blinnPhongWgpuMeshMaterialRenderer.d.ts.map +1 -0
- package/dist/blinnPhongWgpuMeshMaterialRenderer.js +66 -0
- package/dist/blinnPhongWgpuMeshMaterialRenderer.js.map +1 -0
- package/dist/clearcoatPbrWgpuMeshMaterialRenderer.d.ts +4 -0
- package/dist/clearcoatPbrWgpuMeshMaterialRenderer.d.ts.map +1 -0
- package/dist/clearcoatPbrWgpuMeshMaterialRenderer.js +52 -0
- package/dist/clearcoatPbrWgpuMeshMaterialRenderer.js.map +1 -0
- package/dist/customShaderWgpuMeshMaterialRenderer.d.ts +7 -0
- package/dist/customShaderWgpuMeshMaterialRenderer.d.ts.map +1 -0
- package/dist/customShaderWgpuMeshMaterialRenderer.js +225 -0
- package/dist/customShaderWgpuMeshMaterialRenderer.js.map +1 -0
- package/dist/depthWgpuMeshMaterialRenderer.d.ts +4 -0
- package/dist/depthWgpuMeshMaterialRenderer.d.ts.map +1 -0
- package/dist/depthWgpuMeshMaterialRenderer.js +42 -0
- package/dist/depthWgpuMeshMaterialRenderer.js.map +1 -0
- package/dist/drawWgpuScene3D.d.ts +4 -0
- package/dist/drawWgpuScene3D.d.ts.map +1 -0
- package/dist/drawWgpuScene3D.js +171 -0
- package/dist/drawWgpuScene3D.js.map +1 -0
- package/dist/emissiveWgpuMeshMaterialRenderer.d.ts +4 -0
- package/dist/emissiveWgpuMeshMaterialRenderer.d.ts.map +1 -0
- package/dist/emissiveWgpuMeshMaterialRenderer.js +51 -0
- package/dist/emissiveWgpuMeshMaterialRenderer.js.map +1 -0
- package/dist/enableWgpuScene3DCustomShaderGuards.d.ts +5 -0
- package/dist/enableWgpuScene3DCustomShaderGuards.d.ts.map +1 -0
- package/dist/enableWgpuScene3DCustomShaderGuards.js +56 -0
- package/dist/enableWgpuScene3DCustomShaderGuards.js.map +1 -0
- package/dist/enableWgpuScene3DForwardLightSelectionGuards.d.ts +4 -0
- package/dist/enableWgpuScene3DForwardLightSelectionGuards.d.ts.map +1 -0
- package/dist/enableWgpuScene3DForwardLightSelectionGuards.js +17 -0
- package/dist/enableWgpuScene3DForwardLightSelectionGuards.js.map +1 -0
- package/dist/explainWgpuScene3DForwardLightSelection.d.ts +3 -0
- package/dist/explainWgpuScene3DForwardLightSelection.d.ts.map +1 -0
- package/dist/explainWgpuScene3DForwardLightSelection.js +18 -0
- package/dist/explainWgpuScene3DForwardLightSelection.js.map +1 -0
- package/dist/index.d.ts +51 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +51 -0
- package/dist/index.js.map +1 -0
- package/dist/iridescencePbrWgpuMeshMaterialRenderer.d.ts +4 -0
- package/dist/iridescencePbrWgpuMeshMaterialRenderer.d.ts.map +1 -0
- package/dist/iridescencePbrWgpuMeshMaterialRenderer.js +60 -0
- package/dist/iridescencePbrWgpuMeshMaterialRenderer.js.map +1 -0
- package/dist/lambertWgpuMeshMaterialRenderer.d.ts +4 -0
- package/dist/lambertWgpuMeshMaterialRenderer.d.ts.map +1 -0
- package/dist/lambertWgpuMeshMaterialRenderer.js +61 -0
- package/dist/lambertWgpuMeshMaterialRenderer.js.map +1 -0
- package/dist/matcapWgpuMeshMaterialRenderer.d.ts +4 -0
- package/dist/matcapWgpuMeshMaterialRenderer.d.ts.map +1 -0
- package/dist/matcapWgpuMeshMaterialRenderer.js +54 -0
- package/dist/matcapWgpuMeshMaterialRenderer.js.map +1 -0
- package/dist/normalWgpuMeshMaterialRenderer.d.ts +4 -0
- package/dist/normalWgpuMeshMaterialRenderer.d.ts.map +1 -0
- package/dist/normalWgpuMeshMaterialRenderer.js +47 -0
- package/dist/normalWgpuMeshMaterialRenderer.js.map +1 -0
- package/dist/phongWgpuMeshMaterialRenderer.d.ts +4 -0
- package/dist/phongWgpuMeshMaterialRenderer.d.ts.map +1 -0
- package/dist/phongWgpuMeshMaterialRenderer.js +63 -0
- package/dist/phongWgpuMeshMaterialRenderer.js.map +1 -0
- package/dist/prepareWgpuScene3DForwardLights.d.ts +3 -0
- package/dist/prepareWgpuScene3DForwardLights.d.ts.map +1 -0
- package/dist/prepareWgpuScene3DForwardLights.js +110 -0
- package/dist/prepareWgpuScene3DForwardLights.js.map +1 -0
- package/dist/registerStandardPbrWgpuMaterial.d.ts +3 -0
- package/dist/registerStandardPbrWgpuMaterial.d.ts.map +1 -0
- package/dist/registerStandardPbrWgpuMaterial.js +11 -0
- package/dist/registerStandardPbrWgpuMaterial.js.map +1 -0
- package/dist/shadedWgpuMeshMaterialRenderer.d.ts +11 -0
- package/dist/shadedWgpuMeshMaterialRenderer.d.ts.map +1 -0
- package/dist/shadedWgpuMeshMaterialRenderer.js +47 -0
- package/dist/shadedWgpuMeshMaterialRenderer.js.map +1 -0
- package/dist/sheenPbrWgpuMeshMaterialRenderer.d.ts +4 -0
- package/dist/sheenPbrWgpuMeshMaterialRenderer.d.ts.map +1 -0
- package/dist/sheenPbrWgpuMeshMaterialRenderer.js +58 -0
- package/dist/sheenPbrWgpuMeshMaterialRenderer.js.map +1 -0
- package/dist/specularGlossinessPbrWgpuMeshMaterialRenderer.d.ts +4 -0
- package/dist/specularGlossinessPbrWgpuMeshMaterialRenderer.d.ts.map +1 -0
- package/dist/specularGlossinessPbrWgpuMeshMaterialRenderer.js +126 -0
- package/dist/specularGlossinessPbrWgpuMeshMaterialRenderer.js.map +1 -0
- package/dist/specularPbrWgpuMeshMaterialRenderer.d.ts +4 -0
- package/dist/specularPbrWgpuMeshMaterialRenderer.d.ts.map +1 -0
- package/dist/specularPbrWgpuMeshMaterialRenderer.js +65 -0
- package/dist/specularPbrWgpuMeshMaterialRenderer.js.map +1 -0
- package/dist/standardPbrWgpuMeshMaterialRenderer.d.ts +9 -0
- package/dist/standardPbrWgpuMeshMaterialRenderer.d.ts.map +1 -0
- package/dist/standardPbrWgpuMeshMaterialRenderer.js +174 -0
- package/dist/standardPbrWgpuMeshMaterialRenderer.js.map +1 -0
- package/dist/subsurfacePbrWgpuMeshMaterialRenderer.d.ts +4 -0
- package/dist/subsurfacePbrWgpuMeshMaterialRenderer.d.ts.map +1 -0
- package/dist/subsurfacePbrWgpuMeshMaterialRenderer.js +68 -0
- package/dist/subsurfacePbrWgpuMeshMaterialRenderer.js.map +1 -0
- package/dist/toonWgpuMeshMaterialRenderer.d.ts +4 -0
- package/dist/toonWgpuMeshMaterialRenderer.d.ts.map +1 -0
- package/dist/toonWgpuMeshMaterialRenderer.js +71 -0
- package/dist/toonWgpuMeshMaterialRenderer.js.map +1 -0
- package/dist/transmissionVolumePbrWgpuMeshMaterialRenderer.d.ts +4 -0
- package/dist/transmissionVolumePbrWgpuMeshMaterialRenderer.d.ts.map +1 -0
- package/dist/transmissionVolumePbrWgpuMeshMaterialRenderer.js +74 -0
- package/dist/transmissionVolumePbrWgpuMeshMaterialRenderer.js.map +1 -0
- package/dist/unlitWgpuMeshMaterialRenderer.d.ts +4 -0
- package/dist/unlitWgpuMeshMaterialRenderer.d.ts.map +1 -0
- package/dist/unlitWgpuMeshMaterialRenderer.js +57 -0
- package/dist/unlitWgpuMeshMaterialRenderer.js.map +1 -0
- package/dist/vertexColorWgpuMeshMaterialRenderer.d.ts +4 -0
- package/dist/vertexColorWgpuMeshMaterialRenderer.d.ts.map +1 -0
- package/dist/vertexColorWgpuMeshMaterialRenderer.js +55 -0
- package/dist/vertexColorWgpuMeshMaterialRenderer.js.map +1 -0
- package/dist/wgpuClassicPrelude.d.ts +8 -0
- package/dist/wgpuClassicPrelude.d.ts.map +1 -0
- package/dist/wgpuClassicPrelude.js +319 -0
- package/dist/wgpuClassicPrelude.js.map +1 -0
- package/dist/wgpuCustomMaterialAbi.d.ts +3 -0
- package/dist/wgpuCustomMaterialAbi.d.ts.map +1 -0
- package/dist/wgpuCustomMaterialAbi.js +5 -0
- package/dist/wgpuCustomMaterialAbi.js.map +1 -0
- package/dist/wgpuDebugPrelude.d.ts +7 -0
- package/dist/wgpuDebugPrelude.d.ts.map +1 -0
- package/dist/wgpuDebugPrelude.js +133 -0
- package/dist/wgpuDebugPrelude.js.map +1 -0
- package/dist/wgpuEnvironmentCube.d.ts +4 -0
- package/dist/wgpuEnvironmentCube.d.ts.map +1 -0
- package/dist/wgpuEnvironmentCube.js +66 -0
- package/dist/wgpuEnvironmentCube.js.map +1 -0
- package/dist/wgpuEnvironmentIblBake.d.ts +4 -0
- package/dist/wgpuEnvironmentIblBake.d.ts.map +1 -0
- package/dist/wgpuEnvironmentIblBake.js +458 -0
- package/dist/wgpuEnvironmentIblBake.js.map +1 -0
- package/dist/wgpuEnvironmentSkybox.d.ts +3 -0
- package/dist/wgpuEnvironmentSkybox.d.ts.map +1 -0
- package/dist/wgpuEnvironmentSkybox.js +159 -0
- package/dist/wgpuEnvironmentSkybox.js.map +1 -0
- package/dist/wgpuMatcapPrelude.d.ts +7 -0
- package/dist/wgpuMatcapPrelude.d.ts.map +1 -0
- package/dist/wgpuMatcapPrelude.js +134 -0
- package/dist/wgpuMatcapPrelude.js.map +1 -0
- package/dist/wgpuMeshMaterialRegistry.d.ts +5 -0
- package/dist/wgpuMeshMaterialRegistry.d.ts.map +1 -0
- package/dist/wgpuMeshMaterialRegistry.js +29 -0
- package/dist/wgpuMeshMaterialRegistry.js.map +1 -0
- package/dist/wgpuMeshPipeline.d.ts +43 -0
- package/dist/wgpuMeshPipeline.d.ts.map +1 -0
- package/dist/wgpuMeshPipeline.js +1007 -0
- package/dist/wgpuMeshPipeline.js.map +1 -0
- package/dist/wgpuMeshUpload.d.ts +3 -0
- package/dist/wgpuMeshUpload.d.ts.map +1 -0
- package/dist/wgpuMeshUpload.js +58 -0
- package/dist/wgpuMeshUpload.js.map +1 -0
- package/dist/wgpuParticleEmitter3D.d.ts +4 -0
- package/dist/wgpuParticleEmitter3D.d.ts.map +1 -0
- package/dist/wgpuParticleEmitter3D.js +403 -0
- package/dist/wgpuParticleEmitter3D.js.map +1 -0
- package/dist/wgpuPbrPipelineCache.d.ts +4 -0
- package/dist/wgpuPbrPipelineCache.d.ts.map +1 -0
- package/dist/wgpuPbrPipelineCache.js +52 -0
- package/dist/wgpuPbrPipelineCache.js.map +1 -0
- package/dist/wgpuPbrPrelude.d.ts +7 -0
- package/dist/wgpuPbrPrelude.d.ts.map +1 -0
- package/dist/wgpuPbrPrelude.js +551 -0
- package/dist/wgpuPbrPrelude.js.map +1 -0
- package/dist/wgpuScene3DRuntime.d.ts +5 -0
- package/dist/wgpuScene3DRuntime.d.ts.map +1 -0
- package/dist/wgpuScene3DRuntime.js +81 -0
- package/dist/wgpuScene3DRuntime.js.map +1 -0
- package/dist/wgpuScene3DTestHelper.d.ts +14 -0
- package/dist/wgpuScene3DTestHelper.d.ts.map +1 -0
- package/dist/wgpuScene3DTestHelper.js +121 -0
- package/dist/wgpuScene3DTestHelper.js.map +1 -0
- package/dist/wgpuScene3DTime.d.ts +4 -0
- package/dist/wgpuScene3DTime.d.ts.map +1 -0
- package/dist/wgpuScene3DTime.js +11 -0
- package/dist/wgpuScene3DTime.js.map +1 -0
- package/dist/wgpuShadedModifierSnippet.d.ts +4 -0
- package/dist/wgpuShadedModifierSnippet.d.ts.map +1 -0
- package/dist/wgpuShadedModifierSnippet.js +18 -0
- package/dist/wgpuShadedModifierSnippet.js.map +1 -0
- package/dist/wgpuShadedPrelude.d.ts +16 -0
- package/dist/wgpuShadedPrelude.d.ts.map +1 -0
- package/dist/wgpuShadedPrelude.js +625 -0
- package/dist/wgpuShadedPrelude.js.map +1 -0
- package/dist/wgpuShadowMap.d.ts +4 -0
- package/dist/wgpuShadowMap.d.ts.map +1 -0
- package/dist/wgpuShadowMap.js +155 -0
- package/dist/wgpuShadowMap.js.map +1 -0
- package/dist/wgpuSkinPalette.d.ts +7 -0
- package/dist/wgpuSkinPalette.d.ts.map +1 -0
- package/dist/wgpuSkinPalette.js +173 -0
- package/dist/wgpuSkinPalette.js.map +1 -0
- package/dist/wgpuToonPrelude.d.ts +8 -0
- package/dist/wgpuToonPrelude.d.ts.map +1 -0
- package/dist/wgpuToonPrelude.js +192 -0
- package/dist/wgpuToonPrelude.js.map +1 -0
- package/dist/wgpuUnlitPrelude.d.ts +9 -0
- package/dist/wgpuUnlitPrelude.d.ts.map +1 -0
- package/dist/wgpuUnlitPrelude.js +142 -0
- package/dist/wgpuUnlitPrelude.js.map +1 -0
- package/dist/wgpuWireframePrelude.d.ts +6 -0
- package/dist/wgpuWireframePrelude.d.ts.map +1 -0
- package/dist/wgpuWireframePrelude.js +77 -0
- package/dist/wgpuWireframePrelude.js.map +1 -0
- package/dist/wgpuWireframeUpload.d.ts +3 -0
- package/dist/wgpuWireframeUpload.d.ts.map +1 -0
- package/dist/wgpuWireframeUpload.js +68 -0
- package/dist/wgpuWireframeUpload.js.map +1 -0
- package/dist/wireframeWgpuMeshMaterialRenderer.d.ts +4 -0
- package/dist/wireframeWgpuMeshMaterialRenderer.d.ts.map +1 -0
- package/dist/wireframeWgpuMeshMaterialRenderer.js +69 -0
- package/dist/wireframeWgpuMeshMaterialRenderer.js.map +1 -0
- package/package.json +57 -0
- package/src/anisotropyPbrWgpuMeshMaterialRenderer.test.ts +90 -0
- package/src/blinnPhongWgpuMeshMaterialRenderer.test.ts +82 -0
- package/src/clearcoatPbrWgpuMeshMaterialRenderer.test.ts +90 -0
- package/src/customShaderWgpuMeshMaterialRenderer.test.ts +207 -0
- package/src/depthWgpuMeshMaterialRenderer.test.ts +69 -0
- package/src/drawWgpuScene3D.test.ts +247 -0
- package/src/emissiveWgpuMeshMaterialRenderer.test.ts +64 -0
- package/src/enableWgpuScene3DCustomShaderGuards.test.ts +73 -0
- package/src/enableWgpuScene3DForwardLightSelectionGuards.test.ts +39 -0
- package/src/explainWgpuScene3DForwardLightSelection.test.ts +15 -0
- package/src/iridescencePbrWgpuMeshMaterialRenderer.test.ts +90 -0
- package/src/lambertWgpuMeshMaterialRenderer.test.ts +77 -0
- package/src/matcapWgpuMeshMaterialRenderer.test.ts +69 -0
- package/src/normalWgpuMeshMaterialRenderer.test.ts +69 -0
- package/src/phongWgpuMeshMaterialRenderer.test.ts +79 -0
- package/src/prepareWgpuScene3DForwardLights.test.ts +84 -0
- package/src/registerStandardPbrWgpuMaterial.test.ts +15 -0
- package/src/shadedWgpuMeshMaterialRenderer.test.ts +63 -0
- package/src/sheenPbrWgpuMeshMaterialRenderer.test.ts +87 -0
- package/src/specularGlossinessPbrWgpuMeshMaterialRenderer.test.ts +100 -0
- package/src/specularPbrWgpuMeshMaterialRenderer.test.ts +90 -0
- package/src/standardPbrWgpuMeshMaterialRenderer.test.ts +172 -0
- package/src/subsurfacePbrWgpuMeshMaterialRenderer.test.ts +90 -0
- package/src/toonWgpuMeshMaterialRenderer.test.ts +89 -0
- package/src/transmissionVolumePbrWgpuMeshMaterialRenderer.test.ts +97 -0
- package/src/unlitWgpuMeshMaterialRenderer.test.ts +94 -0
- package/src/vertexColorWgpuMeshMaterialRenderer.test.ts +62 -0
- package/src/wgpuClassicPrelude.test.ts +176 -0
- package/src/wgpuDebugPrelude.test.ts +79 -0
- package/src/wgpuEnvironmentCube.test.ts +86 -0
- package/src/wgpuEnvironmentIblBake.test.ts +79 -0
- package/src/wgpuEnvironmentSkybox.test.ts +56 -0
- package/src/wgpuMatcapPrelude.test.ts +70 -0
- package/src/wgpuMeshMaterialRegistry.test.ts +55 -0
- package/src/wgpuMeshPipeline.test.ts +844 -0
- package/src/wgpuMeshUpload.test.ts +177 -0
- package/src/wgpuParticleEmitter3D.test.ts +200 -0
- package/src/wgpuPbrPipelineCache.test.ts +67 -0
- package/src/wgpuPbrPrelude.test.ts +162 -0
- package/src/wgpuScene3DRuntime.test.ts +35 -0
- package/src/wgpuScene3DTime.test.ts +20 -0
- package/src/wgpuShadedModifierSnippet.test.ts +33 -0
- package/src/wgpuShadedPrelude.test.ts +394 -0
- package/src/wgpuShadowMap.test.ts +169 -0
- package/src/wgpuSkinPalette.test.ts +88 -0
- package/src/wgpuToonPrelude.test.ts +93 -0
- package/src/wgpuUnlitPrelude.test.ts +102 -0
- package/src/wgpuWireframePrelude.test.ts +54 -0
- package/src/wgpuWireframeUpload.test.ts +36 -0
- package/src/wireframeWgpuMeshMaterialRenderer.test.ts +69 -0
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { getWgpuRenderStateRuntime } from '@flighthq/render-wgpu';
|
|
2
|
+
import { createWgpuMeshPipeline, ensureWgpuPlaceholderTextureView, ensureWgpuScene3DPipeline, stashWgpuUvTransform, WGPU_MESH_PRELUDE_WGSL, } from './wgpuMeshPipeline';
|
|
3
|
+
import { getWgpuScene3DRuntime } from './wgpuScene3DRuntime';
|
|
4
|
+
// Ensures (and caches per material reference) the debug Material bind group — a uniform buffer + the
|
|
5
|
+
// shared sampler + the placeholder texture — and rewrites its uniform with this surface's params. The
|
|
6
|
+
// params vec4 packs near/far (depth mode) and normalScale (normal mode) into one buffer shared by both
|
|
7
|
+
// modes; the active mode reads only the lanes it needs. Mirrors scene-gl's bindGlDebugRange /
|
|
8
|
+
// bindGlDebugNormalMap collapsed into one upload. Returns the bind group for the caller to set at
|
|
9
|
+
// group(2). normalScale is uploaded for the normal mode; depth mode passes it through unused.
|
|
10
|
+
export function bindWgpuDebugSurface(state, pipeline, materialKey, near, far, normalScale) {
|
|
11
|
+
const scene = getWgpuScene3DRuntime(state);
|
|
12
|
+
let binding = scene.materialBindGroups.get(materialKey);
|
|
13
|
+
if (binding === undefined) {
|
|
14
|
+
const stateRuntime = getWgpuRenderStateRuntime(state);
|
|
15
|
+
const buffer = state.device.createBuffer({
|
|
16
|
+
size: DEBUG_UNIFORM_BYTES,
|
|
17
|
+
usage: GPUBufferUsage.UNIFORM | GPUBufferUsage.COPY_DST,
|
|
18
|
+
});
|
|
19
|
+
const bindGroup = state.device.createBindGroup({
|
|
20
|
+
layout: pipeline.materialBindGroupLayout,
|
|
21
|
+
entries: [
|
|
22
|
+
{ binding: 0, resource: { buffer } },
|
|
23
|
+
{ binding: 1, resource: stateRuntime.linearSampler },
|
|
24
|
+
{ binding: 2, resource: ensureWgpuPlaceholderTextureView(state) },
|
|
25
|
+
],
|
|
26
|
+
});
|
|
27
|
+
binding = { bindGroup, buffer };
|
|
28
|
+
scene.materialBindGroups.set(materialKey, binding);
|
|
29
|
+
}
|
|
30
|
+
_scratch[0] = near;
|
|
31
|
+
_scratch[1] = far;
|
|
32
|
+
_scratch[2] = normalScale;
|
|
33
|
+
_scratch[3] = 0;
|
|
34
|
+
state.device.queue.writeBuffer(binding.buffer, 0, _scratch.buffer, 0, DEBUG_UNIFORM_BYTES);
|
|
35
|
+
// The debug views (depth, normal) sample no uv map, so stash identity to keep the shared Draw uniform
|
|
36
|
+
// authoritative — a prior tiled material's transform must not persist into this bind.
|
|
37
|
+
stashWgpuUvTransform(state, null);
|
|
38
|
+
return binding.bindGroup;
|
|
39
|
+
}
|
|
40
|
+
// A short, stable, order-independent string identity for a debug define key, used as the pipeline-cache
|
|
41
|
+
// key (combined with the color format). Two keys with the same flags produce the same string and so
|
|
42
|
+
// share a compiled pipeline. `d-` is depth; `n-` is normal; `nm` is normal + normal map.
|
|
43
|
+
export function buildWgpuDebugDefineKey(key) {
|
|
44
|
+
return `${key.mode === 'depth' ? 'd' : 'n'}${key.hasNormalMap ? 'm' : '-'}`;
|
|
45
|
+
}
|
|
46
|
+
// Compiles the debug module for a define key and builds the render pipeline for the given color format,
|
|
47
|
+
// with the group(2) material bind-group layout (uniform + sampler + one texture, matching the unlit
|
|
48
|
+
// material layout so the shared placeholder satisfies the texture slot). Pure GPU work — no caching —
|
|
49
|
+
// used by ensureWgpuDebugPipeline.
|
|
50
|
+
export function compileWgpuDebugPipeline(state, key, format, blended = false) {
|
|
51
|
+
const device = state.device;
|
|
52
|
+
const module = device.createShaderModule({ code: getWgpuDebugModuleSourceForKey(key) });
|
|
53
|
+
const materialBindGroupLayout = device.createBindGroupLayout({
|
|
54
|
+
entries: [
|
|
55
|
+
{ binding: 0, visibility: GPUShaderStage.FRAGMENT, buffer: { type: 'uniform' } },
|
|
56
|
+
{ binding: 1, visibility: GPUShaderStage.FRAGMENT, sampler: { type: 'filtering' } },
|
|
57
|
+
{ binding: 2, visibility: GPUShaderStage.FRAGMENT, texture: { sampleType: 'float' } },
|
|
58
|
+
],
|
|
59
|
+
});
|
|
60
|
+
// Debug materials are single-sided in OpenFL parity terms; the scene back-face cull is fine for both
|
|
61
|
+
// depth and normal visualization (a culled back face contributes neither depth nor normal).
|
|
62
|
+
return createWgpuMeshPipeline(state, { blended, doubleSided: false, format, materialBindGroupLayout, module });
|
|
63
|
+
}
|
|
64
|
+
// Resolves the debug pipeline for a define key + color format, compiling and caching it on first use
|
|
65
|
+
// through the shared scene pipeline cache under the `debug:` family namespace. Distinct modes (and the
|
|
66
|
+
// normal-map variant) cache as distinct entries.
|
|
67
|
+
export function ensureWgpuDebugPipeline(state, key, format) {
|
|
68
|
+
return ensureWgpuScene3DPipeline(state, `debug:${format}|${buildWgpuDebugDefineKey(key)}`, (blended) => compileWgpuDebugPipeline(state, key, format, blended));
|
|
69
|
+
}
|
|
70
|
+
// The full WGSL module source for a define key: the const-flag block (MODE discriminator + normal-map
|
|
71
|
+
// flag) + the shared mesh prelude (Frame/Draw/vs_main/srgbToLinear) + the debug material block +
|
|
72
|
+
// fs_main.
|
|
73
|
+
export function getWgpuDebugModuleSourceForKey(key) {
|
|
74
|
+
return (`const MODE : i32 = ${key.mode === 'depth' ? 'DEPTH_MODE' : 'NORMAL_MODE'};\n` +
|
|
75
|
+
`const HAS_NORMAL_MAP : bool = ${key.hasNormalMap ? 'true' : 'false'};\n` +
|
|
76
|
+
DEBUG_MODE_CONSTS_WGSL +
|
|
77
|
+
WGPU_MESH_PRELUDE_WGSL +
|
|
78
|
+
DEBUG_WGSL_BODY);
|
|
79
|
+
}
|
|
80
|
+
// Debug material uniform: params vec4f (16) = 16 bytes / 4 floats. params.x = near, params.y = far
|
|
81
|
+
// (depth mode); params.z = normalScale (normal mode, reserved for the future normal-map path).
|
|
82
|
+
const DEBUG_UNIFORM_BYTES = 16;
|
|
83
|
+
// The two mode discriminator values, declared as consts so the MODE const set by the module header
|
|
84
|
+
// reads as a named branch in the fragment body (WGSL has no preprocessor #define).
|
|
85
|
+
const DEBUG_MODE_CONSTS_WGSL = /* wgsl */ `
|
|
86
|
+
const DEPTH_MODE : i32 = 0;
|
|
87
|
+
const NORMAL_MODE : i32 = 1;
|
|
88
|
+
`;
|
|
89
|
+
const DEBUG_WGSL_BODY = /* wgsl */ `
|
|
90
|
+
struct DebugMaterial {
|
|
91
|
+
params : vec4f, // x = near, y = far (depth); z = normalScale (normal)
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
@group(2) @binding(0) var<uniform> material : DebugMaterial;
|
|
95
|
+
@group(2) @binding(1) var materialSampler : sampler;
|
|
96
|
+
@group(2) @binding(2) var normalTexture : texture_2d<f32>;
|
|
97
|
+
|
|
98
|
+
@fragment fn fs_main(in : VertexOutput, @builtin(front_facing) frontFacing : bool) -> @location(0) vec4f {
|
|
99
|
+
if (MODE == DEPTH_MODE) {
|
|
100
|
+
// Linear view-space distance is the perspective w: in.clipPosition is the @builtin(position), whose
|
|
101
|
+
// .w in the fragment scene2d is 1 / w_clip, so 1 / in.clipPosition.w == w_clip == eye distance. This
|
|
102
|
+
// is camera-agnostic (no camera near/far needed); map it across the material's [near, far]
|
|
103
|
+
// visualization window to grayscale [0, 1].
|
|
104
|
+
let near = material.params.x;
|
|
105
|
+
let far = material.params.y;
|
|
106
|
+
let eyeDepth = 1.0 / in.clipPosition.w;
|
|
107
|
+
let d = clamp((eyeDepth - near) / max(far - near, 1e-6), 0.0, 1.0);
|
|
108
|
+
return vec4f(vec3f(d), in.objectAlpha);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
// NORMAL_MODE: visualize the WORLD-space surface normal — the geometric normal carried through
|
|
112
|
+
// draw.normalMatrix in vs_main. The normal-map branch is gated by HAS_NORMAL_MAP but stays inert on
|
|
113
|
+
// wgpu until map upload lands (see the prelude note); normalScale is read so the binding is live.
|
|
114
|
+
var geometricNormal = normalize(in.worldNormal);
|
|
115
|
+
if (!frontFacing) {
|
|
116
|
+
geometricNormal = -geometricNormal;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
var normal = geometricNormal;
|
|
120
|
+
if (HAS_NORMAL_MAP) {
|
|
121
|
+
let tangent = normalize(in.worldTangent.xyz);
|
|
122
|
+
let bitangent = cross(geometricNormal, tangent) * in.worldTangent.w;
|
|
123
|
+
var tangentNormal = textureSample(normalTexture, materialSampler, in.uv).xyz * 2.0 - 1.0;
|
|
124
|
+
tangentNormal = vec3f(tangentNormal.xy * material.params.z, tangentNormal.z);
|
|
125
|
+
let tbn = mat3x3f(tangent, bitangent, geometricNormal);
|
|
126
|
+
normal = normalize(tbn * tangentNormal);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
return vec4f(normal * 0.5 + 0.5, in.objectAlpha);
|
|
130
|
+
}
|
|
131
|
+
`;
|
|
132
|
+
const _scratch = new Float32Array(DEBUG_UNIFORM_BYTES / 4);
|
|
133
|
+
//# sourceMappingURL=wgpuDebugPrelude.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wgpuDebugPrelude.js","sourceRoot":"","sources":["../src/wgpuDebugPrelude.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AAGlE,OAAO,EACL,sBAAsB,EACtB,gCAAgC,EAChC,yBAAyB,EACzB,oBAAoB,EACpB,sBAAsB,GACvB,MAAM,oBAAoB,CAAC;AAC5B,O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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0ClC,CAAC;AAEF,MAAM,QAAQ,GAAG,IAAI,YAAY,CAAC,mBAAmB,GAAG,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { Environment, ImageResource, WgpuRenderState } from '@flighthq/types';
|
|
2
|
+
export declare function ensureWgpuEnvironmentSourceCube(state: WgpuRenderState, environment: Readonly<Environment>): GPUTextureView | null;
|
|
3
|
+
export declare function updateWgpuEnvironmentCubeFace(state: WgpuRenderState, face: number, image: Readonly<ImageResource>): boolean;
|
|
4
|
+
//# sourceMappingURL=wgpuEnvironmentCube.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wgpuEnvironmentCube.d.ts","sourceRoot":"","sources":["../src/wgpuEnvironmentCube.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAe,WAAW,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAgBhG,wBAAgB,+BAA+B,CAC7C,KAAK,EAAE,eAAe,EACtB,WAAW,EAAE,QAAQ,CAAC,WAAW,CAAC,GACjC,cAAc,GAAG,IAAI,CAyBvB;AAQD,wBAAgB,6BAA6B,CAC3C,KAAK,EAAE,eAAe,EACtB,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,QAAQ,CAAC,aAAa,CAAC,GAC7B,OAAO,CAKT"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { uploadWgpuTextureImageResource } from '@flighthq/render-wgpu';
|
|
2
|
+
import { getWgpuScene3DRuntime } from './wgpuScene3DRuntime';
|
|
3
|
+
// Uploads an Environment's source radiance cubemap (six ImageResource faces) to a wgpu cube texture,
|
|
4
|
+
// caching it on the scene runtime. Returns null when the environment has no complete cube — all six faces
|
|
5
|
+
// bound with pixels, either a decoded `source` element or raw `data` — which callers treat as "no
|
|
6
|
+
// environment this frame". Each face uploads through whichever representation it carries:
|
|
7
|
+
// copyExternalImageToTexture for a `source`, or queue.writeTexture for a data-only face (a generated
|
|
8
|
+
// Surface, e.g. the skybox's rotateSurface180 path, which never allocates a canvas). The WGSL mirror of
|
|
9
|
+
// scene-gl's ensureGlEnvironmentSourceCube. The upload is keyed by identity: re-uploaded only when the
|
|
10
|
+
// cached view is absent (a changed cube must drop the cache first via destroyWgpuScene3DIbl). The faces are
|
|
11
|
+
// stored sRGB-encoded (rgba8unorm) and decoded to linear by the bake/skybox shaders that sample them,
|
|
12
|
+
// matching scene-gl's sRGB-passthrough convention (the GL path uploads UNSIGNED_BYTE + decodes in-shader).
|
|
13
|
+
// Returns the cube-dimension GPUTextureView the bake + skybox sample. The source cube is a non-GC GPU
|
|
14
|
+
// resource freed by destroyWgpuScene3DIbl.
|
|
15
|
+
export function ensureWgpuEnvironmentSourceCube(state, environment) {
|
|
16
|
+
const scene = getWgpuScene3DRuntime(state);
|
|
17
|
+
if (scene.environmentSourceCubeView !== null)
|
|
18
|
+
return scene.environmentSourceCubeView;
|
|
19
|
+
const cube = environment.environment;
|
|
20
|
+
if (cube === null || !hasWgpuCubeFacePixels(cube))
|
|
21
|
+
return null;
|
|
22
|
+
// Cube textures must be square; every face shares the +X face's dimensions (a well-formed cube).
|
|
23
|
+
const size = cube.faces[0].width;
|
|
24
|
+
const device = state.device;
|
|
25
|
+
const texture = device.createTexture({
|
|
26
|
+
size: [size, size, 6],
|
|
27
|
+
format: ENVIRONMENT_CUBE_FORMAT,
|
|
28
|
+
usage: GPUTextureUsage.TEXTURE_BINDING | GPUTextureUsage.COPY_DST | GPUTextureUsage.RENDER_ATTACHMENT,
|
|
29
|
+
});
|
|
30
|
+
// Each face uploads into its array layer, in the canonical +X, -X, +Y, -Y, +Z, -Z order (the array-layer
|
|
31
|
+
// index IS the face index — the wgpu counterpart of GL's CUBE_MAP_POSITIVE_X + face).
|
|
32
|
+
for (let face = 0; face < 6; face++) {
|
|
33
|
+
uploadWgpuTextureImageResource(device, texture, [0, 0, face], cube.faces[face]);
|
|
34
|
+
}
|
|
35
|
+
const view = texture.createView({ dimension: 'cube' });
|
|
36
|
+
scene.environmentSourceCube = texture;
|
|
37
|
+
scene.environmentSourceCubeView = view;
|
|
38
|
+
return view;
|
|
39
|
+
}
|
|
40
|
+
// Restamps a single face of the already-built source cube in place, uploading whichever representation the
|
|
41
|
+
// image carries (element or generated `data`). The incremental counterpart of the all-six
|
|
42
|
+
// ensureWgpuEnvironmentSourceCube — for dynamic cube content (reflection probes, a live sky face, or a
|
|
43
|
+
// generated data face mixed into loaded ones) without dropping and rebuilding the whole cube. `face` is the
|
|
44
|
+
// CubeFace* index (+X, -X, +Y, -Y, +Z, -Z). Returns false when no cube has been built yet — the caller
|
|
45
|
+
// must call ensureWgpuEnvironmentSourceCube first.
|
|
46
|
+
export function updateWgpuEnvironmentCubeFace(state, face, image) {
|
|
47
|
+
const texture = getWgpuScene3DRuntime(state).environmentSourceCube;
|
|
48
|
+
if (texture === null)
|
|
49
|
+
return false;
|
|
50
|
+
uploadWgpuTextureImageResource(state.device, texture, [0, 0, face], image);
|
|
51
|
+
return true;
|
|
52
|
+
}
|
|
53
|
+
// A face is uploadable when it carries pixels in either representation: a decoded `source` element or
|
|
54
|
+
// raw CPU `data` (a generated Surface). A cube is complete only when all six faces are uploadable.
|
|
55
|
+
function hasWgpuCubeFacePixels(cube) {
|
|
56
|
+
for (let face = 0; face < 6; face++) {
|
|
57
|
+
const image = cube.faces[face];
|
|
58
|
+
if (image == null || (image.source == null && image.data == null))
|
|
59
|
+
return false;
|
|
60
|
+
}
|
|
61
|
+
return true;
|
|
62
|
+
}
|
|
63
|
+
// The source radiance cube is stored sRGB-encoded (not rgba8unorm-srgb): the bake/skybox shaders decode it
|
|
64
|
+
// to linear themselves via srgbToLinear, exactly as scene-gl's shaders do, so the two backends agree.
|
|
65
|
+
const ENVIRONMENT_CUBE_FORMAT = 'rgba8unorm';
|
|
66
|
+
//# sourceMappingURL=wgpuEnvironmentCube.js.map
|
|
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AC3G,sGAAsG;AACtG,MAAM,uBAAuB,GAAqB,YAAY,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { Environment, WgpuRenderState } from '@flighthq/types';
|
|
2
|
+
export declare function bakeWgpuEnvironmentIbl(state: WgpuRenderState, environment: Readonly<Environment>): void;
|
|
3
|
+
export declare function destroyWgpuScene3DIbl(state: WgpuRenderState): void;
|
|
4
|
+
//# sourceMappingURL=wgpuEnvironmentIblBake.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wgpuEnvironmentIblBake.d.ts","sourceRoot":"","sources":["../src/wgpuEnvironmentIblBake.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAkB,MAAM,iBAAiB,CAAC;AAkBpF,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,eAAe,EAAE,WAAW,EAAE,QAAQ,CAAC,WAAW,CAAC,GAAG,IAAI,CAgCvG;AAOD,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,eAAe,GAAG,IAAI,CAmClE"}
|