This is a bit of a difficult issue to explain, but the short story is that the calculation that handles texture coordinates in vanilla Quake 2 and qbsp3 relied on x87 floating point calculation, which uses 80-bit precision intermediate values. Tools and engines compiled with SSE (either x86 or x64), however, will only use 32 or 64-bit floating point values, resulting in a mismatch for what the engines compiled with x87 instructions expect. The line in question is this one - https://github.com/qbism/q2tools-220/blob/master/4rad/lightmap.c#L135 (and the same line below it for QBSP) - creating a version of DotProduct that does the calculation via long double casts should be enough to fix it; it will then agree with vanilla engines on the surface extents.
I'm also working with engines to fix the disagreement as well. The same fix was applied across the board in the Q1 community for the bug in question, so I'm hoping we can match up with them. You can see a much more detailed description of the problem here: https://github.com/skullernet/q2pro/issues/261#issuecomment-1229587645
This is a bit of a difficult issue to explain, but the short story is that the calculation that handles texture coordinates in vanilla Quake 2 and qbsp3 relied on x87 floating point calculation, which uses 80-bit precision intermediate values. Tools and engines compiled with SSE (either x86 or x64), however, will only use 32 or 64-bit floating point values, resulting in a mismatch for what the engines compiled with x87 instructions expect. The line in question is this one - https://github.com/qbism/q2tools-220/blob/master/4rad/lightmap.c#L135 (and the same line below it for QBSP) - creating a version of
DotProduct
that does the calculation vialong double
casts should be enough to fix it; it will then agree with vanilla engines on the surface extents.I'm also working with engines to fix the disagreement as well. The same fix was applied across the board in the Q1 community for the bug in question, so I'm hoping we can match up with them. You can see a much more detailed description of the problem here: https://github.com/skullernet/q2pro/issues/261#issuecomment-1229587645