fix: shadow map under LÖVE 12 — clip z onto [0,1], probe the canvas y-orientation - #75
Conversation
…rientation The sun pass bypasses transform_projection and hand-rolls LOVE 11 clip conventions -- Mat4.ortho emits z in [-1,1], and fit() flips y to compensate 11's canvas-bound orientation. LOVE 12 changed both on every backend, so the map came back with the near half of the light frustum missing and the rest read vertically mirrored: the giant detached slabs seen on iOS, whose shell runs 12 while desktop runs 11.5. Z01 restores coverage, probeVSign restores placement -- isolated separately on LOVE 12 Metal and OpenGL, with LOVE 11.5 as the control. The packed depth is bit-identical under 11, so it cannot change there. Removes the iOS available() gate from DramaticShape#48, which is no longer needed.
|
@DramaticShape @castdrian — flagging this one when you get a moment, since it affects shipped builds rather than just 1.5.5 and 1.6.0 both went out with the sun pass still broken under LÖVE 12, so iOS users currently get either the misplaced shadow slabs or, on the It is also latent rather than iOS-only: desktop runs LÖVE 11.5 today, and the same breakage appears the day desktop or Android moves to 12. #82 is the same story for the water shader — it fails to compile under LÖVE 12 + Metal, so lakes draw flat on iOS. Independent of this one; they touch different files and can land in either order. Both are clean against current No rush and no expectation — you are clearly deep in stadium/horde work. Happy to rebase, split them smaller, or adjust anything about the approach if you would rather solve it differently. @castdrian, since this touches your #48, do shout if the interaction with the gate looks wrong from your side. |
|
That explains the water shader breaking. Thanks. Super busy and going to focus on polishing some stuff up so this will be included. |
…1 sprites
- OverworldBattle.BattleState:picImage now returns the sprite early for both
external and ROM images, skipping BattlePics.filled (the opaque-white
{1,1,1,1} filler). Transparent gaps in ROM sprites now show through instead
of being painted white. Mode-agnostic (static + animated, species + player).
- Per-slot SHINY options "FRONT SHINY FIX" / "BACK SHINY FIX" (species only;
players can never be shiny). When ON, the resolver prefers the shiny/ folder
and, on a missing shiny file, falls back to ROM -- never to the selected
generation's normal art and never to player.png. Animated gens (front 2-5,
back 3/5) are forced through the single-image shinyPrefix path so their
atlases are suppressed and do not play over a shiny mod's sprite.
- gen1 compatibility sets: back-static/gen1 (Yellow GBC backs) and
front-animated/gen1 (Yellow GBC fronts), 151 each, with provenance READMEs.
- Empty shiny/ folders (front/back x static/animated) ship with READMEs so
shiny mods have a documented drop target.
- Ported upstream PRs (lib hunks only, tests/VR stripped): DramaticShape#125 flat-top
meshing fix, DramaticShape#75 LÖVE 12 ShadowMap z-clip, DramaticShape#79 1ST label rename.
Co-Authored-By: Hermes Agent <noreply@nousresearch.com>
Fixes #74.
The sun pass bypasses
transform_projectionand hand-rolls LÖVE 11 clip conventions:Mat4.orthoemits clip z in [-1, 1] (its own comment says so), andfit()appliesMat4.scale(1, -1, 1)to compensate 11's canvas-bound y-flip. LÖVE 12 changed both, on every backend — love2d/love@7bfbd647 notes that projection matrices "no longer need to be flipped when rendering to a canvas versus the main screen", and closes with "custom projection matrices might need to be altered to account for the more consistent range".So under 12 the map comes back with the near half of the light frustum missing, and what does land is read vertically mirrored — the giant detached slabs in #74. The iOS shell runs LÖVE 12 while desktop runs 11.5, which is why it never showed up on desktop, and why it is latent for desktop and Android the day those move to 12.
Two changes, one file:
Z01— the light projection's clip z lands on [0, 1]. This is what restores coverage. [0, 1] sits inside the legacy clip volume too, and the packed depth the readers compare is bit-identical under 11 (vDepthreads clip z where it used to compute the same number from [-1, 1]), so 11.x cannot change by construction.probeVSign()— the reader's v-axis direction is measured once with a 4x4 draw through the pass's own shader, rather than assumed from a version or platform list. This is what restores placement. Any probe failure answers +1, which is exactly today's behaviour.No OS or version checks.
Each half was confirmed by running it alone under LÖVE 12:
Z01on its own gives a full map with the shadows still misplaced,probeVSignon its own the reverse. (Also ruled out on the way: not Metal-specific — it reproduces on LÖVE 12 + OpenGL — and not canvas dpiscale, since the LÖVE 11.5 control ran with the samepx 4096inflation and stayed clean.)Validated on:
Now that #48 is merged, this drops the iOS
available()gate it added: with the pass itself LÖVE 12-correct, iOS gets working shadows rather than none.PixelCanvasis adopted here ingetCanvas; the rest of #48 is untouched.Not addressed here, both noted in #74: the water shader fails to compile under LÖVE 12 + Metal, so lakes draw flat; and the scene camera's own bypass projection has the same latent y issue, but is currently compensated engine-side on iOS (bryanthaboi/gen1recomp#582), so it needs to move in step with the engine rather than in this PR.
love.graphics.setOrthoProjectionis probably the idiomatic endgame for all of this once the supported floor is LÖVE 12; this keeps the mod running identically on 11 and 12 today.