51
Q-Gears / Re: Resolution in Q-gears
« on: 2006-06-09 08:50:27 »
You're not going to get any decent results just by filtering the background textures, regardless of how you treat the alpha channel (although alpha does present a few additional snags). The reason would be the tiled nature of the background layers, and that the tile that is next to another tile visually is not necessarily stored next to that tile in the source texture, and the filtering is done in the texture lookup, not on-screen. This is further complicated by the fact that the neighboring tile in the source texture is not necessarily using the same palette as the current tile, which is why you sometimes get that familiar grid pattern when running the current FF7/FF8 with anti-aliasing turned on... part of the neighboring texture data is used in the filtering, but those pixels actually belong somewhere else on the screen and/or uses a different palette, resulting in strange, oddly colored lines around the tile grid.
You could improve this a bit with fragment shaders (implementing 2xSAI or whatever) by restricting filtering to not include image data on the other side of tile boundaries, but this both raises hardware requirements and is not perfect, as you would get a "grid" pattern of less-filtered image data along the tile boundaries. It's probably won't look that prominent though, so I'd actually say this is a decent compromise solution. And fragment shaders will also help you easily get around paletted textures, since that feature is present and enabled in far from all graphics cards today.
To truly get nice looking backgrounds, you'd have to pre-paint the background onto a render texture, somehow preserving layer information (explicitly writing to the depth buffer perhaps?), and then filter that texture when drawing it to the screen. Edges where the characters are partially obscured by the background will still look a bit funny (very sharp edges on a fuzzy background), then again it looks like that anyway.
You could improve this a bit with fragment shaders (implementing 2xSAI or whatever) by restricting filtering to not include image data on the other side of tile boundaries, but this both raises hardware requirements and is not perfect, as you would get a "grid" pattern of less-filtered image data along the tile boundaries. It's probably won't look that prominent though, so I'd actually say this is a decent compromise solution. And fragment shaders will also help you easily get around paletted textures, since that feature is present and enabled in far from all graphics cards today.
To truly get nice looking backgrounds, you'd have to pre-paint the background onto a render texture, somehow preserving layer information (explicitly writing to the depth buffer perhaps?), and then filter that texture when drawing it to the screen. Edges where the characters are partially obscured by the background will still look a bit funny (very sharp edges on a fuzzy background), then again it looks like that anyway.