mirror of
https://github.com/DramaticShape/DramaticShapeVoxelMod.git
synced 2026-08-12 08:31:06 +02:00
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.
This commit is contained in:
+8
-1
@@ -89,7 +89,14 @@ local SHADER = [[
|
||||
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 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
|
||||
// where this fragment stands in the FLAT world, for the diorama's
|
||||
// viewport to measure. Same precision reasoning as vGrid below: a
|
||||
|
||||
Reference in New Issue
Block a user