[Fixed] Sidescroll-Texture misalignment by one pixel
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.
Sidescroll-Texture misalignment by one pixel
In E3M3 (as example) which uses some sidecrolling texture the corners where they meet is off by one textxel, this applies to every second corner in the area where it hit my eye, it is resolution-independent.
You have to hit pause to see it perfectly of course.
Compared to the original which has better texture alignment in that corners, although not 100% perfect too, but closer, like the original doom doesn't seem to clip/align at pixel level and zdoom at textel level.
See attached savegame from 60.cab
You have to hit pause to see it perfectly of course.
Compared to the original which has better texture alignment in that corners, although not 100% perfect too, but closer, like the original doom doesn't seem to clip/align at pixel level and zdoom at textel level.
See attached savegame from 60.cab
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49225
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
That's due to a length that is not a full integer. All the diagonal walls are treated in the editor as if they were 91 units long because the level format doesen't support fractional parts. In reality, however they are only 90,5096679918780831233080783494207 units long and obviously this can create slight rendering inaccuracies. IMHO there is nothing wrong with it and if somebody is to blame it's the level designer. Stuff like this probably wasn't noticable at all in 320x200.
If you look at it in the original Doom you _can_ see the half textel, this is no imagination, like I wrote in my first post.
In zdoom it is rounded. SQRT(64^2*2) is 90.5 something, I know. But zdoom rounds down instead of up. This _can_ be done in integer correctly. It just looks bad right now.
BTW: I bet Sandy Petersen knew about that problem when he created that map.
In zdoom it is rounded. SQRT(64^2*2) is 90.5 something, I know. But zdoom rounds down instead of up. This _can_ be done in integer correctly. It just looks bad right now.
BTW: I bet Sandy Petersen knew about that problem when he created that map.
- Chris
- Posts: 2969
- Joined: Thu Jul 17, 2003 12:07 am
- Graphics Processor: ATI/AMD with Vulkan/Metal Support
Right, so if the last column of a wall displays the half of the 90th texel and the next wall displays the start of the 91st texel, there will be a small innacuracy when rendering the two walls with an kind of magnification. And AFAIK, (Z)Doom doesn't have an "end texel" number to change this (basically, what I believe it does is something like "start at this texel column, and just increase as you go along the wall"). Granted there could probably be a very small scale value to make sure the last texel column is displayed in full, but the decimal precision might not be good enough to do this(EDIT: especially if it may cause it to accidently jump to the next texel which would be even worse as this could introduce wrapping on walls/textures that may not be designed for it). And even if it is precise enough, it might not be worth the hassle of implementing.SQRT(64^2*2) is 90.5 something
- Ultraviolet
- Posts: 1152
- Joined: Tue Jul 15, 2003 9:08 pm
- Location: PROJECT DETAILS CLASSIFIED.
I'll try.
Cyb, you make such fucking useless posts, why don't you go back to DOOMWORLD where that's welcome? And what's with your name anyway? You were too lazy to type out "Cyberdemon" or "Cyberwhatever" or something? You fucking retard. And what's with your title? It's BLUE and you don't even use capitalization or punctuation. Were you too lazy to hack the forums to change the title color or what? You dumbass. I hate you. Your title contains the word "tit." I know you were trying to cleverly disguise it inside the word "title" but you can't fucking pull one over on me you little shit. That's very degrading to women and I demand you take it back RIGHT THIS INSTANT YOUNG MAN.
Cyb, you make such fucking useless posts, why don't you go back to DOOMWORLD where that's welcome? And what's with your name anyway? You were too lazy to type out "Cyberdemon" or "Cyberwhatever" or something? You fucking retard. And what's with your title? It's BLUE and you don't even use capitalization or punctuation. Were you too lazy to hack the forums to change the title color or what? You dumbass. I hate you. Your title contains the word "tit." I know you were trying to cleverly disguise it inside the word "title" but you can't fucking pull one over on me you little shit. That's very degrading to women and I demand you take it back RIGHT THIS INSTANT YOUNG MAN.
- Ultraviolet
- Posts: 1152
- Joined: Tue Jul 15, 2003 9:08 pm
- Location: PROJECT DETAILS CLASSIFIED.
- Ty Halderman
- ... in rememberance ...
- Posts: 282
- Joined: Thu Jul 17, 2003 9:53 pm
- Location: New Orleans LA
- Contact:
Incorrect. What you describe is the way Doom did it. ZDoom (and Build) keep track of what texel to start drawing at and how many texels fit across the width of the wall (in Build, this is a wall's xrepeat*8). Because of this, the end texel visible on a wall in Doom can fluctuate depending on what angle you view it at, even if the wall is a perfectly integral length. With ZDoom (and Build), the end texel is always the same, and it always gets fully drawn, so it always looks the same no matter how you view it.Chris wrote:AFAIK, (Z)Doom doesn't have an "end texel" number to change this (basically, what I believe it does is something like "start at this texel column, and just increase as you go along the wall").
The fix for this "bug" is quite easy, too: Just round the length to nearest instead of down. It should also look better than it did in Doom, since you will always see the full 91st texel instead of different amounts of it depending on how you look at the wall. Note that this isn't going to change any existing savegames, since this information is stored in the savegame, so you need to start a new map to see a difference.