game
photo
retro
rant
Not logged in. · Lost password · Register

All content © NFGworld, unless otherwise noted, except for stuff we stole. Contact the editor-in-chief : baldbutsuave@thissitesdomain, especially if you are an attractive young female willing to do nude photography modelling. All rights reversed. 661

Split from thread 660...
submit to reddit
Author name (Guest) #46
No profile available.
Link to this post
In reply to post ID 1932
Also, here are some pictures of the four major masks used by CRT televisions:

DOT TRIO
http://www.pctechguide.com/42CRTMonitors_Dot_trio.htm

APERTURE GRILLE
http://www.pctechguide.com/42CRTMonitors_Aperture_grill.htm

SLOTTED MASK
http://www.pctechguide.com/42CRTMonitors_Slotted_mask.htm

ENHANCED DOT PITCH
http://www.pctechguide.com/42CRTMonitors_Enhanced_Dot_Pitc…

Keep in mind that the mask is a single size - you shouldn't scale it up with the game image. Targeting a specific TV, say 27" with a specific dot pitch, will let you calculate what the mask should look like. Create it at some obscene resolution (4000x3000?) so it will look smooth. Scale up the game image to that size, apply the mask, add some bloom, then scale the whole thing down to your output resolution. This should give you a fairly accurate image and will probably be very tolerant of scaling at non-integer increments. Using 2x,3x,etc isn't exactly the right aspect ratio for a lot of these games, you typically require some extra horizontal stretching.
Author name #47
Member since Sep 2008 · 5 posts · Location: Munich, Germany
Group memberships: Citizens, Members
Show profile · Link to this post
Using those masks doesn't help the fact that 15khz low-res signals add scanlines to all of those CRT types. If you simply overlay a pattern of those over your game's screenshot you're neglecting this.
Author name (Guest) #48
No profile available.
Link to this post
In reply to post ID 1932
Quote by Guest:
Try scaling the pictures by two. Double the pixels horozontally and add blank lines vertically. Then run it through these filters and see how that looks.

That's why I said this part first. :)
Author name (Administrator) #49
Avatar
Member since May 2011 · 2485 posts · Location: Brisbane
Group memberships: Administrators, Members
Show profile · Link to this post
Guest seems to have missed the points in this thread where we discussed this.  Maybe - it's not clear to what guest was replying here.

I refer specifically to this post and this one.
BLEARGH
Author name #50
Avatar
Member since Apr 2009 · 15 posts
Group memberships: Citizens, Members
Show profile · Link to this post
Subject: Progress! Thank you, Xythen
For some reason I'm not getting email notifications even though I've got that toggled. Maybe gmail thinks that it's spam...

Neat progress since I was last around, anyway!

Xythen, I'm digging your work. Playing around in Photoshop with your results, I've amped the glow of highlights and depth of shadows:

[Image: http://img199.imageshack.us/img199/627/phosphornxgng.th.png] [Image: http://img190.imageshack.us/img190/3124/psgxythphosglowgng.th.jpg]

[Image: http://img267.imageshack.us/img267/7127/somoriginal.th.png] [Image: http://img5.imageshack.us/img5/592/phosphor5xsom.th.png] [Image: http://img197.imageshack.us/img197/2964/psgxythphosglow.th.jpg]

Steps to get that:
Select > Color Range > Highlights
Copy selection, paste as new layer
Blending mode Overlay
Gaussian Blur 5.0

Select > Color Range > Shadows
Copy selection, paste as new layer
Blending mode Overlay

Algorithmically, I suppose you'd do a check to see if the RGB values are > or < a certain threshold, then apply an algorithm that gets an Overlay-like result, and finally hit the highlights with a blur of some sort (simplest blur method would probably be sufficient).

Still not perfect, but hooray anyway! Closer than we were at the start of this.

Edit: So close, and so far.
[Image: http://img34.imageshack.us/img34/5575/soclosesofarphosphor.jpg]
Pixels of different brightness ought to vary in size more than they do. Look around the mid-section of the Drac image: Full sized orange, mid sized brown, tiny sized green. Everything in SOM looks uniform in comparison.
This post was edited on 2009-09-06, 11:19 by Psiga.
Author name #51
Avatar
Member since Apr 2009 · 15 posts
Group memberships: Citizens, Members
Show profile · Link to this post
Subject: Almost home
Ooh, looking at the thread that Xythen linked earlier, he's actually really, really close: http://board.byuu.org/viewtopic.php?p=3457#p3457

[Image: http://img440.imageshack.us/img440/1803/phosphor2xbyuusphos2xbl.png]

Gosh dang, etc.

Another contributor, DOLLS, is doing some fun things with sub-pixels: http://board.byuu.org/viewtopic.php?p=4025#p4025

It's really neat to see coders hack away at this. I'm thankful to all of them.

I still know that the ideal implementation is going to be pure GPU, rendering sub-pixels as individual light-emitting elements in space, with high-dynamic-range color and the whole lot -- but for a raster blitter effect, all of this shit is hot.

If I can think of something important to add to the conversation on byuu's forum, I might join in. At this point though, there's not much for me to add.
Author name (Guest) #52
No profile available.
Link to this post
I suppose I might as well point out my attempt, which uses SDLMAME's OpenGL shader support.

[Image: http://img404.imageshack.us/img404/8275/sf2scanlines.th.png]

This can be very much tweaked. Blooming is implemented by having the beam width depend on its intensity (here the width grows as the fourth power of intensity, but this is somewhat arbitrary).
Author name (Administrator) #53
Avatar
Member since May 2011 · 2485 posts · Location: Brisbane
Group memberships: Administrators, Members
Show profile · Link to this post
Very nice attempt, CGWG, I like your thinning strategy.  I can't help but think the final result looks an awful lot like a grid however, where real CRTs didn't.  Remember our friend Richter?

[Image: http://nfgworld.com/grafx/games/Castlevania-scanlines.jpg]

Granted it's a shadow-mask CRT and you're duplicating an aperture grille, but the difference is very significant.  Your blue background (50% blue) still covers the entire vertical area that the full blue does (though darker).  In the image above the dark blue is incredibly narrow.

Also, on a real CRT, the image is stretched horizontally, so that many pixels cover more than one phosphor strip, perhaps this is part of the reason your pixels appear too regular.
BLEARGH
Author name (Guest) #54
No profile available.
Link to this post
You're right that the aperture pattern is probably too large. Here's a smaller one:

[Image: http://img5.imageshack.us/img5/761/sf2scanlines2.th.png]

And here are some more exaggerated scanlines:

[Image: http://img90.imageshack.us/img90/9458/sf2scanlines3.th.png]
Author name (Administrator) #55
Avatar
Member since May 2011 · 2485 posts · Location: Brisbane
Group memberships: Administrators, Members
Show profile · Link to this post
Scanlines3 really works for me, I think that's the very best I've seen so far, and I'd be thrilled to have that as a filter for my emulation.  =)

If I was tweaking it, I might play with the scanline spacing, tighten up the dark lines a bit and see if that makes it look like a smaller monitor, while reducing the gaps in the bright areas to virtually nothing...  I wonder how it'd look.
BLEARGH
Author name (Guest) #56
No profile available.
Link to this post
One more before I go to bed: here's my best attempt at a dot triad style shadow mask (all of these aperture patterns make use of RGB subpixel structure):

[Image: http://img179.imageshack.us/img179/7425/sf2scanlines4.th.png]

This is the pattern I used, and I'm not sure if there's a better one:
R  RG  GB  B
R B G R B G
 GB  BR  RG
Author name (Administrator) #57
Avatar
Member since May 2011 · 2485 posts · Location: Brisbane
Group memberships: Administrators, Members
Show profile · Link to this post
That is AWESOME.  =D

Any chance of getting that as a standalone app for filtering funs?
BLEARGH
Author name (Guest) #58
No profile available.
Link to this post
Here's what I put together in a few hours of work. As a standalone program, I improved the output quality, but now it is nowhere near capable of running real-time for an emulator.

Included are Windows and Linux x86_64 executables, as well as source code. The Windows binary was compiled with a cross-compiler and I haven't tested it on actual Windows; you might have to put the DLL files somewhere like C:\Windows\System\; I don't really know.

Run the program from the command line. If you do so without any options it tells you how to run it:
Usage: scanlines in.png out.png w h [paramfile]

in.png and out.png are self-explanatory; w and h are the output width and height. The last command line parameter is optional and specifies the name of a file that should contain the parameters of the algorithm. The file params contains default parameters and is explained in params.txt. This isn't very user-friendly, but I don't like coding user interfaces.

I've included several overlay patterns for aperture grilles as well as both slot and dot triad style shadow masks. The numbers in the filenames give some indication of the size of the pattern, and the "b" versions have bigger/brighter phosphors. I should give credit in pointing out that my "slot2x4" is a copy of Aaron Giles's "aperture2x4rb", seen here.

The patterns used in the screenshots I've posted are slot4x4b, slot2x4, and triad4x3.
Author name (Guest) #59
No profile available.
Link to this post
In reply to post ID 1845
Subject: jqYdkqJTaZmKoi
That's not just the best aneswr. It's the bestest answer!
Author name (Guest) #60
No profile available.
Link to this post
In reply to post ID 1845
Subject: jqYdkqJTaZmKoi
That's not just the best aneswr. It's the bestest answer!
Close Smaller – Larger + Reply to this post:
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Page:  previous  1  2  3  4 
We love UNB by Yves Goergen!