It is currently Tue Dec 12, 2017 8:42 pm

All times are UTC - 7 hours



Forum rules


Related:



Post new topic Reply to topic  [ 48 posts ]  Go to page Previous  1, 2, 3, 4  Next
Author Message
PostPosted: Fri Dec 06, 2013 10:32 am 
Offline

Joined: Mon Mar 27, 2006 5:23 pm
Posts: 1339
Proper color scaling is easy.

Code:
//call this for each color channel, obviously it won't work on a packed pixel
uint64_t normalize(uint64_t color, unsigned sourceDepth, unsigned targetDepth) {
  while(sourceDepth < targetDepth) {
    color = (color << sourceDepth) | color;
    sourceDepth += sourceDepth;
  }
  if(targetDepth < sourceDepth) color >>= (sourceDepth - targetDepth);
  return color;
}


Or in other words: keep repeating the bits until you've filled in all of your new bits. 5-bit ABCDE becomes 8-bit ABCDE-ABC. 00000 -> 00000 000. 11111 -> 11111 111.

ZSNES, from my testing, was using an RGB55 (or 565, I forget) surface with DirectDraw, which did not compensate for this. So a solid white screen in that emulator appears as #f8f8f8 (very slightly gray), not #ffffff. They no doubt chose to use a 16-bit surface anyway because it was marginally faster than copying a 32-bit surface. But comparing that slight inaccuracy against the flat-out completely wrong gamma is kind of silly. Images are blindingly bright if you don't correct the gamma difference between a TV and LCD monitor.

Fun side-tangent: SNES brightness register is a luminance adjust, not an RGB555 adjust. As such, it's technically possible to choose from more than 32768 color shades. But good luck computing exactly how many (certainly there's bound to be a lot of overlap between the different luma settings.)


Top
 Profile  
 
PostPosted: Fri Dec 06, 2013 10:51 am 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19335
Location: NE Indiana, USA (NTSC)
byuu wrote:
Images are blindingly bright if you don't correct the gamma difference between a TV and LCD monitor.

My Vizio VX32L TV is an LCD monitor, you insensitive clod! :-P

But seriously, how do actual, correctly calibrated TVs differ noticeably from the sRGB color space that computer monitor interfaces tend to assume?


Top
 Profile  
 
PostPosted: Fri Dec 06, 2013 2:14 pm 
Online
User avatar

Joined: Wed Feb 13, 2008 9:10 am
Posts: 594
Location: Estonia, Rapla city (50 and 60Hz compatible :P)
byuu wrote:
Fun side-tangent: SNES brightness register is a luminance adjust, not an RGB555 adjust. As such, it's technically possible to choose from more than 32768 color shades. But good luck computing exactly how many (certainly there's bound to be a lot of overlap between the different luma settings.)

...It works in analog domain ? The "Shadow/Highlight" function in MD is something that works in analog domain.

_________________
http://www.tmeeco.eu


Top
 Profile  
 
PostPosted: Fri Dec 06, 2013 3:53 pm 
Offline

Joined: Mon Mar 27, 2006 5:23 pm
Posts: 1339
> But seriously, how do actual, correctly calibrated TVs differ noticeably from the sRGB color space that computer monitor interfaces tend to assume?

Assuming you have a correctly calibrated monitor at 50%+ brightness (eg Spyder ICC profile on an IPS panel), the left is what the image looks like if you assume 1:1 RGB, and the right is what the image looks like on your standard CRT TV.

Image Image

Image Image

If your monitor settings are too far off, then the left may look more like your TV. But with a properly calibrated desktop monitor, the left looks like the image is covered in a hazy fog. The right is clear and shows the vibrancy of colors you see on a CRT TV. At least, the right matches my PVM-2030 RGB monitor at stock settings much closer.

> ...It works in analog domain ? The "Shadow/Highlight" function in MD is something that works in analog domain.

It is most likely analog, yes. That's the only way I have to explain the psychotic behavior of luma=0. Instead of being absolute black, it's like 99% black. Much like how you mute a cheap old TV and you can still barely hear it if you put your ears closer. It was cheaper to just reuse the existing analog scaler and hammer the value down as much as possible than to have an actual switch to completely disable the signal.


Last edited by byuu on Fri Dec 06, 2013 3:57 pm, edited 1 time in total.

Top
 Profile  
 
PostPosted: Fri Dec 06, 2013 3:57 pm 
Online
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 10164
Location: Rio de Janeiro - Brazil
Am I crazy for liking the washed out colors (left) better? =)


Top
 Profile  
 
PostPosted: Fri Dec 06, 2013 3:58 pm 
Offline

Joined: Mon Mar 27, 2006 5:23 pm
Posts: 1339
Probably not.

It's like MP3. People have listened to compressed-to-hell music for so long that they have grown to like the artifacts it causes.

People have been using overly washed out palettes in SNES emulators for the past 16 years, so it's what people are used to seeing.

The gamma-adjusted version can obscure some really dark details, too. But they tend to be on TVs as well. It's a bit like how I used to cheat in Ultima Online by maxing out my monitor brightness inside caves, rather than using night vision items. You were supposed to not be able to see things that well, but with insane brightness, you could see all of the details anyway.

It's an option in my emulator, so you can use either mode. Obviously, as that's how I took those screenshots.


Top
 Profile  
 
PostPosted: Fri Dec 06, 2013 5:03 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19335
Location: NE Indiana, USA (NTSC)
I wonder if it has something to do with the 7.5 IRE "setup" in NTSC outside Japan, where RGB(0, 0, 0) is actually 0 IRE and RGB(2, 2, 2) = 6.5 IRE is the closest to true black.


Top
 Profile  
 
PostPosted: Fri Dec 06, 2013 9:29 pm 
Offline
User avatar

Joined: Mon Sep 27, 2004 8:33 am
Posts: 3715
Location: Central Texas, USA
Could it be due to the fact that the image can be brighter on a TV (as far as I know)? The left ones look better as dim images simply because you can see things more easily than the dark right ones.


Top
 Profile  
 
PostPosted: Sat Dec 07, 2013 6:12 am 
Offline

Joined: Mon Mar 27, 2006 5:23 pm
Posts: 1339
tepples wrote:
I wonder if it has something to do with the 7.5 IRE "setup" in NTSC outside Japan, where RGB(0, 0, 0) is actually 0 IRE and RGB(2, 2, 2) = 6.5 IRE is the closest to true black.


No. You can make out the image being displayed if you max out your TV brightness. It's like the color range was reduced by 99%. You can't really simulate it in 24-bit color mode. I output the colors at 48-bit (16-bits per channel), which ends up displayed on my monitor at 30-bit (10-bits per channel.)

Quote:
Could it be due to the fact that the image can be brighter on a TV (as far as I know)?


You can do that, sure. But I am matching the colors of my stock PVM-2030, and before that, a regular CRT I had previously (don't remember the brand.)

I'm frankly stunned that anyone can look at the left images and like them more (the left outside area looks like broad daylight during a thunderstorm), but to each their own.

Back when my workplace had CRTs still, the right did look way too dark, but that was due to the brightness being turned down pretty low. For which I also have a brightness adjustment setting.


Top
 Profile  
 
PostPosted: Sat Dec 07, 2013 11:02 am 
Online

Joined: Sun Apr 13, 2008 11:12 am
Posts: 6512
Location: Seattle
byuu wrote:
Back when my workplace had CRTs still, the right did look way too dark, but that was due to the brightness being turned down pretty low. For which I also have a brightness adjustment setting.
Surely you're using calibrated monitors, lest all this effort be lost in that stage...


Top
 Profile  
 
PostPosted: Sat Dec 07, 2013 9:03 pm 
Offline

Joined: Mon Mar 27, 2006 5:23 pm
Posts: 1339
My primary development monitor is an HP ZR-30w, 30" IPS panel. This is a $1300 professional monitor, which was factory calibrated, and I've had it for about a year now. It's been long enough that I should recalibrate it, but I do not own a Spyder.

The gamma correction is also based on standard gamma differences between PC LCDs and CRT TVs.

But anyway, you have full control over this gamma adjustment, and additional brightness/contrast/gamma/hue/saturation adjustment settings. So you can tweak the colors to match your own TV by hand if you like. It's well worth the effort.


Top
 Profile  
 
PostPosted: Sun Dec 08, 2013 5:59 pm 
Offline
User avatar

Joined: Sun May 27, 2012 8:43 pm
Posts: 1311
Side-note - I have an 8-bit IPS RGB LCD panel. When I am adjusting levels of R,G,B, and the gamma curve, etc. are these adjustments done in the 8-bit digital domain, or are they done with finer granularity? If it is the former, it seems like everything other than output-RGB = input-RGB would decrease usable color depth. I know often the "contrast" control works this way and will result in details being missing / at levels out of proportion with surrounding details.


Top
 Profile  
 
PostPosted: Sun Dec 08, 2013 9:10 pm 
Offline

Joined: Mon Mar 27, 2006 5:23 pm
Posts: 1339
If you're not referring to my software, then I have absolutely no idea, that's up to them. But if you are:

Colors are all mixed internally at 16-bits-per-channel. The final output is then reduced to your monitor's color depth. For nearly everyone, that will be 8-bits-per-channel.

Pixel shaders allow the shader to decide between 8-bit (per channel), 10-bit, 12-bit, 16-bit, and single and double-precision floating point. They sometimes sacrifice precision for performance reasons.


Top
 Profile  
 
PostPosted: Mon Dec 09, 2013 8:29 am 
Offline
User avatar

Joined: Sun May 27, 2012 8:43 pm
Posts: 1311
byuu wrote:
If you're not referring to my software, then I have absolutely no idea, that's up to them. But if you are:

Colors are all mixed internally at 16-bits-per-channel. The final output is then reduced to your monitor's color depth. For nearly everyone, that will be 8-bits-per-channel.

Pixel shaders allow the shader to decide between 8-bit (per channel), 10-bit, 12-bit, 16-bit, and single and double-precision floating point. They sometimes sacrifice precision for performance reasons.

I was referring to (most) monitors. I've used some that do it inside 8 bits per channel and introduce banding, which is the source of concern.

Your way of doing it is (to me) the only correct way, doing it with much higher depth then reducing it to the output depth.


Top
 Profile  
 
PostPosted: Sat Mar 08, 2014 7:10 pm 
Offline
User avatar

Joined: Sat Feb 23, 2013 4:16 pm
Posts: 63
I've been wondering...

Is the SNES palette limited to 13 for EACH sprite? Or 8 colors each 8x8 squares? I am kind of lost on it:

-As 256 is the limited of colors can be shown on SNES,what's the limit of colors each sprite (normal size)? And around 8x8 one sprite (smallest sprite possible)? Some of them seems 12 or 13, while other is 13 different colors on

it, but I got confused, if it's possible to combine the sprite togather, that may use 26 colors, etc.

- So there's no "shaded/grayed" colors at all, all of them are deep hued? The colors that seems brighter than usual is actually television? I may not explain right, but I need to make sure I don't get confused at all.

_________________
I am thinking of requesting a tutor [free] to learn NES programming in 6502 Assembly, as I am still baffled on the Bunnyboy 6504 lessons. If anyone want to help, I'm happy.
Bear in mind I may act silly or have trouble understanding, so please bear with me.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 48 posts ]  Go to page Previous  1, 2, 3, 4  Next

All times are UTC - 7 hours


Who is online

Users browsing this forum: Google Adsense [Bot] and 6 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