upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/docs/first_light.md
diff options
context:
space:
mode:
Diffstat (limited to 'docs/first_light.md')
-rw-r--r--docs/first_light.md16
1 files changed, 14 insertions, 2 deletions
diff --git a/docs/first_light.md b/docs/first_light.md
index 6f15a134e..654665c6c 100644
--- a/docs/first_light.md
+++ b/docs/first_light.md
@@ -1,7 +1,7 @@
1# First light: a real game model with its own translated shaders 1# First light: a game model's UVs drawn with translated game shaders
2 2
3**Status: measured** on the 1.0.2.1 package and an NVIDIA RTX 2060 SUPER (driver 620.73.04, Vulkan 1.4.357, 3**Status: measured** on the 1.0.2.1 package and an NVIDIA RTX 2060 SUPER (driver 620.73.04, Vulkan 1.4.357,
4CachyOS). This is the first draw of a real game model with its own translated VS and PS on a real GPU. The image 4CachyOS). The fixture draws a model from the package with a vertex and pixel shader chosen to display its UVs. The image
5stays in the user's work folder; this note records the counts and the recipe, not the model, the shaders or a 5stays in the user's work folder; this note records the counts and the recipe, not the model, the shaders or a
6screenshot. 6screenshot.
7 7
@@ -21,6 +21,13 @@ The shaders are two ordinary containers from `shaders.rpf`, carved and translate
21| VS | `128867d3233a97ba5b203c313a24ab8a77df20c2a308091a5595bb9f669677f4` | forwards POSITION and TEXCOORD from the vertex fetch to clip space and a varying | 21| VS | `128867d3233a97ba5b203c313a24ab8a77df20c2a308091a5595bb9f669677f4` | forwards POSITION and TEXCOORD from the vertex fetch to clip space and a varying |
22| PS | `ed4147a5f7514947c2eb8d79255bd80f72761ac1ba2205dd811d3e050cf1b495` | writes the interpolated TEXCOORD as the colour; no bindings, no texture | 22| PS | `ed4147a5f7514947c2eb8d79255bd80f72761ac1ba2205dd811d3e050cf1b495` | writes the interpolated TEXCOORD as the colour; no bindings, no texture |
23 23
24The model's authored shader assignment can be checked separately. In the model export manifest for the OBJ
25above, `MeshShaders[0]` selects material slot 0, the only slot. Looking up its `Materials[0].Shader` in the
26native shader database yields one effect with one technique and four compute-only passes. The VS and PS
27in the table are the fixture's chosen pair. The model's use during gameplay remains unverified.
28See the [effect lookup](https://github.com/ItsNotRexed/Leonida/pull/3036) and the
29[Windows reproduction of the UV draw](https://github.com/ItsNotRexed/Leonida/pull/2893#issuecomment-7084947193).
30
24Both disassemble with no invalid word, translate, and pass `spirv-val`; `tools/shader_link_check.py check` reports 31Both disassemble with no invalid word, translate, and pass `spirv-val`; `tools/shader_link_check.py check` reports
25the pair compatible. At 128×128 the draw covers **12,804 of 16,384 pixels (0.781)** and the centre pixel is 32the pair compatible. At 128×128 the draw covers **12,804 of 16,384 pixels (0.781)** and the centre pixel is
26`(0.498, 0.496, 0.0, 1.0)`: the model is the disc its geometry projects to, and the colour is its own UV map. The 33`(0.498, 0.496, 0.0, 1.0)`: the model is the disc its geometry projects to, and the colour is its own UV map. The
@@ -71,6 +78,11 @@ indices), writes `manifest.json` with the counts and FSSM hashes, and runs `vk_h
71other names from the carve index; `--no-fit` keeps a model that is already in NDC (the sky dome is). The test is 78other names from the carve index; `--no-fit` keeps a model that is already in NDC (the sky dome is). The test is
72package-gated: without `LEONIDA_FIRST_LIGHT_DIR` it skips, and it writes its image to that folder. 79package-gated: without `LEONIDA_FIRST_LIGHT_DIR` it skips, and it writes its image to that folder.
73 80
81Each run stages its pair in `<work>/first_light/dxbc` and translates it into `<work>/first_light/spirv`. Both folders
82are removed at the start of a run, so they hold that run's two shaders and nothing an earlier run selected; do not
83keep files there. The output folder (`first_light/out` or `--out`) and `<work>/shaders` are not emptied. If either
84folder is a symlink or a junction, or a file in it cannot be removed, the run stops and names it.
85
74## 4. The harness mode 86## 4. The harness mode
75 87
76`runtime/test/vk_harness.cpp` gained two environment options, inert when unset (the existing three-vertex and 88`runtime/test/vk_harness.cpp` gained two environment options, inert when unset (the existing three-vertex and