[ВП] Эпичность в квадрате

Продолжение рубрики «Все подряд».
В этом выпуске: масса, просто мегатонна эпичности, течис , орбы и немного уличной магии из мира варкрафта.

Baited

Участник недавнего конкурса на лучшую анимационную работу внутри DotA 2:



Проголосовать за эпичность можно здесь. В принципе, мувие не без изъяна, например, Инвокер мог сильно запороть комбо своими торнадо, да и Траксуля сиськами полигонами, в отличие от последней Лары Крофт, не сверкает. Впрочем, сцена Релокейта вполне искупает эти мелкие огрехи. Плюс музыка, под которую даже на 1к чувствуется ответственность за всё живое на планете.

Какого героя нужно удалить из доты?

С радостью отдал голос за маленьких пидорков. Впрочем, это все равно что вести сопротивление с властями посредством перестановки Конституции на полку «фантастика» — ты вроде бы че-то и сделал, но всё такой же бесполезный, как и был.



Орб-эффекты

На старой версии сайта была ссылка на таблицу орбов, но после переезда она безжалостно похерилась. Перезалил сюда давненько, но без серьезной уборки ссылку всё равно некуда добавить. Надо сделать перестановку.

Warcraft 3 и магия BLP

BLP, как я уже писал однажды, через задницу работает с Маками. Но, как недавно выяснили, не всё так просто — «не работает», а намного интереснее.

BLP files have a field which I call «hasMipmaps» which is used to determine mipmap availability. Mipmaps are only used/loaded if this field is set, in which case it will try to load a full set of mipmap images (down to the 1*1 pixel level). If not set then only the full sized image (mipmap 0) will be loaded.

The mipmap data chunk table plays no part in deciding if a mipmap exists or not, instead it is assumed to always be correct for the number of mipmaps needed. Number of mipmaps needed is determined by the hasMipmaps field and the height and width field. Entries in the table for mipmap levels that are not needed are ignored.

If the mipmap image chunk data is invalid then any kind of nonsense can occur. For example if an indexed BLP file has the chunk length specified shorter than what is required for a mipmap image chunk then the result is the mipmap pixel data is sourced from out of buffer bounds memory in an unsafe way (memory garbage, possibly even a fatal error). Mipmaps are an all or nothing affair, you cannot only have some mipmap levels and it is pointless providing extra.

Mipmaps are only needed when the texture is set to use mipmaps. In the Windows version of WC3 it appears that all UI elements such as minimap and command card buttons undergo bilinear filtering but do not use mipmaps. Hence why you can get away with 1 mipmap level for them.

However when mipmaps are needed, such as by units and other ingame 3D models, then it is important to use mipmaps. Warcraft III will not automatically generate mipmaps for such images, instead it will load the mipmaps as blank textures (default of transparent black (0,0,0,0) pixels) which is very impractical. Models using a no-mipmap textures will only appear correctly where the full sized mipmap (level 0) is used, with areas using higher mipmap levels appearing either transparent (if applicable) or black.

When the JPEG decoder encounters an error the game should load the mipmap level as a blank texture. If the JPEG image is the wrong dimensions it should automatically be subsampled through truncation/expansion towards the lower right. My guess is the MAC crash is a result of a non-robust JPEG image decoder which crashes the game on error (trying to decode a JPEG image with just the header and no component data) rather than failing and letting the game use a blank texture.

Interestingly enough, there have been reports on macrumors of mini-map bugging (it blackening out).
That would be the result of the minimap texture being marked to use mipmaps (something that really does not make sense). In Windows none of the buttons and minimap UI elements use mipmaps so they can in theory be created without them. This would save ~30% file space or allow 30% more icons to be packed into a map.


Т.к. из-за нашего патча мы и так бросаем поддержку MAC, да и Никсов заодно, можно будет слегка пережать содержимое и найти место для чего-то нового. Но гарантий здесь нет — пережатие требует времени, а его никогда нет.

2 комментария

avatar
страшный текст а смысл прост — пробежаться по всем blp и пересохранить с другими параметрами. задача не сложная, но монотонная. можно конечно сделать ноубрэйн массово, но по качеству получится хуже.
Только зарегистрированные и авторизованные пользователи могут оставлять комментарии.