Fix the sky in one of the levels in virtua on. The problem was caused by the fact we didn't split the mesh by the fog % burn through, so all the polys had the same value. We could use a vertex attrib, but % burn through fog is so rarely used and when it is, normally every poly in the mesh has the same value.

This commit is contained in:
Ian Curtis 2017-09-26 00:30:08 +00:00
parent 1eac755bc3
commit 0afd9026dc

View file

@ -385,22 +385,23 @@ UINT64 PolyHeader::Hash()
{
UINT64 hash = 0;
hash |= (header[2] & 3); // bits 0-1 uv mirror bits
hash |= (UINT64)((header[3] >> 0) & 7) << 2; // bits 2-4 tex height
hash |= (UINT64)((header[3] >> 3) & 7) << 5; // bits 5-7 tex width
hash |= (UINT64)X() << 8; // bits 8-17 x offset
hash |= (UINT64)Y() << 18; // bits 18-27 y offset
hash |= (UINT64)TexFormat() << 28; // bits 28-30 tex format
hash |= (UINT64)TexEnabled() << 31; // bits 31 textures enabled
hash |= (UINT64)LightEnabled() << 32; // bits 32 light enabled
hash |= (UINT64)DoubleSided() << 33; // bits 33 double sided
hash |= (UINT64)AlphaTest() << 34; // bits 34 contour processing
hash |= (UINT64)PolyAlpha() << 35; // bits 35 poly alpha processing
hash |= (UINT64)TextureAlpha() << 36; // bits 36 texture alpha processing
hash |= (UINT64)MicroTexture() << 37; // bits 37 microtexture enable
hash |= (UINT64)HighPriority() << 38; // bits 38 high priority enable
hash |= (UINT64)SpecularEnabled() << 39; // bits 39 enable specular reflection
hash |= (UINT64)SmoothShading() << 40; // bits 40 smooth shading
hash |= (header[2] & 3); // bits 0-1 uv mirror bits
hash |= (UINT64)((header[3] >> 0) & 7) << 2; // bits 2-4 tex height
hash |= (UINT64)((header[3] >> 3) & 7) << 5; // bits 5-7 tex width
hash |= (UINT64)X() << 8; // bits 8-17 x offset
hash |= (UINT64)Y() << 18; // bits 18-27 y offset
hash |= (UINT64)TexFormat() << 28; // bits 28-30 tex format
hash |= (UINT64)TexEnabled() << 31; // bits 31 textures enabled
hash |= (UINT64)LightEnabled() << 32; // bits 32 light enabled
hash |= (UINT64)DoubleSided() << 33; // bits 33 double sided
hash |= (UINT64)AlphaTest() << 34; // bits 34 contour processing
hash |= (UINT64)PolyAlpha() << 35; // bits 35 poly alpha processing
hash |= (UINT64)TextureAlpha() << 36; // bits 36 texture alpha processing
hash |= (UINT64)MicroTexture() << 37; // bits 37 microtexture enable
hash |= (UINT64)HighPriority() << 38; // bits 38 high priority enable
hash |= (UINT64)SpecularEnabled() << 39; // bits 39 enable specular reflection
hash |= (UINT64)SmoothShading() << 40; // bits 40 smooth shading
hash |= (UINT64)((header[6] >> 11) & 0x1F) << 41; // bits 41-45 light modifier
//to do add the rest of the states