DaemonEngine / Daemon

The Dæmon game engine. With some bits of ioq3 and XreaL.
https://unvanquished.net
BSD 3-Clause "New" or "Revised" License
303 stars 60 forks source link

Broken wasteland skybox #1393

Open illwieckz opened 1 day ago

illwieckz commented 1 day ago

It worked before™ but it doesn't anymore:

Warn: cube map face 'env/wasteland/wasteland_rt' has DXTn compression, cube map unusable 
Warn: could not find cubemap 'env/wasteland/wasteland' for outer skybox in shader 'textures/perseus_env/sky' 

I first reproduced it on atcshd that ships wasteland, but one can reproduce it with stock assets as perseus ships a copy of wasteland.

illwieckz commented 1 day ago

The env/wasteland/wasteland_rt file is WebP (same for other faces), not CRN, so an error log about DXTn compression is wrong.

illwieckz commented 1 day ago

There is env/wasteland/wasteland that is CRN but it's the level editor preview image, it's not supposed to be loaded by the engine.

illwieckz commented 1 day ago

In previous releases, env/wasteland/wasteland_rt was jpeg and env/wasteland/wasteland preview was already CRN.

illwieckz commented 1 day ago

In fact current perseus release also uses jpg for skybox faces, that is atcshd that uses webp.

illwieckz commented 1 day ago

Renaming that env/wasteland/wasteland fixes the bug, so the engine is likely now mistakenly trying to load the basename of the skybox…

illwieckz commented 1 day ago
Debug: found crn cube map 'env/wasteland/wasteland' 
Debug: found ktx cube map 'env/wasteland/wasteland' 
Debug: looking for OpenGL cube map face 'env/wasteland/wasteland_px' 
Debug: looking for Quake cube map face 'env/wasteland/wasteland_rt' 
Warn: cube map face 'env/wasteland/wasteland_rt' has DXTn compression, cube map unusable 
Debug: looking for DarkPlaces cube map face 'env/wasteland/wastelandpx' 
Debug: looking for Doom 3 cube map face 'env/wasteland/wasteland_forward' 
Warn: could not find cubemap 'env/wasteland/wasteland' for outer skybox in shader 'textures/perseus_env/sky' 

The thing is that we have a code to load 6-faces CRN skybox (but don't make use of it yet), so it loads the preview instead.

I wonder how it has worked before…

illwieckz commented 1 day ago

The log saying it founds it as KTX too is wrong though…

illwieckz commented 1 day ago

Right now the skybox code is iterating crn and ktx, strips extension, pass the basename to R_FindImageLoader which itself iterates both crn and ktx and others and returns true if one is found, meaning crn and ktx is always true in the first loop.