Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Anti-aliasing edges of 2D graphics

  1. #1

    Anti-aliasing edges of 2D graphics

    Hi. I'm new to Delphi game programming and am still in the process of choosing a game library/component set to use for my first project. I originally thought of using DirectX, but as I am very poorly informed in this field, any recommendations are welcome. I am looking for a simple yet powerful set that can do the following:

    http://i113.photobucket.com/albums/n...ono/Eruruw.jpg

    This is screenshot from a game where one graphic (the girl) is displayed against a background graphic. Note how there is no sharp contrast between the edges of the character image and the background. It has been suggested to me that this is done using multiple levels of transparency as opposed to the single transparency colour used by Bitmap files. It has also been pointed out to me that DirectDraw does not support PNG files that have better support for transparency (at least not by default).

    Could someone please recommend me a solution for dealing with hard edges like this and possibly suggest a game library/component set that allows it? For example, if you think using PNG files is the solution, could you please recommend me a good component set that allows for PNGs?

    Bear in mind that I have no experience in game programming with Delphi.

    Thank you in advance.

  2. #2

    Anti-aliasing edges of 2D graphics

    You can work with pngs using various means. My suggestion is to use something like DanJetX or Asphyre - they both use 3d hardware to render anything you may want. It is very straightforward to create 2d environments using these libraries.

    I have most experience with DanJetx and I found it easy to learn and use.
    The views expressed on this programme are bloody good ones. - Fred Dagg

  3. #3

    Anti-aliasing edges of 2D graphics

    Tga files could be an option as well as they are more widely supported too. Only drawback could be the filesize, but there are ways to counter that.

  4. #4

    Anti-aliasing edges of 2D graphics

    Phoenix which uses OpenGL is also an option.
    You may also take a look at Galfars Vampyre Imaging Library which have functions to load images ready to use in SDL, OpenGL and DirectX. This gives you the option to use pretty much any library and any image format supported by Imaging.
    Imagine I've written something clever here inspiring you to make something awesome. If that happens give me credits

  5. #5

    Anti-aliasing edges of 2D graphics

    Wouldn't using vector graphics be the best solution to all your problems?

    On a similar note, what are the possibilities with delphi, to use vector graphics?
    Peregrinus, expectavi pedes meos in cymbalis
    Nullus norvegicorum sole urinat

  6. #6

    Anti-aliasing edges of 2D graphics

    If he were to scale and do other transformations to his image, vector gfx would be an excellent solution, but if he's just going to show images like the one in the picture I would stick with rasters. He could get the same result with PNG-file or by using some dithering or anti aliasing the edges.

    About Vectors in Delphi, I've seen some few libraries, but none off the suitable for game development.
    Imagine I've written something clever here inspiring you to make something awesome. If that happens give me credits

  7. #7

    Anti-aliasing edges of 2D graphics

    Thank you very much for your input. Please, more suggestions are welcome. If there is little support for vectors in Delphi, then I'm afraid taking that route is not an option for me. Besides, the most important feature for me right now is anti-aliasing. Well, so far, I have been recommended the following:

    - Asphyr
    - DanJetX
    - Phoenix (with OpenGL)

    Could someone please provide me with links to where I could download these packages and perhaps some tutorials or samples to get me started? I'm sorry if I seem lazy, but please understand that I am trying to squeeze this in between three other major projects I'm tackling simultaneously.

  8. #8

    Anti-aliasing edges of 2D graphics

    Coders rule nr 1: Face ur bugz.. dont cage them with code, kill'em with ur cursor.

  9. #9
    Co-Founder / PGD Elder WILL's Avatar
    Join Date
    Apr 2003
    Location
    Canada
    Posts
    6,107
    Blog Entries
    25

    Anti-aliasing edges of 2D graphics

    Check out the guide I posted last month at http://www.pascalgamedevelopment.com...rary_Guide.pdf
    Jason McMillen
    Pascal Game Development
    Co-Founder





  10. #10

    Anti-aliasing edges of 2D graphics

    Every graphics library propably can do the trick you need, even default Delphi API. For that there is package called PNGImage. This makes possible for these images to load into TImage too
    http://pngdelphi.sourceforge.net/
    What PNG does is add alpha layer in addition to RGB, and DirectX as well as OpenGL can draw it well. Loading the texture and rendering depends on the engine then. If engine doesn't support Png, you can use the PNGImage units to make own loading procedure using the scanlines... as a last resort.

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Comodo SSL