fix(dashboard): 3D views never draw a kept manifest with the game shaders

The game shader views looked up each shader's technique in the manifest's
"techniques". Property scenery manifests are cached by browsers for a day
(world ones for an hour), so after the update a browser drew the property
view from the manifest the older server had sent, which has no
techniques: every shader fell back to LEGO, whose decal texture alpha
laid the see-through tree, rock and water textures over white vertex
colors. Nimbus Isle came out with white trees, rocks and water, a yellow
build surface and a solid white build border.

- Manifest URLs carry the conversion format the views are written for
  (?format=5, scenery-core.js SCENERY_FORMAT), so a kept manifest from
  an older server is never used; SceneryCoreJs checks it matches
  Scenery.cpp FORMAT_VERSION.
- A manifest without techniques (an older server's) is drawn with the
  viewer's own lights and its textureAlpha table instead of every
  shader guessed as LEGO.
- A material whose NiAlphaController animates its alpha is drawn at its
  highest key. The AnimAlpha shaders now use the material alpha, and
  effects resting at 0 in the file (the Venture Explorer's lightning)
  had vanished. Conversion format 5.

Checked by rendering the world view of every zone with models and the
property view of every property template (headless, fixed cameras)
before and after, and the Nimbus Isle property with a manifest stripped
of its techniques, which reproduced the white look.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Aaron Kimbrell
2026-09-28 16:08:28 -05:00
parent f45a21c15f
commit 4bd34dc087
8 changed files with 154 additions and 34 deletions

View File

@@ -274,11 +274,13 @@ namespace {
/**
* Bump when NifFile's output changes: converted models kept on disk are made again, and the manifests' "format"
* goes into the viewers' model and texture URLs so browsers don't keep drawing the old ones (they're cached for
* a week). 2: meshes carry their multishader tag; conversions without it drew glom parts with the LEGO shader.
* 3: dark textures and the UV set each texture names. 4: the game's shaders draw the models (manifest
* "techniques"), vertex colors go to them as stored.
* a week). The viewers ask for manifests with the format they're written for (scenery-core.js SCENERY_FORMAT,
* which must follow this; SceneryCoreJs checks), so a manifest a browser kept for a day from an older server
* isn't drawn with newer code. 2: meshes carry their multishader tag; conversions without it drew glom parts with
* the LEGO shader. 3: dark textures and the UV set each texture names. 4: the game's shaders draw the models
* (manifest "techniques"), vertex colors go to them as stored. 5: an animated material alpha is its highest key.
*/
constexpr uint32_t FORMAT_VERSION = 4;
constexpr uint32_t FORMAT_VERSION = 5;
// A zone's lighting (WorldScene::Lighting) for the viewers' shaders
nlohmann::json LightingJson(const WorldScene::Lighting& lighting) {