CREATORJD commited on
Commit
34f8bbb
·
verified ·
1 Parent(s): a2d9270

v1.32.48 renderer diagnostic + terrain fallback

Browse files
Files changed (1) hide show
  1. src/ui/render3d.js +17 -1
src/ui/render3d.js CHANGED
@@ -394,7 +394,22 @@ function render(dtDraw){
394
 
395
  /* ---------------- terrain ----------------
396
  Drawn with its own program so it can sample the painted map canvas plus a
397
- tiling detail layer, rather than flat vertex colour. */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
398
  gl.useProgram(progT);
399
  gl.uniformMatrix4fv(UT.uVP,false,matVP);
400
  gl.uniform3f(UT.uEye,eyeX,eyeY,eyeZ);
@@ -420,6 +435,7 @@ function render(dtDraw){
420
  gl.activeTexture(gl.TEXTURE0);
421
  drawTerrainEdge();
422
  drawTerrain();
 
423
  drawShadows(Sun); // ground shadows go on before anything stands on them
424
  begin3D(S_nA); // back to the lit model program
425
 
 
394
 
395
  /* ---------------- terrain ----------------
396
  Drawn with its own program so it can sample the painted map canvas plus a
397
+ tiling detail layer, rather than flat vertex colour.
398
+
399
+ UNLESS THAT PROGRAM DID NOT BUILD. On a GPU where the terrain shader fails
400
+ to compile or link, every other program still works — so units, buildings,
401
+ rocks and crystals render normally and the GROUND is simply absent. That is
402
+ the "map isn't rendering" report, and it is invisible from here because the
403
+ failure only ever reached a phone's console. The terrain VAO carries the
404
+ model program's exact vertex layout, so we can still draw real lit ground:
405
+ vertex colour and material instead of the painted map, which is a downgrade
406
+ but not a void. */
407
+ if(typeof terrainProgOK!=='undefined'&&!terrainProgOK&&prog3D){
408
+ begin3D(S_nA);
409
+ setEmis(0);
410
+ drawTerrainFallback();
411
+ begin3D(S_nA);
412
+ } else {
413
  gl.useProgram(progT);
414
  gl.uniformMatrix4fv(UT.uVP,false,matVP);
415
  gl.uniform3f(UT.uEye,eyeX,eyeY,eyeZ);
 
435
  gl.activeTexture(gl.TEXTURE0);
436
  drawTerrainEdge();
437
  drawTerrain();
438
+ }
439
  drawShadows(Sun); // ground shadows go on before anything stands on them
440
  begin3D(S_nA); // back to the lit model program
441