Who knows how to use the direct color the most effectively?
Moderator: Moderators
Forum rules
- For making cartridges of your Super NES games, see Reproduction.
- greatkreator
- Posts: 49
- Joined: Wed Dec 09, 2015 2:18 pm
Who knows how to use the direct color the most effectively?
Who knows how to use the direct color the most effectively?
I need to display RGB array on the screen. What can SNES do at the most?
As far I know currently it's about 256 unique tiles having 256 colors + somehow to cover the rest with sprites.
If it's not possible to display a lot of colors it would be ok to display at least some limited number.
Do any other suggestions?
Thanks a lot!
I need to display RGB array on the screen. What can SNES do at the most?
As far I know currently it's about 256 unique tiles having 256 colors + somehow to cover the rest with sprites.
If it's not possible to display a lot of colors it would be ok to display at least some limited number.
Do any other suggestions?
Thanks a lot!
Re: Who knows how to use the direct color the most effective
The SNES has a native 2048-color mode (RGB443), but the LSB of each color is shared across each 8x8 pixel region. See fullsnes.
Note that for many images, a good palette choice and dithering will produce pretty acceptable 256-color images. Also, the SNES can address 1024 different tiles (when not in Mode 7), and has enough memory for ≈960 unique tiles.
Note that for many images, a good palette choice and dithering will produce pretty acceptable 256-color images. Also, the SNES can address 1024 different tiles (when not in Mode 7), and has enough memory for ≈960 unique tiles.
- greatkreator
- Posts: 49
- Joined: Wed Dec 09, 2015 2:18 pm
Re: Who knows how to use the direct color the most effective
Thanks a lot for the answer!
Sorry for stupid questions but I have just come for the other world and don't know anything at all about this world.
Can you please tell me: how much image data I may reload each frame thus what's the highest FPS may be achieved?
Sorry for stupid questions but I have just come for the other world and don't know anything at all about this world.
Can you please tell me: how much image data I may reload each frame thus what's the highest FPS may be achieved?
Re: Who knows how to use the direct color the most effective
On NTSC with 224 lines, the limit without forced blanking is in the neighborhood of 6K per frame. FPS depends on two things: how much area you need to cover (less means less data) and how many scanlines you are willing to force-blank (more means more time to copy in pixels).
And unless the image is smaller than about 30K, you will get tearing as you show a half-completed frame.
If you're mostly looking for FMV, there is a way to use a 2-pixel mosaic to make it larger at the cost of graininess by interleaving four tiles into each tile and having each one flipped a different way.
And unless the image is smaller than about 30K, you will get tearing as you show a half-completed frame.
If you're mostly looking for FMV, there is a way to use a 2-pixel mosaic to make it larger at the cost of graininess by interleaving four tiles into each tile and having each one flipped a different way.
- greatkreator
- Posts: 49
- Joined: Wed Dec 09, 2015 2:18 pm
Re: Who knows how to use the direct color the most effective
Clear! Very interesting! Thank you!
I definitely will need the forced blanking. Does it work OK on SNES without any negative surprises? Just turn the screen at some scan line and you get full speed (about 166 bytes per scan line) DMA. Right?
So there is no space for at least half-screen buffering?
Maybe the buffer using interlace can be used? However I suppose it will produce the same amount of flickering (as in my world Sega MD/G).
I am looking for something like FMV. But not FMV.
So actually the method you are talking about will just scale for example 128x96 to 256x192? Right?
I definitely will need the forced blanking. Does it work OK on SNES without any negative surprises? Just turn the screen at some scan line and you get full speed (about 166 bytes per scan line) DMA. Right?
So there is no space for at least half-screen buffering?
Maybe the buffer using interlace can be used? However I suppose it will produce the same amount of flickering (as in my world Sega MD/G).
I am looking for something like FMV. But not FMV.
So actually the method you are talking about will just scale for example 128x96 to 256x192? Right?
-
- Posts: 3181
- Joined: Wed May 19, 2010 6:12 pm
Re: Who knows how to use the direct color the most effective
If you only need one bg layer, you could use Mode-7 for that.If you're mostly looking for FMV, there is a way to use a 2-pixel mosaic to make it larger at the cost of graininess by interleaving four tiles into each tile and having each one flipped a different way.
- greatkreator
- Posts: 49
- Joined: Wed Dec 09, 2015 2:18 pm
Re: Who knows how to use the direct color the most effective
psycopathicteen you mean to use mode7 and scale x2 to fill all the screen to achive the same effect?
Re: Who knows how to use the direct color the most effective
This isn't quite true. Since the memory isn't actually overwritten during active display, you can use fractional buffering, where the new data goes into free space first, and then after the final frame before the switch you overwrite part of the old data. The idea is essentially to double buffer only what you can't update in one shot. The gain over normal double buffering isn't massive, but it can help.tepples wrote:And unless the image is smaller than about 30K, you will get tearing as you show a half-completed frame.
The game I'm working on uses forced blank to get enough bandwidth for half a playfield worth of Super FX graphics (half of 144x192 at 4bpp = 6912 KB) plus OAM and OBJ table updates and stuff like that. I only need a little over 20 KB of VRAM for the blitted layer instead of 27 KB, since being able to transfer half the data in one (extended) VBlank means I can use 3/2 buffering.
There's 64 KB of VRAM, same as the Mega Drive. It's just that 8bpp chews through it twice as fast. According to my calculations, on an NTSC SNES you can do resolutions like 256x144x8bpp at 30 fps, or 216x176x8bpp at 20 fps, if you really push it. At 4bpp you can double buffer a full screen, but your frame rate will be down around 12 fps because VBlank is so short (again, this is on an NTSC machine - PAL is obviously a different story). Unlike Mega Drive, there is no FIFO; if you try to send data to the PPU while it's busy, the data will be lost.So there is no space for at least half-screen buffering?
By "half-screen buffering", do you mean what I've called 3/2 buffering above?
I'm not sure what you mean by this.Maybe the buffer using interlace can be used?
In Mode 5 or 6, setting interlace mode makes the PPU render tiles as half-height, so you're just doubling the amount of data needed to fill an area of the screen (which is already doubled by the fact that Modes 5 and 6 are 512 pixels wide, but neither mode can do 8bpp so you can't get really crazy). In any other mode, yes, you can flip between two tilemaps every frame to get a 448i image (well, you can't move the tilemap in Mode 7, but you can move the camera), but I'm not clear on how that would improve the double-buffering situation.
Wolfenstein 3D did exactly that. 8bpp software raycasting at 15 fps with no special chips, because the Mode 7 format is bytemap rather than bitplane; one byte equals one pixel, so it's easy to render into. Also because they were able to draw at 112x80 and just expand it to 224x160 with no CPU overhead...greatkreator wrote:psycopathicteen you mean to use mode7 and scale x2 to fill all the screen to achive the same effect?
They didn't exactly push the bandwidth, though - with the screen size they used, they could easily have done 60 fps (with an arbitrarily powerful rendering processor)...
This: https://www.youtube.com/watch?v=sV1w_H8WxUII need to display RGB array on the screen. What can SNES do at the most?
- greatkreator
- Posts: 49
- Joined: Wed Dec 09, 2015 2:18 pm
Re: Who knows how to use the direct color the most effective
Thanks a lot for the first actual numbers!
Is this "256x144x8bpp at 30 fps" using the forced vblank?
Yes I meant 3/2 buffering.
Nevermind! The interlaced graphics is not an option. Too much flickering.
Isn't possible somehow using two layers to enhance scaled image made of 2x2 pixel blocks? Or such scaling available only using single layer?
Concerning 32768 colors:
(: it's not serious. For example I can show about 1500 colors on Sega MD/G but it's absolutely not practical.
Clarification: I meant an RGB array with random values.
It's not critical to have thousand colors but would be very cool to have at least 100-200 but closer to the fullscreen and as close as possible to at least 30 fps.
Is this "256x144x8bpp at 30 fps" using the forced vblank?
Yes I meant 3/2 buffering.
Nevermind! The interlaced graphics is not an option. Too much flickering.
Isn't possible somehow using two layers to enhance scaled image made of 2x2 pixel blocks? Or such scaling available only using single layer?
Concerning 32768 colors:
(: it's not serious. For example I can show about 1500 colors on Sega MD/G but it's absolutely not practical.
Clarification: I meant an RGB array with random values.
It's not critical to have thousand colors but would be very cool to have at least 100-200 but closer to the fullscreen and as close as possible to at least 30 fps.
Re: Who knows how to use the direct color the most effective
With fractional buffering, don't you also have to rewrite the nametable to reflect the offset into the fractional buffer? Or does that fit easily into the time allowed for the last update?93143 wrote:Since the memory isn't actually overwritten during active display, you can use fractional buffering, where the new data goes into free space first, and then after the final frame before the switch you overwrite part of the old data.
If you're willing to use mode 7, you can use the one layer that mode 7 gives you. If you need the additional 16-color layer that mode 3 provides, you can interleave pixels into a tile in the 256-color layer in such a way that the mosaic feature can decode them into four distinct tiles. Here's one way to do it:greatkreator wrote:Isn't possible somehow using two layers to enhance scaled image made of 2x2 pixel blocks? Or such scaling available only using single layer?
- One 4x4 pixel tile at (0, 0), (2, 0), (4, 0), (6, 0), (0, 2), (2, 2), ..., (6, 6), not flipped
- A second 4x4 pixel tile at (7, 0), (5, 0), (3, 0), (1, 0), (7, 2), (5, 2), ..., (1, 6), flipped horizontally
- A third 4x4 pixel tile at (0, 7), (2, 7), (4, 7), (6, 7), (0, 5), (2, 5), ..., (6, 1), flipped vertically
- A fourth 4x4 pixel tile at (7, 7), (5, 7), (3, 7), (1, 7), (7, 5), (5, 5), ..., (1, 1), flipped horizontally and vertically
Interleaving for mosaic decoding without flipping is possible if you divide the screen into four horizontal strips, such as four 40-pixel-tall strips of a 160-pixel-tall visible area, and use an HDMA channel to change the layer's horizontal and vertical scrolling.
- A 4x4 pixel tile in the first strip at (0, 0), (2, 0), (4, 0), (6, 0), (0, 2), (2, 2), ..., (6, 6)
- A 4x4 pixel tile in the second strip at (1, 0), (3, 0), (5, 0), (7, 0), (1, 2), (3, 2), ..., (7, 6)
- A 4x4 pixel tile in the third strip at (0, 1), (2, 1), (4, 1), (6, 1), (0, 3), (2, 3), ..., (6, 7)
- A 4x4 pixel tile in the fourth strip at (1, 1), (3, 1), (5, 1), (7, 1), (1, 3), (3, 3), ..., (7, 7)
As you become willing to give up more bus time to changing a layer's scroll position with HDMA, more mappings become possible. There's a mapping for 4x16 pixel tiles that preserves locality, which in turn preserves the ability to use fractional buffering. It is the same as the previous mapping, with "first strip", "second strip", "third strip", and "fourth strip" reinterpreted as consecutive rows of 8 scanlines. Or if you're willing to change a layer's scroll position every second scanline, you can use a different mapping that may be more conducive to software rendering:
- y=0: (0, 0), (2, 0), (4, 0), (6, 0), with scroll (0, 0)
- y=1: (1, 0), (3, 0), (5, 0), (7, 0), with scroll (1, -2)
- y=2: (0, 1), (2, 1), (4, 1), (6, 1), with scroll (0, -3)
- y=3: (1, 1), (3, 1), (5, 1), (7, 1), with scroll (1, -5)
- y=4: (0, 2), (2, 2), (4, 2), (6, 2), with scroll (0, -6)
- y=15: (1, 7), (3, 7), (5, 7), (7, 7), with scroll (1, -22)
I suspect an XY problem. What were you planning on using the two layers for?
- greatkreator
- Posts: 49
- Joined: Wed Dec 09, 2015 2:18 pm
Re: Who knows how to use the direct color the most effective
My only purpose is to display random RGB array having for example about 100 colors and with 30 FPS.
As far I see currently I can do it for 256x144 view.
I don't know anything about SNES programming I just started to read tutorial/manuals.
For example my current development for Sega MD/G can produce hundreds of colors with 288x192 and 30 FPS.
I hoped(and still hope) that SNES could do at least the same. Because it has less horizontal resolution at least and capable of displaying much more colors than Sega MD/G "from the box".
As far I see currently I can do it for 256x144 view.
I don't know anything about SNES programming I just started to read tutorial/manuals.
For example my current development for Sega MD/G can produce hundreds of colors with 288x192 and 30 FPS.
I hoped(and still hope) that SNES could do at least the same. Because it has less horizontal resolution at least and capable of displaying much more colors than Sega MD/G "from the box".
-
- Posts: 3181
- Joined: Wed May 19, 2010 6:12 pm
Re: Who knows how to use the direct color the most effective
How can you have several hundred colors onscreen on the Sega Genesis?
- TmEE
- Posts: 1032
- Joined: Wed Feb 13, 2008 9:10 am
- Location: Norway (50 and 60Hz compatible :P)
- Contact:
Re: Who knows how to use the direct color the most effective
You can change all palettes per line if you really want, cost is losing some or all the sprites on that line, depending on how many colors you want to load.
-
- Posts: 592
- Joined: Thu Aug 28, 2008 1:17 am
- Contact:
Re: Who knows how to use the direct color the most effective
greatkreator: Why does it need to be 30fps?
What's the limitation of that mode, though? 64 color per scanline?
I guess you've missed out on all excitement about the DMA color trick.How can you have several hundred colors onscreen on the Sega Genesis?
What's the limitation of that mode, though? 64 color per scanline?
__________________________
http://pcedev.wordpress.com
http://pcedev.wordpress.com
Re: Who knows how to use the direct color the most effective
Like this, I presume. Apparently you get 160 pixels per scanline, and it keeps the CPU busy 100% of the time, but with the Sega CD you get another CPU that you can use for running the game.psycopathicteen wrote:How can you have several hundred colors onscreen on the Sega Genesis?