Jump to content
  • 0

What's actually going on with negative y-offsets in textures being "ignored?" (image-heavy post)


plums

Question

The doomwiki article (https://doomwiki.org/wiki/Vertical_offsets_are_ignored_in_texture_patches) states:

Quote

 

Negative vertical offsets (placing the origin of the patch above the texture) are ignored, putting the top of the patch back in line with the top of the texture.

 

 

This isn't quite accurate though. Here is a wad with four textures made from TITLEPIC. (Did you know you can add any regular graphic to PNAMES and use it as a patch for a texture? The engine doesn't actually care about P_START/P_END at all.)

yoffset.wad (vanilla compatible, ZDoom based ports fix whatever bug is causing this so don't use them)

 

Texture 1 is just TITLEPIC with a negative vertical offset. As implied, the offset is ignored in game.

ILCM9t9.png

 

t1Rdl6W.png

 

 

Texture 2 looks the same but there is actually a non-offset copy of the TITLEPIC patch behind it. Some of the properly offset patch shows, but not all.

PAJlWvF.png

 

FDMV4iC.png

 

 

Texture 3 was made by repeatedly pressing the "duplicate patch" button in SLADE, and then having a non-offset patch behind it, to see what would happen. I don't know that any useful information comes out of this, but it looks interesting.

d4GbeAa.png

 

f8QBLIH.png

 

 

Texture 4 is several layers of negative-offset patches.

cIXw7rp.png

 

tZjVs3m.png

 

 

 

It looks like in all cases besides the first, a bit more than half of the texture shows as it should be, and then the rest cuts off, but it's not quite the same thing happening in each texture.

 

 

As a bonus, here's a texture from @Gothic 's PatchTex.wad that uses all negative offsets and looks fine in game. It's only 128px wide though, maybe that makes a difference? But changing the TITLEPIC patch and/or the texture size doesn't seem to change things for me.

Zm1hfXh.png

lADFxAM.png

 

 

The answer lies in the code somewhere but I couldn't figure out where. Anybody know?

Edited by plums

Share this post


Link to post

4 answers to this question

Recommended Posts

  • 0
12 hours ago, plums said:

The answer lies in the code somewhere but I couldn't figure out where

I couldn't figure out what the question was....

Share this post


Link to post
  • 0
45 minutes ago, andrewj said:

I couldn't figure out what the question was....

 

The general consensus (and what the Doomwiki claims) is that negative patch offsets are ignored. It's a bit more complicated, though. If there are other patches in the column then the offset will still be ignored. However, in those columns it'll only draw the amount of pixels as if the vertical offset was not ignored.

 

Here's an example that probably makes it a bit clearer. On the left side is what the texture definition looks like. On the right side how it looks in-game (unless run in an engine that fixes the vertical texture offset bug).

 

image.png?ex=66547bc3&is=66532a43&hm=84e

 

I think the question is where in the original source this behavior can be found.

Share this post


Link to post
  • 0
7 hours ago, andrewj said:

I couldn't figure out what the question was....

I guess I got a bit rambly. so:

 

Why do negative vertical offsets of patches in textures behave the way they do, as shown in the example images in the first post?

 

Knowing what's going on in the source, or at least which function(s) have the problems, would be a bonus but not essential. To me it's a bit of a maze of functions for drawing columns and compositing textures anyhow.

 

 

@boris very useful image, thanks! (mirrored here on imgur since discord images never last long: https://i.imgur.com/ebOUPBa.png)

But it doesn't explain why in my screenshots above, the negative y offsets aren't ignored for part of the texture.

Edited by plums

Share this post


Link to post
  • 0
23 hours ago, boris said:

The general consensus (and what the Doomwiki claims) is that negative patch offsets are ignored. It's a bit more complicated, though. If there are other patches in the column then the offset will still be ignored

Okay, I see, thanks.

 

So this is another "quirk" (aside from Medusa) of the horrible code which composes multiple patches in a single texture column - the passed in "originy" parameter of R_DrawColumnInCache() should ignore a negative value but doesn't.

Edited by andrewj

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...