[Fixed] Sidescroll-Texture misalignment by one pixel

Bugs that have been investigated and resolved somehow.

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.
Post Reply
Setsunaaa
Posts: 12
Joined: Sun Nov 30, 2003 11:51 am

Sidescroll-Texture misalignment by one pixel

Post 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
Setsunaaa
Posts: 12
Joined: Sun Nov 30, 2003 11:51 am

Post by Setsunaaa »

Argh, I should really attach it, since I missed the ".zds not allowed"...
Attachments
save8.zip
(28.79 KiB) Downloaded 31 times
User avatar
Chris
Posts: 2941
Joined: Thu Jul 17, 2003 12:07 am
Graphics Processor: ATI/AMD with Vulkan/Metal Support

Post 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.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49066
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Post 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.
Setsunaaa
Posts: 12
Joined: Sun Nov 30, 2003 11:51 am

Post 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.
User avatar
Chris
Posts: 2941
Joined: Thu Jul 17, 2003 12:07 am
Graphics Processor: ATI/AMD with Vulkan/Metal Support

Post 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.
Cyb
Posts: 912
Joined: Tue Jul 15, 2003 5:12 pm

Post by Cyb »

could we get a little more anal please
User avatar
Ultraviolet
Posts: 1152
Joined: Tue Jul 15, 2003 9:08 pm
Location: PROJECT DETAILS CLASSIFIED.

Post 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.
User avatar
Shockwav3
Posts: 44
Joined: Tue Nov 11, 2003 5:04 pm
Location: Duesseldorf, Germany

Post by Shockwav3 »

o_0
Cyb
Posts: 912
Joined: Tue Jul 15, 2003 5:12 pm

Post by Cyb »

I said anal, not [censored word]
User avatar
Ultraviolet
Posts: 1152
Joined: Tue Jul 15, 2003 9:08 pm
Location: PROJECT DETAILS CLASSIFIED.

Post by Ultraviolet »

Guess I tried too hard.
User avatar
HotWax
Posts: 10002
Joined: Fri Jul 18, 2003 6:18 pm
Location: Idaho Falls, ID

Post by HotWax »

Cyb wrote:I said anal, not [censored word]
Does this mean you're not going to change my diaper anymore?
User avatar
Ty Halderman
... in rememberance ...
Posts: 282
Joined: Thu Jul 17, 2003 9:53 pm
Location: New Orleans LA
Contact:

Post by Ty Halderman »

Observation: Anal and [censored word] are not mutually exclusive :lol:
User avatar
Hirogen2
Posts: 2033
Joined: Sat Jul 19, 2003 6:15 am
Graphics Processor: Intel with Vulkan/Metal Support
Location: Central Germany
Contact:

Post by Hirogen2 »

Ty Halderman wrote:Observation: Anal and [censored word] are not mutually exclusive :lol:
pthread_mutex_lock(...)
User avatar
randi
Site Admin
Posts: 7746
Joined: Wed Jul 09, 2003 10:30 pm
Contact:

Post 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.
Post Reply

Return to “Closed Bugs [GZDoom]”