Lag spikes with object normal maps enabled, increased light maximum, and Epic Plants' BC scum meshes
OpenMW version: latest dev build.
OS: Pop OS 20/04 LTS
GPU: AMD Radeon (TM) RX Graphics (POLARIS11, DRM 3.44.0, 5.16.11-76051611-generic, LLVM 12.0.0) (0x67ef)
Issue: Under certain conditions described in the title, OpenMW will lag to the point of unplayability. By lagging I mean recurring, momentary freezes of several seconds. Performance monitor seems to indicate that GPU usage spikes by an order of magnitude.
Steps to reproduce:
-Clean OpenMW install (i.e. fresh openmw.cfg and settings.cfg files).
-Install the mod Epic Plants.
-In the launcher, enable "Auto use object normal maps." (You may also need to enable shadows.)
-Start a new test game in Seyda Neen.
-In the Options menu, set max lights to 16.
-Walk north toward the bridge out of town. Lagging will occur before you get to the first scum pond.
The problem seems to be with the scum meshes from Epic Plants. If you overwrite them with the "scumpatibility" meshes from the mod Mistify, or simply disable them, the lagging does not occur. On Discord, Hemaris reports, "I noticed that the meshes you posted have NiAlphaProperty flag 4845 (blending enabled, testing enabled, test function greater) and an alpha test threshold of 0. That seemed weird to me, because if the threshold is 0 then every pixel passes the alpha test except the perfectly transparent ones, which are going to look the same after blending regardless of whether a test was performed." https://discord.com/channels/260439894298460160/260443579908882434/952324393697153104 He provided test meshes, of which "flag 4333 threshold 0" solved the issue, while "flag 4845 threshold 128" did not.
Another possible instance of this bug can possibly be observed by repeating the steps above with CemKey's Bonemold Armor Replacer mod installed, starting a test game in Ald Ruhn Manor District, and just looking around.