It is currently Tue Dec 12, 2017 1:42 am

All times are UTC - 7 hours





Post new topic Reply to topic  [ 9 posts ] 
Author Message
PostPosted: Fri Oct 02, 2015 7:39 am 
Offline

Joined: Fri Oct 02, 2015 7:14 am
Posts: 4
Hi, I'm trying to modify a shader that tries to emulate a NTSC composite signal for Retroarch, like Blargg filters do.
I'm not really knowledgeable about signal processing or coding, so please excuse me if I'm difficult to understand.

I applied a pow(rgb , 2.2) at the beginning and pow(rgb , 1/2.2) at the end of the processing.
But in between there is rgb2yiq and yiq2rgb conversion.
All the processing is made in yiq.

And in the end it makes this kind of issue: no linear gamma / linear gamma
(that's Undead Line intro on Megadrive)

Any idea what I should do there?

I'm joining the shader files.


Attachments:
File comment: cg shaders
crt-ntsc.zip [15.83 KiB]
Downloaded 56 times
Top
 Profile  
 
PostPosted: Mon Oct 05, 2015 4:57 am 
Offline

Joined: Fri Oct 02, 2015 7:14 am
Posts: 4
Reading about NTSC signal, I see how that's not working...

Is there any operation to apply on YIQ to make the black thinner / white larger like from here to here?
Is that even possible?


Top
 Profile  
 
PostPosted: Mon Oct 05, 2015 10:23 am 
Offline

Joined: Sun Apr 13, 2008 11:12 am
Posts: 6509
Location: Seattle
The operation is "bloom", and it's an effect from how the CRT works. Hopefully that'll help searching for implementation details...


Top
 Profile  
 
PostPosted: Mon Oct 05, 2015 10:56 am 
Offline

Joined: Fri Oct 02, 2015 7:14 am
Posts: 4
Thanks for your answer but no, that's not bloom.


Top
 Profile  
 
PostPosted: Mon Oct 05, 2015 11:23 am 
Offline

Joined: Sun Apr 13, 2008 11:12 am
Posts: 6509
Location: Seattle
Yes it is.
http://www.bbc.co.uk/gel/tv/device-cons ... iagnostics
http://www.guru3d.com/files_details/swe ... nload.html

It's caused by two reasons:
Primary: The higher the intensity being emitted by the electron gun in the neck of the CRT, the emitting surface gets physically larger, so the beam gets wider.
(Distant second: The beam is made of electrons, and because they all have the same negative charge they repel each other, so the higher the electron flux the more they physically spread, causing the beam to again get wider)


Top
 Profile  
 
PostPosted: Mon Oct 05, 2015 11:34 am 
Offline
User avatar

Joined: Sun May 27, 2012 8:43 pm
Posts: 1311
Very high end CRTs will maintain beam pitch across different intensities. This also can vary with age, and total gain. This is the bloom effect, but it is not to be confused with the "other bloom" where a brighter image will slightly change the image dimensions (strongly a product of age of volatile parts like capacitors).


Top
 Profile  
 
PostPosted: Mon Oct 05, 2015 1:16 pm 
Offline

Joined: Fri Oct 02, 2015 7:14 am
Posts: 4
Yes, sorry, it's some kind of bloom on a real hardware.
Here I just instantly think of a bloom shader that won't do what I'm aiming at.

If you look at those mario pictures I posted earlier, it happens horizontally only and doesn't change the brightness in an halo around the object.
It's like "lighter pixels push darker ones slightly on each side".


Top
 Profile  
 
PostPosted: Mon Oct 05, 2015 1:33 pm 
Offline

Joined: Sun Apr 13, 2008 11:12 am
Posts: 6509
Location: Seattle
Right, it's nonlinear blur. A bright value isn't (only) made brighter by emitting more electrons → photons, but also by increasing the surface area over which those are emitted.

I don't know of a fast way to do it, and based on the other shader, clearly that other person doesn't either. You could use a library of pen sizes corresponding to the luminosities. Red, green, and blue should be independent.


Top
 Profile  
 
PostPosted: Tue Oct 06, 2015 7:06 am 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19334
Location: NE Indiana, USA (NTSC)
There is a fast way to do it, and it involves a shader with different gamma for different distances to the center of the scanline.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: Yahoo [Bot] and 9 guests


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 post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group