Fix rare patch collision issue that occurs on modern builds and not original quake3 binaries#822
Fix rare patch collision issue that occurs on modern builds and not original quake3 binaries#822smallmodel wants to merge 1 commit intoioquake:mainfrom
Conversation
…ke3 binaries This is due to a small precision difference between FP87/SSE and SSE2/above.
|
Does anyone know why ChopWindingInPlace takes an epsilon parameter in the first place, as opposed to using a global constant? It only ever seems to be called with 0.1f, so that doesn't seem very useful. Perhaps it would be better to introduce a new epsilon global with value 1.0 - 0.0005, and use that instead of passing 0.1f as a parameter and messing with it in the if statements themselves. Can you point to any concrete examples of where this bug occurs? |
|
That epsilon is there because the same clip routine is reused by external map tools or was probably built in the same toolchain as GtkRadiant and q3map2 which use different epsilon values like 0, 0.001 for different stages. |
llbraughler
left a comment
There was a problem hiding this comment.
Maybe use const float ... = 5e-4f instead of hard coding the values in if statements
|
The bug occurs in a game based on quake3 engine, the game uses a lot of patch surfaces. Unfortunately I won't be able to provide example quake 3 maps where this happens, and it seems quake 3 maps rarely use patches. There must be some custom maps where this issue occurs. If anyone has ever encountered collision issues with patch surfaces that don't occur in the original quake 3, this is likely the same bug. |
It's very similar to issue #186.
SSE and earlier (FP87) have different precision than SSE2/above. A very tiny difference in value can cause some windings (and planes) not to be created at all, resulting in collision issues compared to the original game, such as players falling through the ground.
This bug is infrequent, not sure if anyone else has experienced it (we have).
I didn't try all quake 3 maps.