News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu
avatar_alex76gr

Everything looks better in scanlines!

Started by alex76gr, 12:48, 31 May 14

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

arnoldemu

#75
Quote from: TotO on 12:10, 31 January 16
You can't lost luminosity.
You should do like on a real CTM and increase it on your monitor.  ;D
@mr_lou,@TotO: What is the size of the effect used here? You may need to adjust it because the CPC's mode 1 pixels are not perfect square, so there will be some "bleeding" of colours. You may need to scale it horizontally and perhaps translate it a little in x and y.

You may also need to adjust the black level slightly so black is not 0,0,0 to match a real monitor.

The effect you have shown though is much closer to a real ctm :)

The next problem is gamma.

The monitor will "apply" gamma to the colours from the cpc.
I don't know if the screenshot has gamma applied or not or is it raw r,g,b from cpc?

To display on a modern tv you may need to do gamma adjustment.
I believe ctm is 2.2, but modern tv may be different so you may need to gamma adjust.
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

TotO

#76
Sure, there is many things to take acount to have something close to the real result.
By the way, the CPC pixel ratio is close to 1:1 if you considerate the CTM is 4:3 and the CRTC overscan size 384x288 in MODE 1.
An don't forget that you don't know what is the PC screen ratio too...  :-\
"You make one mistake in your life and the internet will never let you live it down" (Keith Goodyer)

mr_lou

Quote from: arnoldemu on 15:23, 31 January 16What is the size of the effect used here? You may need to adjust it because the CPC's mode 1 pixels are not perfect square, so there will be some "bleeding" of colours. You may need to scale it horizontally and perhaps translate it a little in x and y.

I don't need it to be that perfect.

For 4k each CRT pixel gets 8x8 LED pixels. That makes it possible to give a pretty close emulation, like one CRT pixel using about 1 + 2 * ½ RGB elements.

Quote from: arnoldemu on 15:23, 31 January 16You may also need to adjust the black level slightly so black is not 0,0,0 to match a real monitor.

Yup, I did that.

Quote from: arnoldemu on 15:23, 31 January 16The next problem is gamma.

The monitor will "apply" gamma to the colours from the cpc.
I don't know if the screenshot has gamma applied or not or is it raw r,g,b from cpc?

To display on a modern tv you may need to do gamma adjustment.
I believe ctm is 2.2, but modern tv may be different so you may need to gamma adjust.

Yes I added gamma to, about 30 I think.
Not sure what you mean by 2,2.

mr_lou

Ok, I found a formular for gamma.
The filter is now applied in code, including gamma and RGB-elements emulation.

I think it looks pretty good. Definitely gives a better feel than the "blocky" version.

BUT: I am only applying this filter when viewing images in fullscreen. I'm not applying it when displaying the images in a smaller version in between the text.
And it's quite clear that the smaller versions of the images are therefor very bright and "clear" compared to the fullscreen filtered versions (of course).

But aren't we in agreement that displaying a CPC image on a PC with 0x00 and 0x7f and 0xff RGB values will give a too bright picture?
Does emulators darken the picture or are emulators generally displaying too bright images?
@arnoldemu, the screenshots I'm using has been taken using an older version of Arnold. Do you remember if you've darkened the picture?


This coded filter can only be used for the pictures. When it comes to video I'll have to find settings in Kdenlive that gives the somewhat same result.

PulkoMandy

I don't know what other emulators do, but the values I use are from grimware.org measurements of the voltage at the Gate Array output. That is, emulation of the CPC, but not of the CTM gamma.

mr_lou

Quote from: PulkoMandy on 07:17, 02 February 16
I don't know what other emulators do, but the values I use are from grimware.org measurements of the voltage at the Gate Array output. That is, emulation of the CPC, but not of the CTM gamma.

I can't find anything about this. Do you have the direct link?

TotO

"You make one mistake in your life and the internet will never let you live it down" (Keith Goodyer)

mr_lou

I have tried a ton of different ways of creating an acceptable "CTM-filter" for 720p resolution, and kinda getting nowhere.

Everytime I find something I think looks great, I spot something about it that isn't great.

Anyway, I won't bore you with the failed attempts.

Attached image shows an example of what I think I finally ended up with.

I don't see how I can produce something better when being restricted to 720p.

So tell me your opinion please.


||C|-|E||

#83
My opinion is that it looks very cool and I wish I could have the same in real time for the emulators  :)

Could you try it with one of the screens from our adventure?  :D

[attachimg=1]

[attachimg=2]

[attachimg=3]

MacDeath

#84
From what I observed...

Amstrad mostly had no horizontal line effect if I recall well.

the moiré was mostly caused because the screen was not really flat at all, really looks like some huge light bulb and not always clean.

Mostly the "scan lines" effect could somewhat be vertical as on most real CPC cmonitors, the pixels supposed to be 1:1 (mode1) are actually slightly elongated vertically, but also because of the very nature of the luminophore.

pure red is actually made of one red vertical line and two black vertical lines in each luminophores in the pixel.


This vertical pixel ratio can be seen with some ditherings.

A pixel is actually a potato composed by some luminophores...
I think that to fully reproduce a CRT amstrad monitor, you would actually need huge modern resolution (really doable on a 4k or 5k retina I guess and actually emulate the whole luminophore matrix, taking account of the smaller black lines between each groups of RGB.

Also as monitors were huge light bulbs... have to take into account some luminosity thing.

Modern monitors, if with not huge HD (retina 5k screens) : you can still see some dark line between the pixels...
but it will mess up the emulation anyway because each colours in the luminophore would be divided vertically (imagine a 3x3 matrix) while they weren't on a CRT.

when you make graphics for such specs as a CPC or even a PLUS, it is good to stay with the modern rendering so you can understand the picture... and best way is to check on both modern PC and older real system.


also one individual monitor would display quite differently than another, depending of its age, serie of production, and model.

Clearly the PLUS mnitors are a different race than the CTM from older CPC models and any individual monitor wouldn't age the same way as another.



anyway, a "scanline effect doesn't have to be really hyper accurate... RGB CRT monitors were rarely actually accurate as well.

robcfg

It looks quite good, so I wouldn't spend more time on it if you're happy.


QuoteI wish I could have the same in real time for the emulators


Doesn't MAME do it?

||C|-|E||

Yes, but I think that it does not look so nice  :) . Maybe is only my impression, I did not look in detail  :D

mr_lou

Quote from: ||C|-|E|| on 14:56, 04 February 16Could you try it with one of the screens from our adventure?  :D

Here you go.

||C|-|E||


MacDeath


mr_lou

Quote from: MacDeath on 18:36, 04 February 16
white vertical lines ?

Vertical yes. The CTM monitor has vertical "scanlines" more than horizontal scanlines.

Not white though, of course. They were of course black, because they are essentially just the space between the RGB-elements.

For 720p I can't create a proper simulation of this, so I have to settle for this one.
The vertical "scanlines" will always be the darker color of the two.

It's not an accurate representation of the CTM monitor look, but it's the best I'm able to produce, and I feel it does give a better feeling than looking at those blocky pixels.

TotO

Quote from: MacDeath on 15:21, 04 February 16From what I observed...
I have used the same way for my previous mockup... (just zoom them)
About vertical lines ; Just look your picture to understand.  ;)
"You make one mistake in your life and the internet will never let you live it down" (Keith Goodyer)

MacDeath

#92
no issue with "vertical"... but WHITE ?

of course the balck has pure black, but on the picture you posted, I thing the "scanlines" are white, which doesn't feel right.


To be fair a proper flat screen emulation would really need freeaking huge quality screens...  but it would be quite interesting to see that done well on a 4k or 5k Retina monitor.

Doesn anyone have a 4k euros iMac ?  :laugh:







there are great infos at Les Sucres en Morceaux, but it is in french, all the pictures are quite interesting though...

mr_lou

Quote from: MacDeath on 19:51, 04 February 16
no issue with "vertical"... but WHITE ?

of course the balck has pure black, but on the picture you posted, I thing the "scanlines" are white, which doesn't feel right.

As I said, I can't reproduce an accurate representation in 720p.
I have to settle with something that gives a feeling of a CTM monitor on a 720p resolution.

One of my previous attempts looks rather nice though. It used RGB-elements multiplied layer, but it wasn't 1:1 so the pixels looked wrong. The effect was great, but wrong pixel alignment ruined it. 4k resolution is necessary in order to do it like that properly, and I don't have that luxury available for this project.

The current result is actually created by using a RGB-element multiplied layer that is not 1:1 either, but where one CPC pixel width is equal to one RGB-element width. That's not how a real CTM monitor does it, but I have to do it like this in order to not get wrong pixel alignment.
This result is then blurred and bit and levels adjusted. Then burred a bit again and levels adjusted again.

If someone had shown me this result as the first option, I would have turned it down too. That's why I've spent days trying to come up with something better. But I can't. Not with 720p.

If you have a better suggestion I'm all ears.

MacDeath

after a few looks, it is true that it looks more practical in "medium resolution" modern screen... it somewhat emulates the fact on real screen the R-G-B are a lot brighter.

Perhaps to use a slighty less white white... :laugh:

mr_lou

I'm not "selecting" anything in this process.

It's all automatic.

Each CPC pixel is scaled to a 3x3 grid LED pixels. (This is not 1:1 RGB-elements, but 1 CPC pixel is rather 2-4 RGB-elements).
This 3x3 grid is then divided into the 3 RGB colours. So, if the pixel is a white, it will result in all 3 RGB colours "lit".
This, as you say, also means that if only a red is displayed, only the RED is lit in the RGB-element.

For a previous attempt I used a Glow filter after this step, which gave a really nice effect. I really thought this looked awesome. But the pixels aren't aligned. I've attached an example of that one to show you what I mean.
The effect gives a close to CTM impression I think. But sadly the 720p resolution isn't big enough to properly emulate the RGB-elements, so it's not working.

Anyway, since that didn't work, what I'm doing instead is to create a width:width RGB-element instead and then blur twice to compensate for 720p resolution. The result obviously doesn't look like a CTM monitor, but should give a much better impression of a CPC than no filter.

The "white scanlines" aren't created by me. They're created because there's white in the picture on that place. So the white is actually the colour - not the "scanline". The "scanline" is always the darker colour of the two you see.

Fessor

Looks great. Wonder if its possible to get some more intensity to some inks (inks 16, 18, 26) because they are to dark.

mr_lou

Quote from: Fessor on 21:29, 04 February 16
Looks great. Wonder if its possible to get some more intensity to some inks (inks 16, 18, 26) because they are to dark.

I have tried. I cannot produce a better result than this. The current colours are the result of a levels-filter, setting the high-level to 0.58 and running it twice between gaussian-blur filters with a radius of 2.
Setting a lower value will make the colours brighter - but then other colours will be too bright.

Some colours are slightly too dark, and other colours are slightly too bright. As far as I can see it's a compromise I have to accept.

There's one method I haven't looked too much into yet though: Scale to 4k (or even 8k), then apply the RGB-elements filter multiplied, add glow-filter, scale back to 720p.
I only tried this briefly before, since it gave a boring result. I might make more attempts.

The current 720p result makes the vertical "scanlines" clearly visible. That part is a must.

mr_lou

Here is the same picture scaled to 4k - RGB-elements filter applied - glow-filter applied - scaled back to 720p using Sinc (Lanczos3) filter.

Is that better than the plain 720p version?

||C|-|E||

It is definitely sharper and brighter. I would say that it looks better indeed, but the vertical lines are more apparent as well. If I have to choose, I would probably choose this last one  :)

Powered by SMFPacks Menu Editor Mod