mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-11-04 02:47:14 +00:00
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:
@@ -9,7 +9,7 @@
|
||||
* follows the camera, far away, behind everything.
|
||||
*/
|
||||
import * as THREE from 'three';
|
||||
import { parseModel, mergeMeshes, parseDds, decodeDxt, completeChain, linearColors, groupObjects, cellsOf, textureAlphaMode, gameLook, blendingOf, TECHNIQUE, decodeSceneMap, sceneAt, loadedScenes } from '/js/scenery-core.js';
|
||||
import { parseModel, mergeMeshes, parseDds, decodeDxt, completeChain, linearColors, groupObjects, cellsOf, textureAlphaMode, gameLook, gameShaded, manifestUrl, blendingOf, TECHNIQUE, decodeSceneMap, sceneAt, loadedScenes } from '/js/scenery-core.js';
|
||||
import { createGameShading } from '/js/game-shaders.js';
|
||||
|
||||
// Per detail level (the property view's 0 high, 1 medium, 2 low): the model LOD, how far objects are drawn, the
|
||||
@@ -276,7 +276,7 @@ export function createScenery({ scene, camera, renderer, urls, focus, onProgress
|
||||
// The sky's layers keep their order; everything else has its look-alike pieces joined
|
||||
for (const mesh of forSky ? model.meshes : mergeMeshes(model.meshes)) {
|
||||
if (!mesh.vertices || !mesh.indices.length) continue;
|
||||
const look = forSky ? (manifest.lighting ? skyLook(mesh) : null) : gameLook(manifest, asset, mesh);
|
||||
const look = forSky ? (gameShaded(manifest) ? skyLook(mesh) : null) : gameLook(manifest, asset, mesh);
|
||||
// Post-processing and shadow shaders: the game draws nothing of these in the world
|
||||
if (look && look.hidden) continue;
|
||||
const textureOf = async (slot, clampU, clampV) => {
|
||||
@@ -490,7 +490,7 @@ export function createScenery({ scene, camera, renderer, urls, focus, onProgress
|
||||
manifest = null;
|
||||
let loaded = null;
|
||||
try {
|
||||
const response = await fetch(url, { credentials: 'same-origin', signal: requests.signal });
|
||||
const response = await fetch(manifestUrl(url), { credentials: 'same-origin', signal: requests.signal });
|
||||
if (response.ok) loaded = await response.json();
|
||||
} catch (error) {
|
||||
// Aborted by a newer load or clear, or the network failed
|
||||
|
||||
Reference in New Issue
Block a user