Results 1 to 6 of 6

Thread: Anti Aliased Images & Background / Transparent Colour

  1. #1

    Anti Aliased Images & Background / Transparent Colour

    OK, I gave a couple of problems that I have brushed under the carpet until now, but I guess it's about time I targeted them

    Has anyone had experience of using DirectDraw when it comes to anti aliased images? The edges obviously blend with the background colour, effectively meaning that we can't use AA images =/

    Does anyone know of a way around this? The other thing is the background colour of rendered output. The floor is specified as a specific colour, but due to lighting the actual pixel colour is not contant for the whole image, meaning that we can't just load the image into the client without some pre processing first. I had played with the option of a tolerance level which I may end up implementing to save time, but has anyone else come across this and if so how did you avoid it?

    The transparent colour can have a LOW value and HIGH value can't it? How would you use this with 16 bit bitmaps (BGR) to avoid having to pre process each bitmap?
    http://www.c5software.co.uk (site is being developed at the moment)

  2. #2

    Anti Aliased Images & Background / Transparent Colour

    If you want anti-aliased drawing in DirectDraw, you have to read pixels from the destination buffer. This means locking the destination buffer and reading the pixels which can be slow.

  3. #3

    Anti Aliased Images & Background / Transparent Colour

    Quote Originally Posted by Sly
    If you want anti-aliased drawing in DirectDraw, you have to read pixels from the destination buffer. This means locking the destination buffer and reading the pixels which can be slow.
    That's not quite what I meant. What I mean is that the images are bitmaps that are already anti aliased in LightWave 3D. This means that you get a fuzzy edge when you try and blit it onto a DirectDraw surface, due to the edge of the image 'bleeding' into its background. The images look great until you blit them onto an existing image =/
    http://www.c5software.co.uk (site is being developed at the moment)

  4. #4

    Anti Aliased Images & Background / Transparent Colour

    Ok. So you have two options.
    1. Re-render using Lightwave but with anti-aliasing turned off. This will give you images with sharp edges.
    2. As you hinted in your original post, pre-process the images in a paint program to give them a sharp edge and a fixed background colour.

  5. #5

    Anti Aliased Images & Background / Transparent Colour

    Try rendering to tga output. If you open it in photoshop, you'll see your image without a background. (strangely enough also without an alpha channel, but you don't need it anyway). Then the next step is to create a png from the tga and import that into your game.

    I was able to use this approach in my PGD entry and it worked perfectly.

  6. #6

    Anti Aliased Images & Background / Transparent Colour

    DirectDraw by itself doesn't support alpha-blending
    There are only 10 types of people in this world; those who understand binary and those who don't.

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
  •