entangled-worlds-orbiters-shared 1.0.5 → 1.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/moons/moonsGeneration.js +5 -12
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as THREE from 'three';
|
|
2
2
|
import { loadTexture } from '../loaders/bodyTextureLoader.js';
|
|
3
|
-
import {
|
|
3
|
+
import { resolvePublicUrl } from '../config/env.js';
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
function moonTexPath(file) {
|
|
6
|
+
return resolvePublicUrl(`default/textures/moons/${file}`);
|
|
7
|
+
}
|
|
8
8
|
export const DEFAULT_MOON_TEX_KTX2 = moonTexPath('moon-equirectangular.ktx2');
|
|
9
9
|
export const DEFAULT_MOON_TEX_PNG = moonTexPath('moon-equirectangular.png');
|
|
10
10
|
|
|
@@ -90,16 +90,9 @@ export async function generateMoons({
|
|
|
90
90
|
try { sharedTexture = await buildUvGridTexture(); usedUvGrid = true; } catch(_) {}
|
|
91
91
|
} else if (useTexture) {
|
|
92
92
|
// Use textureKey if provided, otherwise fall back to default textures
|
|
93
|
-
let primaryTexture = textureKey
|
|
93
|
+
let primaryTexture = textureKey ? resolvePublicUrl(textureKey) : textureKTX2;
|
|
94
94
|
const fallbackTexture = texturePNG;
|
|
95
95
|
|
|
96
|
-
// Resolve textureKey to absolute URL if it's relative
|
|
97
|
-
if (textureKey && textureKey.startsWith('/')) {
|
|
98
|
-
primaryTexture = `${HERBARIUM_BASE}${textureKey}`;
|
|
99
|
-
} else if (textureKey) {
|
|
100
|
-
primaryTexture = textureKey; // already absolute
|
|
101
|
-
}
|
|
102
|
-
|
|
103
96
|
try {
|
|
104
97
|
sharedTexture = await loadTexture(primaryTexture);
|
|
105
98
|
} catch (eKTX) {
|