Monday, November 9, 2009

More fun with Lumas

Been doing some more work on Luma textures. Previous releases had a restriction whereby an external texture (from a texture pack) that had a luma available wouldn't have that luma loaded if there wasn't also luma texels in the native texture equivalent. Example: your pack might have a wbrick1_5_luma, but because the native wbrick1_5 does not have luma texels that texture wouldn't have been loaded.

I've now relaxed that restriction, but what it does mean is that all textures will go through the loader twice: once for the native texture, and once to check for a potential external luma (returning NULL if one is not found). This slows down map loading somewhat, so I'm going to need to do some optimization. I kinda like the sound of a gl_noexternal cvar, but it does mean that - owing to the fact that textures are cached - it will require an engine restart. Another option is to do a one-time check if the external texture dir exists and disable external loading if not. Not certain how well this will work with stuff like PAK files and the DarkPlaces non-standard alias model texture paths though.

I'm thinking that the cvar is the way to go for now at least, and maybe keep in mind that a more optimal solution will be required at some later date.

0 comments: