Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
lazygecko

Doom with scanlines

Recommended Posts

I actually played Doom II on a 25" CRT TV a decent amount.. we had a video card with s-video out so I figured what the hell, it was better than the 15" CRT monitor that was too dark to see anything on.

So I can see the scanline as being a little nostalgic with Doom for me.

The effect looks good for Doom, being pixel art essentially.

Share this post


Link to post

I thought the main reason for scanlines was to halve the bandwidth needed for cable/broadcast signals. It doesn't make any sense for PC monitors to reproduce that; they're not meant to display that content.

I am a huge fan of that stuff for retro console emulation, but if you look around a little (or just go to your local Goodwill), you'll find there are a lot of variations between displays.

Share this post


Link to post
Hoodie said:

I'll never understand why people like those lines. I even hated them as a kid.

Agreed. I'm glad to be past the days of scanlines and picture degradation.

Share this post


Link to post
Dragonsbrethren said:

I have a huge-ass Sony Trinitron monitor -- it has very obvious scanlines at lower resolutions.


I don't know a huge amount, but it might be because you're viewing interlaced content with de-interlacing turned on on your monitor.

Share this post


Link to post
Ladna said:

I don't know a huge amount, but it might be because you're viewing interlaced content with de-interlacing turned on on your monitor.

It's because of the way an analog CRT works. You probably know how it has an electron beam that scans a horizontal line, then jumps back and down a bit and scans another line, etc. The width of the electron beam scanning the line is fixed (to the best of my knowledge), and is tuned in accordance with the recommended resolution of the monitor, e.g., if it's a big ole 1600x1200 monitor, the electron beam is approximately 1/1200 the height of the display. So when you try and display a 320x200 VGA signal, the electron beam is only tracing out 400 vertical lines (lines are automatically doubled in the 320x200 display mode) instead of 1200. Since you're only scanning 1/3 as many lines as the monitor was tuned for, you end up with dark spaces between lines.

Of course, people didn't have "huge-ass" monitors when they were making 320x200 VGA games-- anything above 14 inches was a luxury.

Share this post


Link to post

Again I know very little (but that won't stop me from guessing, haha), but I've heard that resolution doesn't matter on CRTs; the tech just upscales because the whole thing is analog.

Plus that scheme sounds arbitrary. Why would it skip other lines, why wouldn't it just letterbox? What does it do if the resolution doesn't fit within its natural pixel count? What is the pixel count of a CRT anyway?

Share this post


Link to post
Ladna said:

What is the pixel count of a CRT anyway?

It doesn't have one, actually. At least not directly.

The CRT doesn't have any notion of screen resolution or pixels. It knows how many lines it has to draw to make up one complete frame, but otherwise all it knows is that it's drawing electron beams in a bunch of horizontal lines over and over. It doesn't particularly care what the intensity of the electron beam is at any given instant, or if the beam is hitting any phosphors on the screen.

Of course, the user wants the electron beam to hit phosphors so it'll render colors. So what was important in old CRT monitors was "dot pitch". That was the distance between 2 phosphors of the same color:



So an old SVGA 14" monitor might have a dot pitch of, say, 0.31 mm. So what does that mean? Manufacturers purposely made it a pain in the ass to try and calculate anything like "real" pixel density on a monitor. But we can do a little math and calculate that if the diagonal size of a monitor was 14", and the phosphor dots are spaced out 0.31mm at a 30-degree angle like in the picture, the monitor has something in the neighborhood of 1060 dots of each color horizontally and 690 vertically. Of course you can't directly convert this so pixels because of the way the dot triads are laid out - it's not on a nice rectilinear grid, they're packed in in a funny offset way. So the maximum useful resolution is always going to be somewhat less than the actual number of phosphor triads on the screen. So displaying 800x600 gives you breathing room for the phosphors to be hit in a more or less appropriate manner.

Most of the time, with any CRT monitor, you're going to have more than one phosphor triad lit up for every pixel being drawn:

Share this post


Link to post

There's a couple visual hacks on Sega Saturn games for effects like transparency that only work on a screen with scanlines. Luckily I still have my nice Commodore CRT monitor for my old consoles.

Share this post


Link to post

Oh it's because of different standards. If your TV outputs 480i (like basically all US TVs did), and you feed it 240p, you get scanlines. OK gotcha. Also I'm pretty sure I brutally misrepresented interlacing, haha. Oh well.

Share this post


Link to post
Linguica said:

The CRT doesn't have any notion of screen resolution or pixels.


Neat. Almost works out like some sort of anti-aliasing, to my untrained eye.

Share this post


Link to post

Very cool. The new LCDs definitely look sharp, but it's not the same feel.

I've been working on a TRS-80 emulator with scanline emulation:


The scanline emulation was quite difficult, for 2 reasons:
1. I wanted it to be fast.
2. I wanted it to work at arbitrary resolutions, but still be clear, and still show scanlines. That's quite a tall order.

The TRS-80 screen is 384x192 pixels, so, to maintain aspect ratio and have clear scanlines, you should render at multiples of that original resolution. But, this image is 786x600.

If you look closely, you'll see that some of the horizontal lines in the lower half of the screen are a bit more blurry, but, it's not bad. It looks very much like a TRS-80 screen, it's fast, and it can be drawn at any resolution, and still look decent. It's using a process I call sub-pixel plotting. It uses multiple real pixels to draw a virtual source pixel at sub-pixel locations. A dead on pixel is drawn white, but a pixel half-way inbetween uses more than one output pixel, shaded somewhat gray. Combine that with the blending shading of adjacent pixels, and you get a nice effect.

Then, you pull your hair out trying to make it work in a single pass, left-to-right, top-to-bottom. What a nightmare.

Linguica's dot matrix gives me an idea how to tackle my next project: CRT emulation for my PacMan/Ms. PacMan port!

Share this post


Link to post

Yeah the problem with that sort of subpixel precision is that at non multiples you get visible beat frequencies, which are generally considered bad.

Share this post


Link to post
Linguica said:

Yeah the problem with that sort of subpixel precision is that at non multiples you get visible beat frequencies, which are generally considered bad.

Yeah, you can see the horizontal bands in the screenshot. I actually had some success in a previous test version that darkened the other lines in an inverse pattern, but it was Yet Another Ugly Hack, so I discarded it. Now I'm in the strange position of having accomplished my stated goal, to the best of my ability, and I have to like it, cause it was some much work. Yes, I see the bands, but I will not revert the code at this point, so I have to like it.

So, I like it. Actually, yeah, I do like it. It's neat to be able to resize it's window very slowly, and see the characters resize without the slightest jitter or detectable aliasing.

Share this post


Link to post

Scanlines always make old games look like they did in my childhood, so I love seeing them in ports and stuff. Sega adds them to most of the higher quality collections they do now.

Share this post


Link to post

I remember screenshots from computer game magazines always showed pretty visible scanlines on screen photos of Amiga and Atari ST games (especially if zoomed-in on details), as well as PC games taken on CGA and EGA monitors, but as things moved on, any decent VGA and SVGA monitor was effectively scanline-free unless you fucked up with the stretching controls, tried weird video modes or hunted pixels down with a magnifying lens.

The very least it didn't have this exaggerated effect that "scanline emulators" try to achieve. Dot pitch may have a major role, as I recall that anything above 0.30 was considered outdated even by 1993. My first PC with SVGA monitor in late 1993 already had a dot pitch of 0.28. The dot pitch of a Commodore 1084 monitor, OTOH, was 0.41. Of course you'll get nice big fat scanlines with that....

Share this post


Link to post

Yep, dot pitch and monitor size.
The first monitor I played DOOM was a 13" no-name. A 15" and a 17" followed, then a nice 19" Hitachi with 0.22 dot pitch; and I never saw scanlines in DOOM outside hooking up a TV to the video card's composite out.
The first time I noticed scanlines was with this 21" Mitsubishi (it uses a Sony Trinitron tube). They are glaring at all resolutions from 320x200 to 640x400, a little less so at 640x480 (but that's too high for DOOM to me). One of the reasons I don't use ZDoom and Eternity is the lack of the screen multiply feature, those scanlines are that annoying.

Slightly offtopic: five-six years ago I tried out an expensive video capture card to claimed to grab the pure (S)VGA output of any software/OS. Well, I could not get it to work with vanilla running under Win98SE at 320x200. It kept insisting the actual signal was @720x400. That's an odd-ball resolution, isn't it?

Share this post


Link to post
Sodaholic said:

Because they were limited to 3 colors per sprite cell (Megaman's white eyes got around this by overlaying another sprite). The flesh color was the closest they had to grey on Link's palette.

I wonder why they didn't think to do the same for Zelda 2? Hell, even a lot of those NES bootleg turds thought to do it so they looked more like the SNES/Gen games they were ripping off. Zelda 2 is pretty old though, perhaps before it was commonplace to do so?

ETTiNGRiNDER said:

Or redrawing the pose so that it looks less like the sword is coming from his crotch, I guess.

This woulda worked too. I dunno, I guess I was one of the few kids out there who initially thought Link had gone nudist..

GeckoYamori said:

Call it hipsterism or fetishism or whatever you like, there's plenty of people who like that sort of look.

It's similar to me using Doom95 (albeit the mouse+demo patched version) to do most of my single player doomin'. A lot of us have weird connections to old/outdated ways of playing, I'm surprised anyone at Doomworld is.. Well, surprised.

Share this post


Link to post
Never_Again said:

It kept insisting the actual signal was @720x400. That's an odd-ball resolution, isn't it?

The 400 lines part makes sense since that's what is really being sent to the monitor by the graphics card. The 720 part is weird though, especially since it's not even a multiple of 320.

edit: looking it up just now, the standard VGA text mode has a resolution of 720×400, so the card was probably assuming it was that mode for some reason.

Share this post


Link to post
Doomkid said:

It's similar to me using Doom95 (albeit the mouse+demo patched version) to do most of my single player doomin'. A lot of us have weird connections to old/outdated ways of playing, I'm surprised anyone at Doomworld is.. Well, surprised.


It's not just here. I've seen actual flame wars erupt in other retro communities over this subject because people throw a hissy fit over their definition on how games are "supposed" to look.

Share this post


Link to post
Never_Again said:

Well, I could not get it to work with vanilla running under Win98SE at 320x200. It kept insisting the actual signal was @720x400.

I got my CRT to work at 320x200 and it could only draw a small square in the middle of the screen. I couldn't even scale it to fill the screen. The scanlines were as big as the pixels, that was ugly. I had another monitor which scaled the input to 720x400, I guess it was done to remove the huge scanlines.

Share this post


Link to post

DooM shareware 1.1 in dosbox with scan3x, click to see full ;


*I have never in my entire life seen a screen with those scanlines, and i played leftover old 90's arcades on carnivals, used 486 pc's as a kid, and used crt screens.

but my feud is with the TV filters one can encounter in dosbox, image editors, or game systems. They do not even come close to any old tv i have because they just look normal. You do not watch those things with your nose pressed against them, even a HD tv would show you weird distortions and individual pixels when doing that.

Edit ;
* When it comes to crt screens i might just have never seen a model that does (or did) that.

Share this post


Link to post

I think that's because with programs like DOSBox the texture filters only work fully with 2D games, while with 3D games they only work on the 2D parts on screen such as the HUD it seems.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×