["Fixed"] Scaled textures aligning
Moderator: GZDoom Developers
Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
- LilWhiteMouse
- Posts: 2270
- Joined: Tue Jul 15, 2003 7:00 pm
- Location: Maine, US
- Contact:
Scaled textures aligning
There's been various discussions about aligning scaled textures, but I don't recall this behaviour as normal:
I have a 128x32 texture, scaled to 64x16 using an X-scale of 16, and a Y-scale of 16. My sectors floor height is 0, and it's ceiling 384. I have three consectutive linedefs, totaling 64 units long. The first two segments are 24 units long, and the third 16. I want to align my texture so it's 256 units from the ceiling, and it's x-offsets set appropriatly so it transitions from linedef to linedef smoothly. To align it horizontally, I doubled the normal offsets to compensate for the scaling, which is what I believe to be the correct behaviour(?).
Now the inconsistancy. To align it at the verticle height I want, I do *not* double the offset to -512. Instead, I have to use the unscaled offset of -256 to have it 128 units off the ground. Is this right?
I have a 128x32 texture, scaled to 64x16 using an X-scale of 16, and a Y-scale of 16. My sectors floor height is 0, and it's ceiling 384. I have three consectutive linedefs, totaling 64 units long. The first two segments are 24 units long, and the third 16. I want to align my texture so it's 256 units from the ceiling, and it's x-offsets set appropriatly so it transitions from linedef to linedef smoothly. To align it horizontally, I doubled the normal offsets to compensate for the scaling, which is what I believe to be the correct behaviour(?).
Now the inconsistancy. To align it at the verticle height I want, I do *not* double the offset to -512. Instead, I have to use the unscaled offset of -256 to have it 128 units off the ground. Is this right?
Sounds like you are putting this texture on a 2S line - right? If so, there does seem to be an inconsistency. I just tested by scaling one of the normal doom2 textures and putting it on a 2S line and a 1S line that was right beside the 2S line. I offset both by -16. The one on the 2S line lowered by 16 world units (at least thats how it looked) and the one on the 1S line lowered by 8 world units.
As for whether this needs to be changed, or even if it can be (I understand textures on 2S lines are handled quite differently) or if it is just something people need to be aware of, I dunno, but it is inconsistent.
Just as a BTW, do you know that it is now possible to set up textures to always be scaled using world units rather than image pixels? That way things get scaled according to effective texture size rather than graphic size. I personally prefer that, but it does mean you cannot align things by fractions of world units.
As for whether this needs to be changed, or even if it can be (I understand textures on 2S lines are handled quite differently) or if it is just something people need to be aware of, I dunno, but it is inconsistent.
Just as a BTW, do you know that it is now possible to set up textures to always be scaled using world units rather than image pixels? That way things get scaled according to effective texture size rather than graphic size. I personally prefer that, but it does mean you cannot align things by fractions of world units.
- LilWhiteMouse
- Posts: 2270
- Joined: Tue Jul 15, 2003 7:00 pm
- Location: Maine, US
- Contact:
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49241
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Why should this not be fixable? To me this looks like a minor oversight in the offset calculation. Fix the offset and the problem is gone.Enjay wrote: As for whether this needs to be changed, or even if it can be (I understand textures on 2S lines are handled quite differently) or if it is just something people need to be aware of, I dunno, but it is inconsistent.
- LilWhiteMouse
- Posts: 2270
- Joined: Tue Jul 15, 2003 7:00 pm
- Location: Maine, US
- Contact:
Re: Scaled textures aligning
Yes. Here is my comment from that part of the code:LilWhiteMouse wrote:Is this right?
Code: Select all
// rowoffset is added before the MulScale3 so that the masked texture will
// still be positioned in world units rather than texels. This is different
// from the solid texture positioning in R_NewWall().
Last edited by randi on Fri Jan 02, 2004 9:07 pm, edited 1 time in total.
- LilWhiteMouse
- Posts: 2270
- Joined: Tue Jul 15, 2003 7:00 pm
- Location: Maine, US
- Contact:
Re: Scaled textures aligning
Ok, thanks.randy wrote:Yes.
- Chris
- Posts: 2978
- Joined: Thu Jul 17, 2003 12:07 am
- Graphics Processor: ATI/AMD with Vulkan/Metal Support
Since no one's replied to this yet, I think this should absolutely be done. While I'm not the biggest fan of texel-unit offseting, you should most definitely keep the behavior uniform. Think about this: a window with an upper and lower texture using a vinewall, with a scale of two, and a middle texture of just a vine, also with a scale of two. If the middle texture behaves differently than everywhere else, it'll be impossible to line up properly unless you enable world unit offsetting. I can't think of any examples that exploit this bug (and even if there is, you could provide a compatibility option).I suppose this isn't so necessary now that you can set a texture to position itself in world units instead of texels for all walls. I would consider changing this if no one can provide examples of existing maps that make use of the positioning as it is now.
Just my 2c.
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49241
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Chris wrote:Since no one's replied to this yet, I think this should absolutely be done. While I'm not the biggest fan of texel-unit offseting, you should most definitely keep the behavior uniform. Think about this: a window with an upper and lower texture using a vinewall, with a scale of two, and a middle texture of just a vine, also with a scale of two. If the middle texture behaves differently than everywhere else, it'll be impossible to line up properly unless you enable world unit offsetting. I can't think of any examples that exploit this bug (and even if there is, you could provide a compatibility option).I suppose this isn't so necessary now that you can set a texture to position itself in world units instead of texels for all walls. I would consider changing this if no one can provide examples of existing maps that make use of the positioning as it is now.
Just my 2c.
I'm in full agreement. And even if there are levels out there that exploit this bug (something I highly doubt. I can't remember ever seeing a level that used scaled textures and I check out everything in the /idgames archives) the negative effects for coming maps are much more severe than the problems it might cause on existing ones. This bug makes texture alignment on affected walls highly tedious if not impossible.
- LilWhiteMouse
- Posts: 2270
- Joined: Tue Jul 15, 2003 7:00 pm
- Location: Maine, US
- Contact: