Page 1 of 1

Sidescroll-Texture misalignment by one pixel

Posted: Sun Dec 14, 2003 4:56 am
by Setsunaaa
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

Posted: Sun Dec 14, 2003 4:58 am
by Setsunaaa
Argh, I should really attach it, since I missed the ".zds not allowed"...

Posted: Sun Dec 14, 2003 5:37 am
by Chris
For future reference, you can rename the .zds to .zds.png and attach it. It'll display the image, as a png, and still be useable as a savegame after removing the .png.

Posted: Sun Dec 14, 2003 5:54 am
by Graf Zahl
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.

Posted: Sun Dec 14, 2003 8:31 am
by Setsunaaa
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.

Posted: Sun Dec 14, 2003 9:08 am
by Chris
SQRT(64^2*2) is 90.5 something
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.

Posted: Sun Dec 14, 2003 12:39 pm
by Cyb
could we get a little more anal please

Posted: Sun Dec 14, 2003 6:29 pm
by Ultraviolet
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.

Posted: Sun Dec 14, 2003 7:10 pm
by Shockwav3
o_0

Posted: Sun Dec 14, 2003 8:33 pm
by Cyb
I said anal, not [censored word]

Posted: Mon Dec 15, 2003 12:26 am
by Ultraviolet
Guess I tried too hard.

Posted: Mon Dec 15, 2003 2:55 pm
by HotWax
Cyb wrote:I said anal, not [censored word]
Does this mean you're not going to change my diaper anymore?

Posted: Mon Dec 15, 2003 10:11 pm
by Ty Halderman
Observation: Anal and [censored word] are not mutually exclusive :lol:

Posted: Tue Dec 16, 2003 7:56 am
by Hirogen2
Ty Halderman wrote:Observation: Anal and [censored word] are not mutually exclusive :lol:
pthread_mutex_lock(...)

Posted: Fri Jan 02, 2004 9:46 pm
by randi
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").
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.

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.