nesdev.com
http://forums.nesdev.com/

A SNES palette questions/inquiry (possibly silly questions)
http://forums.nesdev.com/viewtopic.php?f=12&t=10756
Page 2 of 4

Author:  byuu [ Fri Dec 06, 2013 10:32 am ]
Post subject:  Re: A SNES palette questions/inquiry (possibly silly questio

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.)

Author:  tepples [ Fri Dec 06, 2013 10:51 am ]
Post subject:  Re: A SNES palette questions/inquiry (possibly silly questio

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?

Author:  TmEE [ Fri Dec 06, 2013 2:14 pm ]
Post subject:  Re: A SNES palette questions/inquiry (possibly silly questio

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.

Author:  byuu [ Fri Dec 06, 2013 3:53 pm ]
Post subject:  Re: A SNES palette questions/inquiry (possibly silly questio

> 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.

Author:  tokumaru [ Fri Dec 06, 2013 3:57 pm ]
Post subject:  Re: A SNES palette questions/inquiry (possibly silly questio

Am I crazy for liking the washed out colors (left) better? =)

Author:  byuu [ Fri Dec 06, 2013 3:58 pm ]
Post subject:  Re: A SNES palette questions/inquiry (possibly silly questio

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.

Author:  tepples [ Fri Dec 06, 2013 5:03 pm ]
Post subject:  Re: A SNES palette questions/inquiry (possibly silly questio

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.

Author:  blargg [ Fri Dec 06, 2013 9:29 pm ]
Post subject:  Re: A SNES palette questions/inquiry (possibly silly questio

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.

Author:  byuu [ Sat Dec 07, 2013 6:12 am ]
Post subject:  Re: A SNES palette questions/inquiry (possibly silly questio

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.

Author:  lidnariq [ Sat Dec 07, 2013 11:02 am ]
Post subject:  Re: A SNES palette questions/inquiry (possibly silly questio

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...

Author:  byuu [ Sat Dec 07, 2013 9:03 pm ]
Post subject:  Re: A SNES palette questions/inquiry (possibly silly questio

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.

Author:  mikejmoffitt [ Sun Dec 08, 2013 5:59 pm ]
Post subject:  Re: A SNES palette questions/inquiry (possibly silly questio

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.

Author:  byuu [ Sun Dec 08, 2013 9:10 pm ]
Post subject:  Re: A SNES palette questions/inquiry (possibly silly questio

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.

Author:  mikejmoffitt [ Mon Dec 09, 2013 8:29 am ]
Post subject:  Re: A SNES palette questions/inquiry (possibly silly questio

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.

Author:  caramelpuffpuff [ Sat Mar 08, 2014 7:10 pm ]
Post subject:  Re: A SNES palette questions/inquiry (possibly silly questio

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.

Page 2 of 4 All times are UTC - 7 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/