It is currently Fri Nov 24, 2017 12:36 am

All times are UTC - 7 hours



Forum rules


Related:



Post new topic Reply to topic  [ 47 posts ]  Go to page Previous  1, 2, 3, 4  Next
Author Message
PostPosted: Thu May 18, 2017 10:54 am 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19254
Location: NE Indiana, USA (NTSC)
Color value 0 means transparent. For example, the 4bpp background layers of mode 1 can never display colors 16, 32, 48, ..., 112, and the 2bpp layer can never display colors 4, 8, 12, ..., 28. The only way the color in CGRAM entry 0 ever gets displayed is if no enabled layers have an opaque pixel at a given position.

Thus this:
"the first 4 color subset would be indexes 0 through 3, the second subset would be indexes 4 through 8."
should be changed to this:
"the first 4 color subset would be transparency and indexes 1 through 3, the second subset would be transparency and indexes 5 through 7."

Where did the "126" come from in the "8 total 126 color palettes" in mode 3?

"however you can opt to use a 16x16 tile mode instead, which would allow for level maps being twice as high and wide in pixels"
Level because scrolling handles updates at the seam. What you get from 16x16 tiles is actually a small video memory savings, as a 32x32-tile map uses up 2K rather than 4K of video memory, freeing up the equivalent of 128 4bpp tiles.

Backgrounds can also be the front layer in color math.


Top
 Profile  
 
PostPosted: Thu May 18, 2017 11:52 am 
Online

Joined: Sat Apr 25, 2015 1:47 pm
Posts: 331
Location: FL
tepples wrote:
Where did the "126" come from in the "8 total 126 color palettes" in mode 3?


I assume that was a typo for "16".


Top
 Profile  
 
PostPosted: Thu May 18, 2017 1:13 pm 
Offline

Joined: Wed May 19, 2010 6:12 pm
Posts: 2369
Bitbeam wrote:
Hi everyone, I've updated the document based on your feedback as best I could. Please read this new version and let me know if I've made any mistakes or if anything is worded in a misleading or confusing manner.

______________________________________________________________________________________________________________________________

Super Nintendo/Super Famicom

Graphical summary


Standard game resolution: Most games were 256x224. Higher resolutions up to 512x448 were possible but since higher resolutions caused slowdown and flicker


:roll:


Top
 Profile  
 
PostPosted: Thu May 18, 2017 1:24 pm 
Offline

Joined: Fri Jul 04, 2014 9:31 pm
Posts: 801
psycopathicteen wrote:
:roll:

"Flicker" here may refer to the effect of interlace when fed unfiltered high-resolution graphics, rather than to sprite flicker. "Slowdown" remains unjustified.

Bitbeam wrote:
The three formulas for color overlay effects are additive, subtraction and average.

Actually there are four. The fourth is colour subtraction followed by halving.

You'll note that tepples described "three useful blending modes" (emphasis added), rather than saying there were only three modes. If you can think of a use for subtraction+halving, go nuts.

Quote:
There are 7 separate modes

There are 8. They run from 0 to 7 because computer.

Quote:
I'll only be covering the two most common and useful modes when the goal is multi-layered scrolling games.

...no Mode 7?

Quote:
Each sprite can be set to be in front of or behind any of the the background layers.

That's kinda true. Detailed descriptions here: https://wiki.superfamicom.org/snes/show/Backgrounds

Quote:
The SNES can display 128 sprites on screen in total, but any more than 32 per scan line will result in some sprites not being displayed.

It will also drop out sprite tiles if there are more than 34 of them on a scanline. There simply isn't enough time during HBlank to load any more graphic data than that.

The worst part is that they designed the sprite system so that the frontmost sprites will drop out if the limits are exceeded. If I'm not mistaken, the Mega Drive/Genesis drops the rearmost sprites, which I believe is slightly more complicated to implement but doesn't require any extra bandwidth.

Quote:
Only sprites using the sprite palettes 4 through 7 (the last 64 color indexes in the 256 total color indexes) can participate in color math (translucency effects)

You can, however, get around this entirely by using a main screen/subscreen trick explained on the Transparency page you've linked to.


Top
 Profile  
 
PostPosted: Thu May 18, 2017 2:01 pm 
Offline
User avatar

Joined: Mon Jan 23, 2006 7:47 am
Posts: 75
Bitbeam wrote:
Higher resolutions up to 512x448

No love for PAL? :(

Bitbeam wrote:
There are 7 separate modes

8 (0..7)

Bitbeam wrote:
The SNES can display 128 sprites on screen in total, but any more than 32 per scan line will result in some sprites not being displayed.

Plus the restriction of 34 8x8 tiles per line.

Bitbeam wrote:
Additive: This ads the color value of the sprite to the color value of the pixels in the Background layer under the sprite

That's extremely simplified...

The mainscreen and subscreen are rendered without any color math: each pixel on either screen is either a BG pixel, a sprite pixel, or backdrop - no translucency at all (only transparency if a color index is zero). This is where the BG mode matters.

Color math is only possible to be used when the mainscreen and the subscreen are combined. The BG mode doesn't matter here: you can have
- BG4 enabled on the mainscreen, plus
- BG1 enabled on the subscreen, plus
- color math enabled only for the backdrop pixels on the mainscreen

The result is that BG1 appears to be under BG4.

93143 wrote:
"Flicker" here may refer to the effect of interlace when fed unfiltered high-resolution graphics, rather than to sprite flicker. "Slowdown" remains unjustified.

Interlaced mode is technically 30 frames per second...


Top
 Profile  
 
PostPosted: Thu May 18, 2017 2:10 pm 
Offline

Joined: Sun Apr 13, 2008 11:12 am
Posts: 6450
Location: UK (temporarily)
No, that's not true. 480i60 is not 30 FPS, it's 60FPS, and always has been. A CRT displaying NTSC 480i content is still displaying 480 lines of content updated at 59.94 FPS, it's just that half the data is thrown away before it's sent over the wire.

Interlacing is a form of lossy compression, and saying that 60i content is actually 30p content is actively misleading. Treating it as 30p content is the very reason why "weaving" produces actively wrong results.


Ok, you were making a pedantic point about "fields" and "frames" but it's still misleading.


Last edited by lidnariq on Thu May 18, 2017 2:53 pm, edited 1 time in total.

Top
 Profile  
 
PostPosted: Thu May 18, 2017 2:31 pm 
Offline
User avatar

Joined: Tue Apr 05, 2016 5:25 pm
Posts: 146
93143 wrote:
"Flicker" here may refer to the effect of interlace when fed unfiltered high-resolution graphics, rather than to sprite flicker. "Slowdown" remains unjustified.

Yep. That is specifically why I mentioned that the PPU operates with constant timing. It can't "slow down" like a graphics processor drawing to a framebuffer can.

Quote:
The worst part is that they designed the sprite system so that the frontmost sprites will drop out if the limits are exceeded.

Actually, I can think of one place where this is useful. In Mode 7, if you want to have two backgrounds, you need to use sprites set to appear behind the Mode 7 BG. When you go over on one scanline, it only drops the sprites in front, preventing the fake background from flickering, therefore maintaining the illusion.

_________________
SNES NTSC 2/1/3 1CHIP | serial number UN318588627


Top
 Profile  
 
PostPosted: Thu May 18, 2017 2:52 pm 
Offline

Joined: Fri Jul 04, 2014 9:31 pm
Posts: 801
That's a good point. I wonder if that was their reasoning?


Top
 Profile  
 
PostPosted: Fri May 19, 2017 3:37 am 
Offline

Joined: Thu Feb 07, 2013 1:15 am
Posts: 95
Location: Sweden
I couldn't see it mentioned here so far, yet it's one of the most important things to realize for pixel artists targeting the SNES:

Pixel Aspect Ratio = 8:7
(for normal resolutions on NTSC display)


Top
 Profile  
 
PostPosted: Fri May 19, 2017 1:26 pm 
Offline

Joined: Sun Mar 27, 2016 7:56 pm
Posts: 138
Optiroc wrote:
I couldn't see it mentioned here so far, yet it's one of the most important things to realize for pixel artists targeting the SNES:

Pixel Aspect Ratio = 8:7
(for normal resolutions on NTSC display)

And just to clarify for those who may not be familiar with the term, or may confuse it with screen aspect ratio...

Unlike computer monitors, pixels on the SNES are not perfectly square. Instead, pixels are slightly wider than they are tall, by a ratio of 8:7. Because of this, if you want to draw, say, a perfect circle, making it 64 pixels wide and 64 pixels tall won't work, because it'll be slightly too wide. Instead, it would need to be 56 pixels wide and 64 pixels tall.

Many emulators and screenshots don't compensate for all of this, simply using a 1:1 PAR instead, since stretching the image will naturally blur it a little on a computer screen due to pixels not matching up, and the PAR difference is not a big problem for most people. However, it is a good thing to be aware of if you want to be sure your art will show up as you intend on a real SNES.


Top
 Profile  
 
PostPosted: Fri May 19, 2017 8:13 pm 
Offline

Joined: Wed May 19, 2010 6:12 pm
Posts: 2369
I decided to make a 512x224 version of my title screen.

Attachment:
title screen background hires.png
title screen background hires.png [ 11.6 KiB | Viewed 1160 times ]


Top
 Profile  
 
PostPosted: Sat May 20, 2017 7:36 pm 
Offline

Joined: Wed May 17, 2017 8:55 am
Posts: 11
Here's yet another revised version based on your feedback. Please let me know if I missed or misrepresented anything:
________________________________________________________________________________________________________________

Super Nintendo/Super Famicom

Graphical summary



Important: The SNES stretched its 256 pixel wide screen image horizontally, resulting in pixels which were wider than they are tall (not perfect squares). As almost all monitors these days use pixels which are very close to perfect squares, your artwork and the entire width of the screen will be wider running on the actual hardware or an emulator which compensates for this pixel aspect ratio difference.
Standard game resolution: Most games were 256x224 in Japan, the US, and Canada. Other regions such as Europe, Africa, and south America used PAL as opposed NTSC television standard and had a slightly increased vertical resolution (239 pixels instead of 224), but at the cost of games running 10 fps slower and the screen having a subtle but noticeable non-stop flicker due to a 50 FPS refresh rate instead of 60 FPS. The PAL versions of most popular games did not put use to the extra resolution so often just had a larger black bar at the bottom of the screen, nor did they compensate for the 10 FPS slow-down so the games actually ran noticeably slower. For these reasons, most emulators and re-releases of classic SNES games use the NTSC versions of the games. Higher resolutions up to 512x448 (512x478 for PAL) were possible but since higher resolutions caused “interlace flicker”, and/or had increased limitations on layers and colors (due to memory bandwidth constraints); the higher resolutions were used for less movement and animation-intensive games, in-game menus, text, and high resolution images.

color range: The SNES uses 5 bits per color channel, providing a palette of 32,768 colors.

Number of color indexes available: 256, but many more on-screen colors were possible via color arithmetic for translucency effects. The three formulas for color overlay effects are additive, subtraction and average.

Background graphics color limitations:

There are 8 separate modes the SNES can use which offer very different and often complicated combinations of abilities and limitations. I'll only be covering the two most common and useful modes when the goal is multi-layered scrolling games.

MODE 1 allows for 3 scrolling layers, where 2 layers allow 15 colors (plus transparent) per tile and the third layer is three colors plus transparent per tile.
Every tile in each of the two 16 (15 and transparent) color per tile layers can pick from any of the eight 16 color palettes reserved for backgrounds, where palette 0 is color indexes 0 through 15, palette 1 is color indexes 16 through 31 and so forth.
The 4 color (3 plus transparent) per tile layer allows each of its tiles to pick from eight 4 index sub-sets of the first 2 16 color palettes... so, the first 4 color subset would be indexes 0 through 3, the second subset would be indexes 4 through 8.

MODE 3 allows for 2 layers of scrolling, where one layer is 15 colors (plus transparent) per tile and the other layer allows for each tile to use the entire range of 256 colors! (255 plus transparent) This mode is often used for title-screens. Keep in mind the cost of having each 8x8 tile being 256 color, it will eat up Vram much faster than 16 color or 4 color tiles, and a background later using 16 color tiles which can each use any of 8 total 16 color palettes means you can easily make 120 color layers at a far smaller cost, and this is before any use of the translucent color blend modes or other available very low-”cost” tricks to increase the number of on-screen colors. This is why most games use mode 1 over mode 3 for actual in-game levels. Also keep in mind, in mode 3, the second set of 128 colors (color indexes) are shared between the 256 color background layer and the sprites.

In general sprites can be set to be in front of or behind any of the the background layers. More information on that can be found here: https://wiki.superfamicom.org/snes/show/Backgrounds

Each scrolling layer is typically made of 8x8 pixel tiles, however you can opt to use a 16x16 tile mode instead, which would allow for level maps being twice as high and wide in pixels, but at the cost of each 16x16 tile grid section in the layer using one 16 color palette as opposed to the ability to pick a different set of 16 colors every 8 pixels across or down on the grid.

Each layer can use up to 1,024 tiles, limited by the amount of VRAM being used by all other graphical assets.

For all modes except mode 7 (not covered here) background tiles CAN be flipped horizontally or vertically OR BOTH at the same time!

On top of the separate background layers, any of them can be individually sliced horizontally in order to add even more layers of “parallax” (parts of the background scrolling at separate speeds to create the illusion or dept in scrolling games).


Sprites

Sprites: The SNES can display 32 fifteen color (plus a “clear” index for transparent pixels) sprites per scan line (row of pixels on screen). Also, if more than 34 8x8 tiles of sprite image are on a scan line, some sprite tiles will not be drawn.

The SNES can display 128 sprites on screen in total, but any more than 32 per scan line will result in some sprites not being displayed.

Each sprite can use any of the final eight 16 color palettes starting at color index 128 with the first color index of each 16 color palette being used for transparent pixels. Only sprites using the sprite palettes 4 through 7 (the last 64 color indexes in the 256 total color indexes) can participate in color math (translucency effects)

The SNES can use two sizes for its sprites at a time. Following are all the available sprite size option combinations:
8x8 and 16x16
8x8 and 32x32
8x8 and 64x64
16x16 and 32x32
16x16 and 64x64
32x32 and 64x64
16x32 and 32x64 (vertical flipping flips each half separately)
16x32 and 32x32 (vertical flipping flips each half separately)

The SNES lets you use a maximum of 512 8x8 pixel 16 color dedicated tiles at a time for sprites.

Sprites can be horizontally or vertically flipped or both at the same time!



Color math overlay translucency effects:


Any sprite which is using any of the sprite palettes 4 through 7 (the final 64 color indexes in the 256 color palette) can be set to a translucent blending mode.

Not just specific sprites, but entire layers (screens and sub-screens) can be be set to blend modes, and this can be used to get around the limitation of only sprites with specific palettes being translucent. There are too many possible combinations to cover here, but the following web page explains it thoroughly: https://wiki.superfamicom.org/snes/show/TransparencyThe four modes are:

The four blending modes are:

1) Additive: This ads the color value of the sprite to the color value of the pixels in the Background layer under the sprite. This effect always makes color lighter. Great for mist, explosions, fire, magic, beams of light, etc.

2) Subtractive: This takes the color of the background layer under the sprite and subtracts the color of the sprite. This always produces a darker color. This is great for things like shadows, tinted glass, black smoke etc.

3) Average: This creates a 50 percent blend between the sprites colors and the colors in the background layer under the sprite. This effect is perfect for ghosts, light smoke, colored gas, or any other time you want something to look 50 percent translucent.

4) Subtract then divide by 2: This creates very dark colors and is not used very often.




For more detailed technical references:
https://wiki.superfamicom.org/snes/show/HomePage
https://emu-docs.org/Super%20NES/General/snesdoc.html


Top
 Profile  
 
PostPosted: Sun May 21, 2017 4:48 am 
Offline
User avatar

Joined: Mon Jan 23, 2006 7:47 am
Posts: 75
Bitbeam wrote:
Important: The SNES stretched its 256 pixel wide screen image horizontally, resulting in pixels which were wider than they are tall (not perfect squares). As almost all monitors these days use pixels which are very close to perfect squares, your artwork and the entire width of the screen will be wider running on the actual hardware or an emulator which compensates for this pixel aspect ratio difference.

I'd include an example: 256x224 screens should be stretched to 293x224 temporarily to see the proper aspect ratio.

Bitbeam wrote:
so, the first 4 color subset would be indexes 0 through 3, the second subset would be indexes 4 through 8.

4 through 7.

Bitbeam wrote:
This ads the color value of the sprite to the color value of the pixels in the Background layer under the sprite.

*adds, also I still don't really like "the background layer under the sprite" - you can't use color math vertically, you can only add/subtract/average the two screens that are rendered at the same time. You could write "This adds the color value of the sprite to the color value of the layer that the sprite is combined with".


EDIT: Maybe it would be best to create a small utility that lets artists fill virtual VRAM+CGRAM+OAM and set the screen parameters and then renders the screen (sort of like vSNES).


Top
 Profile  
 
PostPosted: Sun May 21, 2017 6:45 am 
Offline

Joined: Wed May 19, 2010 6:12 pm
Posts: 2369
Here's how Alisha's 512x224 title screen looks like with a 8:7 aspect ratio. I think it looks very arcade-like.

Attachment:
Alisha's hires title screen aspect ratio.png
Alisha's hires title screen aspect ratio.png [ 161.12 KiB | Viewed 1029 times ]


Top
 Profile  
 
PostPosted: Sun May 21, 2017 9:13 am 
Offline

Joined: Wed May 17, 2017 8:55 am
Posts: 11
I've made the latest corrections and clarifications. I think it's getting close"
_____________________________________________________________________________________________________



Super Nintendo/Super Famicom

Graphical summary



Important: The SNES stretched its 256 pixel wide screen image horizontally, resulting in pixels which were wider than they are tall (not perfect squares). As almost all monitors these days use pixels which are very close to perfect squares, your artwork and the entire width of the screen will be wider running on the actual hardware or an emulator which compensates for this pixel aspect ratio difference. You can temporarily stretch your image from 256 pixels wide to 298 pixels wide to preview how your art will look once its showing on an actual SNES.


Standard game resolution: Most games were 256x224 in Japan, the US, and Canada. Other regions such as Europe, Africa and south America used PAL as opposed NTSC television standard and had a slightly increased vertical resolution (239 pixels instead of 224), but at the cost of games running 10 fps slower and the screen having a subtle but noticeable non-stop flicker due to a 50 FPS refresh rate instead of 60 FPS. The PAL versions of most popular games did not put use to the extra resolution so often just had a larger black bar at the bottom of the screen, nor did they compensate for the 10 FPS slow-down so the games actually ran noticeably slower. For these reasons, most emulators and re-releases of classic SNES games use the NTSC versions of the games. Higher resolutions up to 512x448 (512x478 for PAL) were possible but since higher resolutions caused “interlace flicker”, and/or had increased limitations on layers and colors (due to memory bandwidth constraints); the higher resolutions were used for less movement and animation-intensive games, in-game menus, text, and high resolution images.

color range: The SNES uses 5 bits per color channel, providing a palette of 32,768 colors.

Number of color indexes available: 256, but many more on-screen colors were possible via color arithmetic for translucency effects. The three formulas for color overlay effects are additive, subtraction and average.

Background graphics color limitations:

There are 8 separate modes the SNES can use which offer very different and often complicated combinations of abilities and limitations. I'll only be covering the two most common and useful modes when the goal is multi-layered scrolling games.

MODE 1 allows for 3 scrolling layers, where 2 layers allow 15 colors (plus transparent) per tile and the third layer is three colors plus transparent per tile.
Every tile in each of the two 16 (15 and transparent) color per tile layers can pick from any of the eight 16 color palettes reserved for backgrounds, where palette 0 is color indexes 0 through 15, palette 1 is color indexes 16 through 31 and so forth.
The 4 color (3 plus transparent) per tile layer allows each of its tiles to pick from eight 4 index sub-sets of the first 2 16 color palettes... so, the first 4 color subset would be indexes 0 through 3, the second subset would be indexes 4 through 7.

MODE 3 allows for 2 layers of scrolling, where one layer is 15 colors (plus transparent) per tile and the other layer allows for each tile to use the entire range of 256 colors! (255 plus transparent) This mode is often used for title-screens. Keep in mind the cost of having each 8x8 tile being 256 color, it will eat up Vram much faster than 16 color or 4 color tiles, and a background later using 16 color tiles which can each use any of 8 total 16 color palettes means you can easily make 120 color layers at a far smaller cost, and this is before any use of the translucent color blend modes or other available very low-”cost” tricks to increase the number of on-screen colors. This is why most games use mode 1 over mode 3 for actual in-game levels. Also keep in mind, in mode 3, the second set of 128 colors (color indexes) are shared between the 256 color background layer and the sprites.

In general sprites can be set to be in front of or behind any of the the background layers. More information on that can be found here: https://wiki.superfamicom.org/snes/show/Backgrounds

Each scrolling layer is typically made of 8x8 pixel tiles, however you can opt to use a 16x16 tile mode instead, which would allow for level maps being twice as high and wide in pixels, but at the cost of each 16x16 tile grid section in the layer using one 16 color palette as opposed to the ability to pick a different set of 16 colors every 8 pixels across or down on the grid.

Each layer can use up to 1,024 tiles, limited by the amount of VRAM being used by all other graphical assets.

For all modes except mode 7 (not covered here) background tiles CAN be flipped horizontally or vertically OR BOTH at the same time!

On top of the separate background layers, any of them can be individually sliced horizontally in order to add even more layers of “parallax” (parts of the background scrolling at separate speeds to create the illusion or dept in scrolling games).


Sprites

Sprites: The SNES can display 32 fifteen color (plus a “clear” index for transparent pixels) sprites per scan line (row of pixels on screen). Also, if more than 34 8x8 tiles of sprite image are on a scan line, some sprite tiles will not be drawn.

The SNES can display 128 sprites on screen in total, but any more than 32 per scan line will result in some sprites not being displayed.

Each sprite can use any of the final eight 16 color palettes starting at color index 128 with the first color index of each 16 color palette being used for transparent pixels. Only sprites using the sprite palettes 4 through 7 (the last 64 color indexes in the 256 total color indexes) can participate in color math (translucency effects)

The SNES can use two sizes for its sprites at a time. Following are all the available sprite size option combinations:
8x8 and 16x16
8x8 and 32x32
8x8 and 64x64
16x16 and 32x32
16x16 and 64x64
32x32 and 64x64
16x32 and 32x64 (vertical flipping flips each half separately)
16x32 and 32x32 (vertical flipping flips each half separately)

The SNES lets you use a maximum of 512 8x8 pixel 16 color dedicated tiles at a time for sprites.

Sprites can be horizontally or vertically flipped or both at the same time!



Color math overlay translucency effects:


Any sprite which is using any of the sprite palettes 4 through 7 (the final 64 color indexes in the 256 color palette) can be set to a translucent blending mode.

Not just specific sprites, but entire layers (screens and sub-screens) can be be set to blend modes, and this can be used to get around the limitation of only sprites with specific palettes being translucent. There are too many possible combinations to cover here, but the following web page explains it thoroughly: https://wiki.superfamicom.org/snes/show/TransparencyThe four modes are:

The four blending modes are:

1) Additive: This ads the color value of the sprite to the color value of the pixels in the Background layer which the sprite is overlapping. This effect always makes color lighter. Great for mist, explosions, fire, magic, beams of light, etc.

2) Subtractive: This takes the color of the background layer the sprite is overlapping and subtracts the color of the sprite. This always produces a darker color. This is great for things like shadows, tinted glass, black smoke etc.

3) Average: This creates a 50 percent blend between the sprites colors and the colors in the background layer the sprite is overlapping. This effect is perfect for ghosts, light smoke, colored gas, or any other time you want something to look 50 percent translucent.

4) Subtract then divide by 2: This creates very dark colors and is not used very often.



For more detailed technical references:
https://wiki.superfamicom.org/snes/show/HomePage
https://emu-docs.org/Super%20NES/General/snesdoc.html


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

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 5 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