MagicEngine
Forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 Japanese English 

Request: CRT/RGB-like look

 
Post new topic   Reply to topic    MagicEngine Forum Index -> General
View previous topic :: View next topic  
Author Message
Fudoh
Visitor
Visitor


Joined: 22 Mar 2005
Posts: 13

PostPosted: Sun May 18, 2008 3:08 pm    Post subject: Request: CRT/RGB-like look Reply with quote

Ok, I admit that there are probably quite a few emu users out there which don't use scanline emulation to emulate the look of the actual hardware on an actual CRT TV, but for those of us who do, I would like to request a more RGB-like look for Magic Engine. In my opinion this is the only thing which inhibits ME from being one of the best emus ever.

Adding the scanline configuration option in the latest ME build is a nice step, but the scaling of ME has always been too hard and the linear scaling option makes the picture to blurry.

I think we can all agree that Blargg's NTSC library is the holy grail of CRT-like picture emulation ( http://www.slack.net/~ant/libs/ntsc.html ). It's implementation in ZSNES for example is a dream-come-true in every aspect and it provides a perfect CRT/RGB look if configured properly. (Picture below).

Of course I have no idea of a library like Blargg's can be ported into an emu like ME, but I think a good compromise would be some kind of adjustable linear filtering. One of the competing PCE emus achieves the desired look without software filtering by just using the graphic card's scaling instead of software scaling (Video memory <-> system memory).


Blargg's NTSC Library in ZSNES:




Magic Engine Unfiltered (too sharp on the horizontal axis)




Competing PCE emu without filtering, but using the video memory instead of the system's memory




Magic Engine Linear filtered (blurry mess the horizontal axis)




As one can see from the screenshots ZSNES and the other PCE emu are much more CRT-like than the two available options in ME. ME's picture is either too sharp (unfiltered) or much too soft (linear filtering).

I guess we can all agree that ME is a fabulous emu (I wouldn't have paid for it if I didn't think so), but it's really laking the "visual emulation" of the real hardware on a real TV.

David & Cédric, any chance you are gonna look into this sometime in the future ?

Thanks a lot !
Fudoh


PS: Blargg is offering on adding more systems to the current list if approached. Since I have no idea about a proper implementionen there's little sense in just emailing him about going on about the PCE, but maybe the authors of ME might want to get in contact ?
Back to top
View user's profile Send private message
Kaminari
Elder
Elder


Joined: 19 Apr 2002
Posts: 1432
Location: Paris, France

PostPosted: Sun May 18, 2008 10:11 pm    Post subject: Re: Request: CRT/RGB-like look Reply with quote

Actually, this feature already exists, it's called TV mode and you can enable it... in ME 0.99. Unfortunately, the option was not implemented back in ME 1.0 because the old TV mode was hardcoded for a resolution of 640x480. A revamped TV mode with horizontal interpolation might appear in a later version. (Just so you know, the current bilinear filtering blurs everything horizontally and vertically.)

Fudoh wrote:
I think we can all agree that Blargg's NTSC library is the holy grail of CRT-like picture emulation


Heck no.

For the sake of nostalgia, I can understand why US people used to NTSC composite and Japanese people used to RF would like to experience their games the way they were raised with, but thankfully us Europeans didn't have to suffer this very poor video outputs. Don't get me wrong: Blargg's library is excellent at what it does, but NTSC is definitely not the Holy Grail of CRT picture as you suggest.

Anyway, I doubt that David would get Shay's agreement to include his library in a commercial emulator. Then again, maybe David has some ideas about it, like he did when he implemented his own hq2x-like HiRes mode.
_________________
Kaminarimon HES Music Archive | Tokugawa Corporation | YouTube Channel
Back to top
View user's profile Send private message Visit poster's website
Danjuro
Member
Member


Joined: 22 Apr 2002
Posts: 50
Location: Paris, France

PostPosted: Sun May 18, 2008 11:41 pm    Post subject: Re: Request: CRT/RGB-like look Reply with quote

Kaminari wrote:

For the sake of nostalgia, I can understand why US people used to NTSC composite and Japanese people used to RF would like to experience their games the way they were raised with, but thankfully us Europeans didn't have to suffer this very poor video outputs.


Hey, some of us this side of the Stream did appreciate those melting NTSC colors! And no, the Origin from the Depth's Race didn't give birth to the Fire's, before you ask!
Back to top
View user's profile Send private message
dmichel
Admin
Admin


Joined: 04 Apr 2002
Posts: 1166
Location: France

PostPosted: Mon May 19, 2008 8:38 am    Post subject: Reply with quote

Blargg's library is LGPL, it can be included in commercial programs. But I can't really use it in MagicEngine, all the rendering in ME is done by the 3D hardware, I don't do 2D blits anymore. I may have an alternative though, I'm working on a soft linear filtering that works only horizontaly and that is softer than bi-linear. Smile
_________________
David Michel
Back to top
View user's profile Send private message
Mednafen
Member
Member


Joined: 01 Jan 2006
Posts: 22

PostPosted: Mon May 19, 2008 2:23 pm    Post subject: Reply with quote

Here are a few very simple OpenGL pixel shaders available in Mednafen that probably do what you want(at least in part):

Code:

static const char *fragProgIpolateXNotY =
"uniform sampler2D Tex0;\n\
uniform vec2 TexSize;\n\
uniform vec2 TexSizeInverse;\n\
void main(void)\n\
{\n\
        vec2 texelIndex = vec2(gl_TexCoord[0]) * TexSize;\n\
        vec2 texelFract = fract(texelIndex);\n\
        texelIndex -= texelFract;\n\
        texelIndex *= TexSizeInverse;\n\
        vec3 texel[4];\n\
        texel[0] = texture2D(Tex0, texelIndex).rgb;\n\
        texel[1] = texture2D(Tex0, texelIndex + vec2(0, TexSizeInverse.t)).rgb;\n\
        texel[2] = texture2D(Tex0, texelIndex + TexSizeInverse).rgb;\n\
        texel[3] = texture2D(Tex0, texelIndex + vec2(TexSizeInverse.s, 0)).rgb;\n\
        float w0 = texelFract.s;\n\
        gl_FragColor = vec4( (texel[0] * (1.0 - w0) + texel[3] * w0), 1.0);\n\
}";


Code:

static const char *fragProgIpolateXNotYSharper =
"uniform sampler2D Tex0;\n\
uniform vec2 TexSize;\n\
uniform vec2 TexSizeInverse;\n\
void main(void)\n\
{\n\
        vec2 texelIndex = vec2(gl_TexCoord[0]) * TexSize;\n\
        vec2 texelFract = fract(texelIndex);\n\
        texelIndex -= texelFract;\n\
        texelIndex *= TexSizeInverse;\n\
        vec3 texel[4];\n\
        texel[0] = texture2D(Tex0, texelIndex).rgb;\n\
        texel[1] = texture2D(Tex0, texelIndex + vec2(0, TexSizeInverse.t)).rgb;\n\
        texel[2] = texture2D(Tex0, texelIndex + TexSizeInverse).rgb;\n\
        texel[3] = texture2D(Tex0, texelIndex + vec2(TexSizeInverse.s, 0)).rgb;\n\
        float w0 = (texelFract.s * float(2));\n\
        w0 = w0 * w0 / float(4);\n\
        gl_FragColor = vec4( (texel[0] * (1.0 - w0) + texel[3] * w0), 1.0);\n\
}";
Back to top
View user's profile Send private message
Fudoh
Visitor
Visitor


Joined: 22 Mar 2005
Posts: 13

PostPosted: Mon May 19, 2008 5:34 pm    Post subject: Reply with quote

Quote:
Heck no. .... Don't get me wrong: Blargg's library is excellent at what it does, but NTSC is definitely not the Holy Grail of CRT picture as you suggest.

You misunderstood me. Of course I don't use the raw NTSC emulation in Blargg's library (e.g. in ZSNES), but it's tweakable to copy the RGB look of a *perfect* european scart connection (just like in the first picture posted) and once done - it's the perfect emulation look.
Back to top
View user's profile Send private message
Ultramanu
Visitor
Visitor


Joined: 01 Mar 2009
Posts: 2
Location: France

PostPosted: Sun Mar 01, 2009 6:56 pm    Post subject: Reply with quote

dmichel wrote:
Blargg's library is LGPL, it can be included in commercial programs. But I can't really use it in MagicEngine, all the rendering in ME is done by the 3D hardware, I don't do 2D blits anymore. I may have an alternative though, I'm working on a soft linear filtering that works only horizontaly and that is softer than bi-linear. Smile

Were you thinking of something like that ?
(warning: 1600x1200 jpeg)
http://ups.imagup.com/02/1235352540_thunder_force4_boss1_15khz-filter.jpg
Another one where the pixels feel more 'round' (look at the '%' sign):
http://www.uplood.fr/visu.php?url=http://img1.uplood.fr/free/cxqf_thunder_force4_boss1_15khz-filter_2.jpg
A comparative (2580x1200 jpeg !):
http://ups.imagup.com/02/1235351716_comp_all.jpg

This artist's view of what the author (Shinnen) thinks scanlines emulation should look like, was indeed made with photoshop...
But according to him it's not much to do: just a light linear directional blur and very thin dark lines between each scanline.
Well I'm not sure about the details but I could ask him.
We both agreed this looked awesome but... unfortunately none of us can code in order to make our own emulators/plugins/shaders...
Embarassed
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    MagicEngine Forum Index -> General All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group