← Commit history

shadows animate: shadow map refreshRate every-frame (bundle froze it post-load)

John Lauer ·080e777bb0 ·3mo ago ·parent 7003301
3 files changed +21−5
package.json+1−1
@@ -2,7 +2,7 @@   "slug": "bq25792-charger",   "title": "BQ25792 Charger",   "type": "component",-  "version": "0.1.37",+  "version": "0.1.38",   "description": "BQ25792 Charger - buck-boost 1S-4S battery charger board by Adonis, with real 3D copper traces and measured stackup.",   "tags": [     "hardware"
page.json+10−3
@@ -4,9 +4,16 @@   "slug": "bq25792-charger",   "title": "BQ25792 Charger",   "brief": "Buck-boost 1S-4S battery charger board (TI BQ25792) with 14 Adom machine pins, by Adonis",-  "version": "0.1.37",+  "version": "0.1.38",   "tags": [-    "hardware"+    "adom",+    "adom-modular",+    "component",+    "charger",+    "battery",+    "bq25792",+    "power",+    "usb-c"   ],   "license": "proprietary",   "component": {@@ -49,7 +56,7 @@     "email": "[email protected]"   },   "visibility": "public",-  "description": "BQ25792 Charger - buck-boost 1S-4S battery charger board by Adonis, with real 3D copper traces and measured stackup.",+  "description": "BQ25792 Charger - a buck-boost 1S-4S battery charger board (Texas Instruments BQ25792) designed by Adonis in Fusion 360, with 14 Adom machine pins for the modular stack. Interactive colored 3D model, schematic and layout views.",   "dependencies": {},   "files": [     "README.md",
readme.html+10−1
@@ -293,7 +293,16 @@ exported bodies + design rules.</p>     }else{       sc.lights.forEach(l=>{ const g=l.getShadowGenerator&&l.getShadowGenerator(); if(g&&!sg) sg=g; });     }-    if(sg) LAYERS.forEach(L=>L.meshes.forEach(m=>{ try{ sg.addShadowCaster(m,true);}catch(e){} }));+    if(sg){+      LAYERS.forEach(L=>L.meshes.forEach(m=>{ try{ sg.addShadowCaster(m,true);}catch(e){} }));+      // the bundle freezes the shadow map after load - re-render it EVERY frame so+      // shadows track the moving layers+      try{+        const smap=sg.getShadowMap();+        smap.refreshRate=B().RenderTargetTexture.REFRESHRATE_RENDER_ONEVERYFRAME;+        if(sg.getLight&&sg.getLight().autoUpdateExtends!==undefined) sg.getLight().autoUpdateExtends=true;+      }catch(e){}+    }      // ground: 80% transparent, receives shadows     sc.meshes.forEach(m=>{ if(/ground/i.test(m.name||"")){ try{ if(m.material) m.material.alpha=0.2; m.receiveShadows=true; }catch(e){} } });