Questions about pseudo high-res and interlace in Modes 0-4

Discussion of hardware and software development for Super NES and Super Famicom. See the SNESdev wiki for more information.

Moderator: Moderators

Forum rules
  • For making cartridges of your Super NES games, see Reproduction.
iNCEPTIONAL

Re: Questions about pseudo high-res and interlace in Modes 0-4

Post by iNCEPTIONAL »

Here's another good example of pseudo high-res mode being used for semi-transparency on the HUD in Jurassic Park: https://youtu.be/MTKwNEN8FXw?t=74

Although, again, I can't figure out why they didn't just use colour math on the HUD layer to do proper semi-transparency, as in what's the benefit of using the pseudo high-res mode here for that effect instead of the way most other games did it on SNES?

Is there some elusive-obvious reason I'm missing here as to why that HUD couldn't have been done using the normal transparency via colour math?
Last edited by iNCEPTIONAL on Fri May 20, 2022 6:18 pm, edited 1 time in total.
iNCEPTIONAL

Re: Questions about pseudo high-res and interlace in Modes 0-4

Post by iNCEPTIONAL »

93143 wrote: Fri May 20, 2022 5:36 pm
iNCEPTIONAL wrote: Fri May 20, 2022 4:30 pmEdit: Wait, I think I've finally got it: By turning on direct colour mode, you can use up to 2048 colours from that 8-bit/11-bit colour rage on layer 1 only, and on layer 2 you use any of the first 128 colours from the normal palettes, and the other 128 palette colours for the sprites as per usual. Is that correct?
Yes.

...

Note that the 2048 colours in direct-colour mode are not freely selectable per pixel. You only have 256 direct colours to select from in a given tile, because the least significant bits are per-tile, not per-pixel (they are repurposed palette selector bits from the tilemap).

Also, since the Mode 7 map format doesn't have those bits, you can only use 256 colours for the whole layer in Mode 7, even in direct colour mode.

I've been trying to get my head around how one might exploit the extra per-tile bits in an image, and it doesn't seem like they're particularly useful. In most circumstances, it would be far easier to just use the 256 colours in RGB332.

Unfortunately this is really bad for subtle colour distinctions. Here's an example of an outdoor scene in RGB332 (it ends up using 60 of the available 256 colours, because the rest are not useful for this scene):





And here's the same picture in just 32 colours (a little over half what the above image uses) chosen from the full RGB555 palette of 32,768 colours:
I mean, yeah, the normal colour mode absolutely looks better there, but my mind and gut is like "There's got to be some way of using the direct colour mode that's actually a plus over using the colours via the palette method as per normal--I just know it". I haven't thought of it yet though. Lol And I likely won't have any good ideas until I truly grasp all the elements of how everything regarding the colours and stuff works fully.
Last edited by iNCEPTIONAL on Fri May 20, 2022 6:14 pm, edited 3 times in total.
User avatar
dougeff
Posts: 3079
Joined: Fri May 08, 2015 7:17 pm

Re: Questions about pseudo high-res and interlace in Modes 0-4

Post by dougeff »

I forgot that it was a bit more complicated than I thought. Also, you can't have bright white, only a slightly off white.
nesdoug.com -- blog/tutorial on programming for the NES
iNCEPTIONAL

Re: Questions about pseudo high-res and interlace in Modes 0-4

Post by iNCEPTIONAL »

dougeff wrote: Fri May 20, 2022 5:49 pm I forgot that it was a bit more complicated than I thought. Also, you can't have bright white, only a slightly off white.
And that's the same with not having pure black too, right?

But, I mean, really, how far off pure white and pure black are they though? Is it so much than any average person would actually notice?

I don't know how to get the colours we're talking about here, so I can't test it myself just to see.
User avatar
dougeff
Posts: 3079
Joined: Fri May 08, 2015 7:17 pm

Re: Questions about pseudo high-res and interlace in Modes 0-4

Post by dougeff »

Off-white... Something like this.
Screenshot_20220520-211355_Chrome.jpg
Screenshot_20220520-211355_Chrome.jpg (7.75 KiB) Viewed 371 times
Though, depending on your TVs brightness settings, it could be lighter.

But the blackest color would be basically black.


Edit, that should have been
(28/31)*255=230 (e6)
color = e6e6e6

I changed the picture to be e6e6e6
(I think that's right, going for a gray tone)
Last edited by dougeff on Fri May 20, 2022 6:15 pm, edited 4 times in total.
nesdoug.com -- blog/tutorial on programming for the NES
iNCEPTIONAL

Re: Questions about pseudo high-res and interlace in Modes 0-4

Post by iNCEPTIONAL »

dougeff wrote: Fri May 20, 2022 5:59 pm Something like this.

Screenshot_20220520-205653_Chrome.jpg

But the blackest color would be basically black.
The bit in the circle?

Yeah, that does look pretty grey and dull. lol

Might not look so bad in an actual image with lots of other colours and stuff, as you very rarely see pure white in nature anyway.

I guess that's something I'd really need to try in a few working examples to decide how much it matters.

Edit: Actually, when you look at the white on the lightest parts of the clouds in the image 93143 posted previously, it looks fine basically:
Japanese-Garden-Reflections_RGB332.png
Japanese-Garden-Reflections_RGB332.png (30.99 KiB) Viewed 374 times
User avatar
dougeff
Posts: 3079
Joined: Fri May 08, 2015 7:17 pm

Re: Questions about pseudo high-res and interlace in Modes 0-4

Post by dougeff »

I changed the picture in my last post.
nesdoug.com -- blog/tutorial on programming for the NES
iNCEPTIONAL

Re: Questions about pseudo high-res and interlace in Modes 0-4

Post by iNCEPTIONAL »

dougeff wrote: Fri May 20, 2022 6:16 pm I changed the picture in my last post.
Coolio
93143
Posts: 1717
Joined: Fri Jul 04, 2014 9:31 pm

Re: Questions about pseudo high-res and interlace in Modes 0-4

Post by 93143 »

dougeff wrote: Fri May 20, 2022 5:49 pmAlso, you can't have bright white, only a slightly off white.
Oh yeah, that.

I did it a quick-and-dirty way that produced something more like real RGB332 rather than the hacky one the SNES actually uses. Here's a more correct version:

Japanese-Garden-Reflections_RGB332snes.png
Japanese-Garden-Reflections_RGB332snes.png (37.12 KiB) Viewed 347 times

Still, technically you could get a bit closer to white by using the per-tile bits to boost the overall levels a bit:

Japanese-Garden-Reflections_RGB332snes_tilebits.png
Japanese-Garden-Reflections_RGB332snes_tilebits.png (36.09 KiB) Viewed 347 times

You can absolutely get real black. Remember, the zero colour is still transparent, so if CGRAM entry #0 has black in it, Bob's your uncle.

...unless you want black in the direct colour layer in front of the other layers so as to obstruct them, in which case, yeah, you can't do that. The images above were composed without black.
User avatar
Dwedit
Posts: 4924
Joined: Fri Nov 19, 2004 7:35 pm
Contact:

Re: Questions about pseudo high-res and interlace in Modes 0-4

Post by Dwedit »

I still don't see a good reason to use Direct Color mode. An image dithered to a 256 color palette will look a lot nicer.
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!
93143
Posts: 1717
Joined: Fri Jul 04, 2014 9:31 pm

Re: Questions about pseudo high-res and interlace in Modes 0-4

Post by 93143 »

Direct colour allows you to use sprite palettes and 4bpp BG palettes freely without squeezing the palette available to an 8bpp layer. For instance, you could have a screen split between multipalette Mode 1 (for backdrop and sky) and Mode 7 (for the ground) with a bunch of sprites on top, and the Mode 7 layer could still use 256 colours regardless of what the other stuff was doing.

But the actual colours available to it are coarsely defined, as we've seen, and most developers preferred to use CGRAM for everything because 15-bit RGB allows more subtlety even if you have to share the palette. This was the purpose of my 32-colour image on the previous page - to show that even a very restricted palette in RGB555 can look better than direct colour.

With 255 colours (to avoid using colour #0 so as to be strictly fair vs. the above) chosen from the full RGB555 palette, the image looks like this:

Japanese-Garden-Reflections_255c.png
Japanese-Garden-Reflections_255c.png (64.64 KiB) Viewed 322 times
Last edited by 93143 on Fri May 20, 2022 7:25 pm, edited 2 times in total.
iNCEPTIONAL

Re: Questions about pseudo high-res and interlace in Modes 0-4

Post by iNCEPTIONAL »

Dwedit wrote: Fri May 20, 2022 6:53 pm I still don't see a good reason to use Direct Color mode. An image dithered to a 256 color palette will look a lot nicer.
I personally suspect that still dpends on exactly how someone intends to use direct colour.

If you're just gonna try to reproduce a photo or painting on SNES as close as possible using some simple conversion tool or whatever then direct colour may not be the way to go.

If you're going to deliberately create actual in-game, multi-layered backgrounds that take direct colour properly and fully into account, I still have that gut feeling that there's something cool to be done with it the right hands.

As per usual, I'm not going to just dismiss it out the gate based on a couple of quick test examples that weren't ever intended to truly take full advantage of what the mode can do.

Until I understand it fully and have seen and done a few tests that properly try to push it to its limits, it will definitely remain a potential option for me to use in my game, as is the case with all the background modes and graphical features of the SNES that I'm currently looking into.

But that's just my approach.
iNCEPTIONAL

Re: Questions about pseudo high-res and interlace in Modes 0-4

Post by iNCEPTIONAL »

93143 wrote: Fri May 20, 2022 7:02 pm Direct colour allows you to use sprite palettes and 4bpp BG palettes freely without squeezing the palette available to an 8bpp layer. For instance, you could have a screen split between multipalette Mode 1 (for backdrop and sky) and Mode 7 (for the ground) with a bunch of sprites on top, and the Mode 7 layer could still use 256 colours regardless of what the other stuff was doing.

But the actual colours available to it are coarsely defined, as we've seen, and most developers preferred to use CGRAM for everything because 15-bit RGB allows more subtlety even if you have to share the palette. This was the purpose of my 32-colour image on the previous page - to show that even a very restricted palette in RGB555 can look better than direct colour.

With 255 colours (to avoid using colour #0 so as to be strictly fair vs. the above), it looks like this:
Interesting. Even that is already a huge step up from the previous examples. And, as per my last comment, that's an example that doesn't use it in an actual in-game context in a way that's specifically designed to work with all the particular advantages and disadvantages of direct colour in mind. So I'm certainly not ready to give up on it yet.
Last edited by iNCEPTIONAL on Fri May 20, 2022 7:24 pm, edited 1 time in total.
93143
Posts: 1717
Joined: Fri Jul 04, 2014 9:31 pm

Re: Questions about pseudo high-res and interlace in Modes 0-4

Post by 93143 »

That 255-colour image is not direct colour; it's palettized 15-bit RGB. It's what direct colour is competing against if what you want is a static photo. I've edited my post to make that more clear.

My previous post shows corrected images that more accurately represent the pseudo-RGB332 of SNES direct colour, and they don't look any better than the one on the previous page. Arguably they look worse.

Clearly this is not a good use case for direct colour; I chose it to illustrate the drawbacks. A game scene designed around it would presumably not clash with the capabilities of the mode quite as hard.
iNCEPTIONAL

Re: Questions about pseudo high-res and interlace in Modes 0-4

Post by iNCEPTIONAL »

93143 wrote: Fri May 20, 2022 7:24 pm That 255-colour image is not direct colour; it's palettized 15-bit RGB. It's what direct colour is competing against if what you want is a static photo.

My previous post shows corrected images that more accurately represent the pseudo-RGB332 of SNES direct colour, and they don't look any better than the one on the previous page. Arguably they look worse.

Clearly this is not a good use case for direct colour; I chose it to illustrate the drawbacks.
Ah, my bad. So that's the 256-colour normal palette version. And it looks very nice, as it should. No surprises there.

And now someone has to come up with a way to use the 128 background colours in layer 2, and the 128 sprite colours, plus the 2048 colours [correct?] for layer 1 in direct colour mode, and in a scenario that's not just a quickly converted static image that might be used on a title screen but actually in-game if possible, to see what that mode can do when used to its full extent....

Note: The "...." doesn't mean I expect someone to actually go do that but rather that I personally won't give up on the potential of using direct colour mode until then.
Last edited by iNCEPTIONAL on Fri May 20, 2022 7:47 pm, edited 3 times in total.
Post Reply