Home Artists Posts Import Register
Join the new SimpleX Chat Group!

Content

A problem that plagued Retroquad for years is this weird clipping bug where some polygons gets infinitely extended to the right side of the screen (see the first and second screenshots). This bug is incredibly frustrating because I've reviewed the BSP edge clipping code numerous times and never found any issues with it.

Well, today I finally realized that the bug was caused not by the edge clipping code, but by the edge caching code! Simply disabling the edge caching code fixed the bug. The second screenshot shows the buggy edge caches extending the waterfall's polygons all the way to the right, and the third screenshot shows the waterfall being correctly rendered with the edge caching disabled.

Now, some remarks. I don't know yet if there's a way to simply fix the edge caches instead of disabling them. At first it seems that the caches gets corrupted during the overdraw stages of the BSP renderer, but I've also seen the clipping bug happen in normal BSP surfaces that are rendered before any overdraw. I'll have to study this further. Also, I don't know how much difference the edge caching does to the performance; I'll do some comparisons, and if there isn't much difference, removing it altogether will still be the better solution.

Eliminating this bug also makes the engine more stable. I found out that some crashes when (re)loading maps could be avoided by turning the camera away to hide this bug completely before reloading the map. So, eliminating this bug also fixes such crashes.

Files

Comments

No comments found for this post.