Possible to change palette/colors in Nestopia Libretro core via shader route?

Well the thing is I have fallen in love with this palette: http://www.firebrandx.com/nespalette.html

His goal have been for the last couple of years and I quote: [I]“to provide a more faithful representation of the colors coming out of the original NTSC NES front-loading console’s composite video jack”

[/I]I have been using this palette in puNES and it looks great but I want to be able to use it through Nestopia’s Libretro core as well as I can’t stand the inaccuracies of the current palettes.

We have been requesting on Github to be able to choose custom palettes and I respect developers for having a real life so it may take a while.

Some cores have the option to use shaders to change palette/colors, the gba-colors.cg shader comes to mind which I use for the mGBA Libretro core and Harlequin’s DMG shader is also customizable.

Is there a way to create a shader that works like the ones I mentioned above in order to change colors for Nestopia?

Blargg’s NTSC shaders?

Will that be able to change palette colors?

See the thing is, under core options for Nestopia the default palette is set to Customer, and if I let’s say use a shader called ntsc-320px.cgp that contains: shader0 = shaders/ntsc-pass1-composite-2phase.cg shader1 = shaders/ntsc-pass2-2phase-gamma.cg

I don’t see the same result as if I were to use the Firebrandx palette in puNES.

I’m aware of Blargg’s NTSC filters but I thought those were made for Bsnes.

EDIT:

This picture shows the differences clearly

There are so many NES palettes i’m not even sure which one is the “correct” one anymore if there is even one. One thing you could try is the color-mangler.cg shader in the misc directory, it gives you more options for messing with the tints so you might be able to at least get things closer to the way you like it.

color-mangler.cg, hmm I’ll definitely have to take a look at that one.

Agreed on the NES palettes part though I think Firebrandx’s is the one that’s closest to what I remember from the original hardware. If you look at the picture and the screen from Nestopia, the sky is way to blue and that’s not how I remember the sky being in Super Mario Bros. 3 at all. The one from puNES feels way more right to me.

I can vouch for FBX’s methodology in creating his palette. While there’s never going to be a perfect palette that matches everyone’s memory of their shitty childhood TV, his process takes subjectivity out of the equation such that the only room for variance is/was in the upscaling and capture hardware (and, of course, the analog nature of the composite output of his NES), both of which are known to be quite good/accurate.

Probably the path of least resistance here is going to be to submit a patch to Nestopia that includes FBX’s palette as one of the hardcoded options, since trying to use the color-mangler shader for it would likely drive you insane.

That would be great!

Yes there probably never gonna be a perfect palette but I have tried so many and his palette feels somehow what I used to remember from my shitty childhood TV which actually was an Bang & Olufsen 28" TV

As for the color-mangler.cg, I gave up the moment I opened it up. There’s no way I’m ever gonna figure it out to change stuff in it.

While I’m dreaming of Firebrandx’s palette to be included in Nestopia someday I have been experimenting with shaders to get a more authentic look and somehow the colors feels more natural to me:

Oh and BTW, would making a patch be hard to include Firebrandx’s palette to Nestopia?

I’ve been speaking with tehcloud (the maintainer for Nestopia-Undead) and it seems that Nestopia handles palettes oddly and runs everything through a weird NTSC decoder thing that complicates the issue significantly. The Windows standalone port has support for uploading custom palettes but I’m not really seeing how it hooks into everything and it’s a part of the code that tehcloud didn’t write and isn’t very familiar with.

Using an NTSC shader changes the colors a bit, so you might like the output of aliaspider’s GTU-Famicom shader paired with Nestopia’s ‘raw’ palette, or else just try maister’s NTSC shaders from the main directory.

Awww that’s a bummer really :frowning: But thanks for looking into it hunterk!

Well I have been experimenting with different shaders the last couple of days and I quite like the result which I posted above and when I play all my games with this specific shader combination and values it feels so damn right. So while I can’t have Firebrandx’s palette, I still got the picture quality the way I want it and the colors better.

I’m still gonna use puNES though, it’s always good to have 2 good Famicom/Famicom Disk System emulators

Couldn’t someone write a shader that takes the raw chroma/level/emphasis output (from the “raw” palette option in Nestopia that was added for GTU-Famicom), and outputs the actual colors based on a LUT texture for the palette?

FirebrandX’s palettes have been added as core options in both FCEUmm and Nestopia cores, as well as the Sony CXA2025AS US and PAL palettes from puNES.

The pull request for Nestopia is still pending but after it’s merged the changes will show up in the buildbot.

Good work :slight_smile:

I’ve been wanting to try FBX’s palettes.

The Nestopia pull request has been merged now. tehcloud said he would move the new palettes from the libretro code into the core code at a later time.

Nice, thank you! :slight_smile:

I like unsaturated. The YUV one looks really similar to canonical I was using. No difference in some SMB, batman screenshots I took.

This looks great, thanks! I’m not yet convinced that either of these are the “ideal” NES palette but they do look better than anything else currently offered in RetroArch.

I played through Castlevania III and Unsaturated-V5 looked really good there. Some of the colors in YUV-V3 looked overly bright, like the wrong colorspace was being used.

I think that we will actually need wide gamut displays and a totally new palette that would look very desaturated on an sRGB display to show accurate NES colors.

[QUOTE=Tatsuya79;39378]Nice, thank you! :slight_smile: I like unsaturated. The YUV one looks really similar to canonical I was using. No difference in some SMB, batman screenshots I took.[/QUOTE]It seems to depend on the game. It’s the darker colors where the differences are most noticeable.

FBX’s methodology at least takes out any subjectivity. He plugged a toaster NES into an xrgb-mini via composite and then ran a homebrew ROM that cycles through palette colors. He used an HDMI capture device on that output and then used photoshop to average the whole-screen color and then sampled that average. There’s never going to be a palette that looks “right” with respect to each person’s experience/memory/TV, so I think going with an objectively consistent process is the next best thing.

From this palette, you should be able to apply a consistent transform (e.g., increase contrast by X, reduce green saturation by Y) across the entire palette to get something that matches what you want/remember.

[QUOTE=hunterk;39411]FBX’s methodology at least takes out any subjectivity. He plugged a toaster NES into an xrgb-mini via composite and then ran a homebrew ROM that cycles through palette colors. He used an HDMI capture device on that output and then used photoshop to average the whole-screen color and then sampled that average. There’s never going to be a palette that looks “right” with respect to each person’s experience/memory/TV, so I think going with an objectively consistent process is the next best thing.[/quote]Well it still depends on how the xrgb-mini is decoding the signal and converting the colorspace. It also sounded like both palettes were manually tweaked a bit too.

I’m not saying it isn’t a good palette, but I’m not sure it’s as definitive/objective as some people are claiming.

If I reduce chroma to 0 on my TV, I don’t get a uniform luminance across either palette like you’re supposed to.

Using this online palette generator, this is as saturated as the palette can be without introducing clipping:

To display this at the correct saturation, you need to use a wide gamut display.

bah, yeah, you’re right, he started manually correcting things after v1, which makes it no more objective than any of the others floating around, IMO.

Yay, finally!