Here's a screenshot of a lower texture that has the Lower Unpegged flag, taken in Software:
Notice how the texture is attached to the lower of the two floors, like it should be. Now here's the same scene, taken in OpenGL:
Clearly this is wrong. It turns out that instead of pegging the texture to the lower floor, in OpenGL the texture is pegged to the ceiling above that floor. Here's a test map:
https://dl.dropboxusercontent.com/u/27962790/lowerunpegged.wad
Zone Builder's Visual Mode has the same issue, so you can easily observe it there: Move the floor that the texture should be attached to and you'll notice that the texture doesn't move along with it. Now move the ceiling above it and suddenly the texture does move, even though it shouldn't.
Here's a link to the relevant rendering code, for easy reference: http://git.magicalgirl.moe/STJr/SRB2/blob/master/src/hardware/hw_main.c#L1704
Notice how the texture is attached to the lower of the two floors, like it should be. Now here's the same scene, taken in OpenGL:
Clearly this is wrong. It turns out that instead of pegging the texture to the lower floor, in OpenGL the texture is pegged to the ceiling above that floor. Here's a test map:
https://dl.dropboxusercontent.com/u/27962790/lowerunpegged.wad
Zone Builder's Visual Mode has the same issue, so you can easily observe it there: Move the floor that the texture should be attached to and you'll notice that the texture doesn't move along with it. Now move the ceiling above it and suddenly the texture does move, even though it shouldn't.
Here's a link to the relevant rendering code, for easy reference: http://git.magicalgirl.moe/STJr/SRB2/blob/master/src/hardware/hw_main.c#L1704
Attachments
Last edited by a moderator: