Main light can now be moved, intensity can be regulated and update environment image for model viewer

This commit is contained in:
Yeicor
2025-07-19 16:52:15 +02:00
parent 4af4315984
commit a2275f2897
7 changed files with 83 additions and 4 deletions

View File

@@ -30,7 +30,8 @@ export async function settings() {
exposure: 1,
shadowIntensity: 0,
// Nice low-res outdoor/high-contrast HDRI image (CC0 licensed) for lighting
background: new URL('../../assets/qwantani_afternoon_1k.hdr', import.meta.url).href,
environment: new URL('../../assets/qwantani_afternoon_1k_hdr.jpg', import.meta.url).href,
environmentIntensity: 1.0,
// Uniform (1x1 pixel) medium gray background for visibility (following dark/light mode)
skybox: (window.matchMedia("(prefers-color-scheme: dark)").matches ?
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAA1BMVEU4ODiyn42XAAAACklEQVQI" +
@@ -38,6 +39,7 @@ export async function settings() {
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAA1BMVEW6urpaLVq8AAAACklEQVQI" +
"12NgAAAAAgAB4iG8MwAAAABJRU5ErkJggg=="),
};
// settings.skybox = settings.background = ''; // Disable both skybox and background
// Auto-override any settings from the URL
const url = new URL(window.location.href);