-
Notifications
You must be signed in to change notification settings - Fork 5
vtex_idx
Xsear edited this page Jun 22, 2022
·
2 revisions
Virtual texture index
Each imageinfo entry contains three hashes, each pointing to a different texture file.
public static uint GenerateHash(int textureAssetId)
{
string str = textureAssetId.ToString().PadLeft(8, '0');
str = str.Substring(0, str.Length - 3) + "000" + "\\" + str;
byte[] bytes = Encoding.ASCII.GetBytes(str);
uint hash = 0;
foreach (byte b in bytes)
{
hash = (hash << 7) | (hash >> (32 - 7));
hash += b;
}
return hash;
}
// assault
uint h1 = GenerateHash(113473);
uint h2 = GenerateHash(113475);
uint h3 = GenerateHash(113476);