Jump to content
  • Advertisement
Sign in to follow this  
KuroKage

Aliased Sprite In A High Resolution Game ???

This topic is 5454 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, This has been bugging me for so long and I hope that you guys will be able to clarify this for me once and for all. The question is, in any game that uses sprites (beat em ups, sidescrolls etc.), all sprites are aliased. Their contours are exactly one pixel in dimension but you can't see its jagginess when you're playing it. (1) Is it because the resolution is too low (I think it's 320 x something. TV resolution)? If so, what if your game is at 800 x 600. Then sprites would have to at least be 90 x 90 to show any of its detail. However it's nearly insane to do this pixel by pixel so the only choice would be to draw it as you would to any other art using contour lines that are ANTI-ALIASED. The problem with this is that the pixels that help anti aliased the black contour lines also show up in the game. My next question would be (2) How can I create the same effect of an anti-aliased line in the actual game? THANKS VERY MUCH IN ADVANCE!!

Share this post


Link to post
Share on other sites
Advertisement
Using an alpha channel is one way, depending on what software you use to create the sprites. To anti-alias you make pixels more transparent around the edges as needed.

Share this post


Link to post
Share on other sites
Quote:
Is it because the resolution is too low (I think it's 320 x something. TV resolution)


I think TVs are just blurry compared to computer monitors. That's why you can't see the jaggies so well in console games.

Share this post


Link to post
Share on other sites
TV is typically 720x486 (NTSC) or 720x576 (PAL). Note that this means that pixels are not square. Also, because of overscan, not all pixels are actually visible; plus there are sync lines.

Share this post


Link to post
Share on other sites
I don't really know the answer to this, but I know what you mean, the same problem can happen (or this maybe what you are saying), if you have a small sprite and then want to magnify it, maybe your sprite is 32"32 but you want it to show up as 128*128 or something, then you see all the jaggedness around the edge.

If you don't have too many sprites, resize them in paint or something, then manually touchup the edges, takes the colour nearest or something and use that. You may also have to touch up inside the image as well, when I did it for something (with paintshop pro), I resizesd the bitmap, saved it as a separate file then (with both pictures open at once), just manually corrected the new bitmap. I used the original to get the pixel colours from and for referance. It takes a bit of time as you really have to redo everywhere, where the colours have been made jaggardy.

The only other thing I can say though, is with things like directx, (and maybe other libraries)? I think the antialiasing
is taken care of for you.

Share this post


Link to post
Share on other sites
Quote:
Original post by KuroKage
owever it's nearly insane to do this pixel by pixel so the only choice would be to draw it as you would to any other art using contour lines that are ANTI-ALIASED. The problem with this is that the pixels that help anti aliased the black contour lines also show up in the game.

Any decent art program will allow you to turn off the antialiasing.

Quote:
My next question would be (2) How can I create the same effect of an anti-aliased line in the actual game? THANKS VERY MUCH IN ADVANCE!!

By anti-aliasing in-game perhaps? Or if alpha transparency is an option you can create an alpha mask with soft edges instead of just a simply color key for transparency, just keep in mind that if you don't have hardware acceration for the alpha transparency it can be a LOT more costly than running an antialias filter over the final frame.

Share this post


Link to post
Share on other sites
Hi again,

Thanks for the replies guys! How exactly does that Alpha Channeling/Transparency/Blending (I'm assuming they point to the same thing) done? THANKS AGAIN IN ADVANCE!!

Share this post


Link to post
Share on other sites
Alpha testing is where for each pixel in your texture, you test it's alpha value. If that alpha value is greater then/less then/between/etc some reference value (your choosing) then you draw it. Otherwise it is considered transparent and not drawn. Both DirectX and OpenGL allow you to select the comparison function (greater then/less then/between/etc) used.

Alpha blending is very similar to alpha testing except that rather then simply turning a pixel on or off, you blend it with the dest pixel based the function:

color_out = (color_source * source_blend_func) + (color_dest * dest_blend_func)

For instance a common way to do transluency (sp?) is to set the source_blend_func to the alpha value of the source pixel and the dest_blend_func to 1 - alpha value of the source pixel. So if your source pixel has a alpha value of 0, color_out will be the full value of color_dest (in other words the pixel won't be drawn) and if it's 1 the source pixel shows completly. Values in between will give different amounts of translucency. You can do all sorts of neat blending effects by changing the blending functions, check out DirectX's and OpenGL's docs for more options.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!