Compare commits

..

4 Commits

Author SHA1 Message Date
DramaticShape a7cbfc8b70 Merge pull request #149 from DramaticShape/1.8.1
1.8.1
2026-08-09 00:08:10 -04:00
DramaticShape 0a48f764f6 Merge pull request #145 from luisgonzaleznf/fix/scene-shader-precision-love12
fix: scene shader under LÖVE 12 — qualify fireflyNight's precision
2026-08-08 21:54:13 -04:00
DramaticShape bed08c6c44 Merge pull request #146 from DramaticShape/1.8.1
1.8.1
2026-08-08 19:58:33 -04:00
luisgonzaleznf 2a924ea8a3 fix scene shader under LOVE 12: qualify fireflyNight's precision
An unqualified float uniform takes each stage's default precision, and
those differ -- highp in the vertex stage, mediump in the fragment one.
LOVE 11 linked the pair regardless; LOVE 12 requires both declarations to
carry the same qualifier and refuses the shader:

  Cannot compile shader: ERROR: Linking fragment stage: Precision
  qualifiers must match: vertex stage: fireflyNight "" fragment stage:
  fireflyNight ""

Voxel3D.available() is 'the scene shader compiled', so the refusal takes
the whole 3D pass with it and the overworld silently falls back to flat
2D.  That is the current state on iOS, whose shell ships LOVE 12, and it
is latent for every other platform that moves to 12.

Uses LOVE_HIGHP_OR_MEDIUMP, the same macro vWorld and vGrid already carry.
2026-08-09 01:48:05 +02:00
+8 -1
View File
@@ -89,7 +89,14 @@ local SHADER = [[
varying vec3 vSun; // this fragment's place in the sun's view varying vec3 vSun; // this fragment's place in the sun's view
varying float vFog; // how deep into the map's haze it stands varying float vFog; // how deep into the map's haze it stands
varying float vFirefly; // zero normally, night glow on firefly cards varying float vFirefly; // zero normally, night glow on firefly cards
uniform float fireflyNight; // shared safely by vertex and pixel stages // Explicitly qualified, and it has to be: an unqualified float takes each
// STAGE's default precision, and those do not agree -- highp in the vertex
// stage, mediump in the fragment one. LOVE 11 linked the pair anyway;
// LOVE 12 holds both declarations to the same qualifier and refuses the
// whole shader over it, which costs the entire 3D pass -- Voxel3D.available()
// is a shader that compiled, and the overworld falls back to flat 2D with
// nothing said anywhere. Same macro the varyings below already use.
uniform LOVE_HIGHP_OR_MEDIUMP float fireflyNight;
#ifdef VOXEL_CULL #ifdef VOXEL_CULL
// where this fragment stands in the FLAT world, for the diorama's // where this fragment stands in the FLAT world, for the diorama's
// viewport to measure. Same precision reasoning as vGrid below: a // viewport to measure. Same precision reasoning as vGrid below: a