fix: remove unnecessary Y-flip when sampling Mode7 texture

The texture2D call was flipping the UV Y coordinate (1.0 - uv.y)
before sampling, which is no longer needed. Simplify to use UV
coordinates directly.
This commit is contained in:
Brian Fertig 2026-07-17 16:22:57 -06:00
parent 81145d7891
commit aabf8aa9f3
2 changed files with 107 additions and 1 deletions

View File

@ -62,7 +62,7 @@ void main () {
if (uv.x < 0.0 || uv.x > 1.0 || uv.y < 0.0 || uv.y > 1.0) { if (uv.x < 0.0 || uv.x > 1.0 || uv.y < 0.0 || uv.y > 1.0) {
col = uFog; col = uFog;
} else { } else {
col = texture2D(iChannel0, vec2(uv.x, 1.0 - uv.y)).rgb; col = texture2D(iChannel0, uv).rgb;
} }
float fog = smoothstep(uFogRange.x, uFogRange.y, z); float fog = smoothstep(uFogRange.x, uFogRange.y, z);
gl_FragColor = vec4(mix(col, uFog, fog), 1.0); gl_FragColor = vec4(mix(col, uFog, fog), 1.0);

View File

@ -0,0 +1,106 @@
# Super Kart — spritesheets needed
Everything below renders procedurally (tinted silhouettes, painted horizons)
until real art is dropped in, so none of this blocks the game working — but
here's the full list of what to paint, sized and ordered exactly as the code
expects. Drop-in paths are wired through `data/superkart-artwork.json` (set
`path` there once a PNG exists — no code changes needed) except for the menu
background, which is a single fixed file.
All racer/theme/item art needs a **transparent background**.
## 1. Racer karts — one sheet per racer
9 sheets, one per entry in `data/superkart-racers.json`:
| id | display name |
|---|---|
| `mario` | Mario |
| `kona` | Kona |
| `fireball` | Fireball |
| `smasher` | The Smasher |
| `croc` | Croc |
| `gerome` | Gerome |
| `blackwind` | Blackwind |
| `dv-8-2303` | DV-8-2303 |
| `zanthor` | Zanthor |
- **Frame size:** 64×64
- **Layout:** 18 frames in a single row → **1152×64 px**
- **File:** set `racerSheets.<id>.path` in `data/superkart-artwork.json`
- **Frames 015** — the kart viewed from 16 angles, rotating **clockwise as
seen from above**, in 22.5° steps:
- frame 0 = dead-on from **behind**
- frame 4 = kart's left side
- frame 8 = head-on (facing the viewer)
- frame 12 = kart's right side
- **Frames 1617** — optional player-view lean frames (16 = leaning left,
17 = leaning right), used only for the player's fixed on-screen kart while
steering. If the sheet is only 16 frames wide, the game reuses frame 0 with
a programmatic tilt instead — fine to skip.
- Kart centered horizontally in each frame, wheels touching the bottom edge
(world sprites are anchored a bit above the frame's bottom, not dead
center, so keep the kart's visual weight low in the frame).
## 2. Theme decor — one sheet per track theme
6 sheets, one per theme in `data/superkart-rules.json`:
| theme id | decor order (frame 0, 1, 2 — frames 37 spare) |
|---|---|
| `beach` | palm, umbrella, rock |
| `volcano` | boulder, vent, spire |
| `scrapyard` | tirepile, crane, wreck |
| `swamp` | cypress, reeds, log |
| `speedway` | grandstand, billboard, flagpole |
| `nightcity` | tower, neon, lamppost |
- **Frame size:** 64×64
- **Layout:** 8 frames in a single row → **512×64 px** (only the first 3 are
currently used per theme; the rest are free for future decor)
- **File:** set `themeSheets.<theme>.path` in `data/superkart-artwork.json`
- Drawn perspective-scaled beside the track, anchored near the bottom of the
frame like the karts above.
## 3. Backdrops — one horizon strip per theme
6 images, same theme ids as above.
- **Size:** 1024×300 px
- **File:** set `backdrops.<theme>.path` in `data/superkart-artwork.json`
- Must **tile horizontally** — left and right edges need to match, since it's
scrolled as the camera rotates through a full 360°.
- Drawn above the horizon line; the bottom edge's color should blend toward
that theme's `fog` color in `data/superkart-rules.json` so the seam into
the 3D ground plane is invisible.
## 4. Item icons — one shared sheet
- **Frame size:** 48×48
- **Layout:** 9 frames in a single row → **432×48 px**
- **File:** set `itemSheet.path` in `data/superkart-artwork.json`
- **Frame order** (matches `items` in `data/superkart-rules.json`, plus two
extras):
0. bolt
1. seeker
2. oil
3. turbo
4. overdrive
5. emp
6. coins
7. item box (the question-mark-style box karts drive through)
8. single coin (the pickup, distinct from the "coins" item icon in frame 6)
## 5. Main menu background — single image
- **File:** `assets/images/superkart-background.png` (already exists —
registered directly in `src/data/assetManifest.js`, not through the
drop-in artwork JSON)
- **Size:** ~1920×1080 (16:9); current art is 1928×1088 and gets stretched
to fill the canvas, so keep close to that aspect ratio for future updates
or revisions
- Shown behind the menu, class/racer select, cup/track select, results, and
podium screens (anywhere that isn't an active race — the Mode 7 ground
fully covers it during racing). The game draws a ~45%-alpha dark scrim
over it for text contrast, so avoid relying on fine detail or very light
colors in areas where UI text sits (title/top band, center column).