Jump to content

Doom Rendering Pixels Taller than Wide


Doom Marine

Recommended Posts

I noticed that the Doom engine renders pixels taller than wide, that is, a 1x1 pixel will look slightly taller than it is wide... a 128x128 cube will look taller than wide.

 

1. What aspect of the engine rendering causes this?

2. What is the stretch factor? 1.1? 1.05? (I could use screenshots and Photoshop to determine this, but I thought it would be better to ask first)

Edited by Doom Marine

Share this post


Link to post

Doom was originally meant to be played on 4:3 physical aspect ratio CRT monitors, but used a logical game resolution of 320x200. If you compute, you'll notice that 320x200 is a 8:5 (or 16:10, if you prefer, or even 4:2.5) aspect ratio; while the proper 4:3 aspect ratio for 320-wide is 320x240. What that means is that the monitor (by virtue of being CRT) would simply stretch the image to fit, resulting in tall pixels that are 1.2 times as wide, because 2.5*1.2=3.

 

Modern LCD monitors don't work in the same way as CRT do, so they can't stretch their pixels vertically. (Or horizontally, for that matter.) You're stuck with square pixels. So it's up to the software to emulate the aspect ratio stretching.

 

https://doomwiki.org/wiki/Aspect_ratio

 

As Cherno mentioned, with some ports such as GZDoom you can change that setting if your mod needs it. When high-res stuff is supported, you can also play with the scaling of individual assets (for GZDoom, you'll do that in TEXTURES).

Share this post


Link to post

It's worth mentioning that a lot of the graphics for Doom were created with this vertical stretch in mind - monster sprites in particular: when viewed on a modern square pixel monitor they look squat compared to the actual resources they were based on (the physical monster maquettes, the title screen/boxart etc.) Id were aware that they'd be stretched vertically in the game, so digitised them to look correct in the game's actual display mode, not on a square pixel display.

Share this post


Link to post

It's unclear whether it was deliberate or just a consequence of working in 320x200 resolution in their image editing tools too.

Share this post


Link to post

There are some instances of perfect circles in textures; that is, when rendered stretched. Viewed on square pixel displays they appear squished. So they knew, I’d say. 

Share this post


Link to post
12 minutes ago, Gez said:

It's unclear whether it was deliberate or just a consequence of working in 320x200 resolution in their image editing tools too.

Pretty sure it was deliberate due to the choice of graphic mode settled upon for the game. The tools doing that too was more of a coincidence I think, but it was at least a happy accident and made it very WYSIWYG.

 

Granted, that really only mattered for sprite editing and cleanup since everything else was on NeXTs.

Share this post


Link to post

I'm not an expert on the exact processes Id used to digitise the art, but surely it's unlikely that the video resolution they captured the sprites with and the scanning resolution they used for the box/title art both just happened coincidentally to correct for the 4:5 pixel aspect they were intended to be displayed at?  There must have been an awareness of the vertical stretch at the digitisation stage.

Share this post


Link to post

By the way I'll mention that the image and texture viewers in SLADE 3 have an "Aspect Ratio Correction" checkbox that you can tick and untick at your leisure. I suggest putting it on for looking at sprites and wall textures; but off for flats.

Share this post


Link to post

I think both flats and wall patches/textures are not stretched, only sprites are.

edit: is wrong

Edited by Dwaze

Share this post


Link to post

Everything that gets displayed on screen is stretched. Every single pixel. Even flats, technically; but you can see them from different angles so they aren't always stretched in the same direction.

 

Walls are definitely stretched vertically.

Share this post


Link to post
29 minutes ago, Rimantas said:

Then 267x200 would be best choice. Less pixels to render and still 4:3.

But then it wouldn't look as nice, would it?

Share this post


Link to post
54 minutes ago, Gez said:

Everything that gets displayed on screen is stretched. Every single pixel. Even flats, technically; but you can see them from different angles so they aren't always stretched in the same direction.

 

Walls are definitely stretched vertically.

I just checked and you're correct, I don't know why I was convinced it was. Brain fart sorry!

Share this post


Link to post

320x200 is a standard DOS resolution used by many games and programs up to and including the DOS-based art program the artists were using. It was normal and unremarkable at the time that it didn't have square pixels, because who cares when it's on an analog CRT that doesn't strictly speaking have "pixels"?

Share this post


Link to post
4 hours ago, ukiro said:

There are some instances of perfect circles in textures; that is, when rendered stretched. Viewed on square pixel displays they appear squished. So they knew, I’d say. 

I remember seeing a photo of Adrian Carmack working on sprites for Doom where he used Deluxe Paint to work the art over with, which also is using 320x200. 

Share this post


Link to post

A while back, I made this comparison using the Cyberdemon sprite and original clay model as a reference:

rhcZdi2.jpg

 

This is a particularly apt comparison since the clay model appears to be using the exact same pose and nearly the same angle that the Cyberdemon's CYBRG2 pain frame was digitized from. Ergo, this is a near one-to-one match. The left sprite is scaled up to match the horizontal feet distance of the clay model. The right sprite is equally scaled but also has the 1.2 vertical aspect ratio correction applied.

Share this post


Link to post

Saved that picture. If I ever need to explain this 1.2 aspect ratio stuff, this will be the perfect illustration. I also want to own that clay model, it looks so freaking awesome. 

Share this post


Link to post
19 hours ago, Nootrac4571 said:

1565974375_mancubuspixelratiosmall.jpg.a1a0449441e257e46d6e37c6c3c26593.jpg

 

4 hours ago, Revenant100 said:

rhcZdi2.jpg

Those are nice. Would either of you object to them being put on the Doom Wiki for the aspect ratio article?

Share this post


Link to post
1 minute ago, Gez said:

Would either of you object to them being put on the Doom Wiki for the aspect ratio article?

 

Feel free! I'd be proud to contribute.

Share this post


Link to post
On 12/12/2018 at 12:52 PM, Rimantas said:

Does anyone know why Doom used 320x200 instead of x240 resolution?

 

320x200 (VGA mode 13h) was the most common 256-color video mode at the time. The explanation I heard is that it's due to the video memory size. 320x240 pixels is 76800 bytes, whereas 320x200 comes out to 64000 which fits within a 64k address space.

 

Share this post


Link to post
1 hour ago, Doom Marine said:

I tested pixelratio using MAPINFO, and it has no effect in PrBoom+.

Does PrBoom+ support pixel ratio changes?

No, and PrBoom+ doesn't even support MAPINFO. Changing the pixel ratio is exclusive to GZDoom.

Edited by Edward850

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
Reply to this topic...

×   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...