by Graf Zahl » Sun Jun 07, 2020 4:58 pm
I think I know now how this thing works. I just needed to see this in a context I know better, so I hacked the feature into GZDoom and checked a level where I know that it has major alignment issues in strict vanilla compatible ports on an NPOT texture and also know how it lookes there. Turns out that this code is just doing mostly the same thing, i.e. it renders the texture normally until the first power of two beyond the texture's height is reached while offsetting the overflow part by one texel and then at that POT boundary wraps around to 0. It's essentially what Doom also did with non-POT textures, minus the tutti frutti effect that occured in the leftmost column.
This obviously means that there's no way to fix this on the engine side, the shader hack is really the only workable way to handlie this case.
I think I know now how this thing works. I just needed to see this in a context I know better, so I hacked the feature into GZDoom and checked a level where I know that it has major alignment issues in strict vanilla compatible ports on an NPOT texture and also know how it lookes there. Turns out that this code is just doing mostly the same thing, i.e. it renders the texture normally until the first power of two beyond the texture's height is reached while offsetting the overflow part by one texel and then at that POT boundary wraps around to 0. It's essentially what Doom also did with non-POT textures, minus the tutti frutti effect that occured in the leftmost column.
This obviously means that there's no way to fix this on the engine side, the shader hack is really the only workable way to handlie this case.