Re: Problem with sprites in directx 9.0c

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Please post a link to pictures of your source art (wiht alpha) and how it
renders "wrong" in your app...
As a test, you can try reverting to point-sampling for your magnification
filter in the texture sampler.

--
Wessam Bahnassi
Microsoft DirectX MVP,
Programmer
Electronic Arts


"Bill" <nospam@xxxxxxxx> wrote in message
news:yamdnYUz9v2Vo1nZnZ2dnUVZ_smdnZ2d@xxxxxxxxxxxxxxx
I am in the process of rewriting an application of mine so that it uses
DirectX instead of pictureboxes and other slow windows forms components for
its graphical output.

I've gotten directx up and running, using Managed DirectX 9.0c in C#. I am
not using the 2.0 beta libraries, but the older, supported ones, 1.x.
Since my app is 2D, I just need to use sprites. However, a requirement is
that I am able to scale sprites with transparent portions in them to
different sizes. Shouldn't be a problem, right? Wrong.

When I draw the sprite on the screen with default scaling, everything
looks great. The edges of the sprites are clean like they should be.
Unfortunately, if I apply any kind of scaling to them, using a
transformation matrix, they develop a prominent white/grey edge between
where the alpha mask ends and the sprite graphic begins. This edge does
not show up when there is no scaling. I have confirmed in photoshop that
there is no gap of any kind between the alpha channel mask and the image
itself. The image in PS has no anti-aliasing of any sort around the edges.
When I created the alpha mask all anti aliasing options were turned off. I
have been pulling my hair out trying to find out why it happens, with no
success searching the web or usenet (all I have found is messages from
people who had anti aliased the edges of their sprites, and mine are not).
And it's not limited to my computer either, as I've tried it on my laptop
too and the same problem happens.

If I can't find a way to fix this I'll need to tell the person who is
making the graphics that he is going to have to do multiple versions of
the same graphic at different sizes, which is just ridiculous. Anyone ever
heard of this happening or have any suggestions of what I can try? If more
detail is needed I can post some code and a screenshot of the problem.



.



Relevant Pages

  • Re: Problem with sprites in directx 9.0c
    ... The default filter for both minification and magnification is a Point ... And then a screenshot of what is happening in directx. ... I just need to use sprites. ... making the graphics that he is going to have to do multiple versions of ...
    (microsoft.public.win32.programmer.directx.graphics)
  • Re: Problem with sprites in directx 9.0c
    ... I put the saved bitmap with alpha version up too in a zip file. ... And then a screenshot of what is happening in directx. ... I just need to use sprites. ... making the graphics that he is going to have to do multiple versions of ...
    (microsoft.public.win32.programmer.directx.graphics)
  • Re: Problem with sprites in directx 9.0c
    ... Your issue happens because of the filtering. ... And then a screenshot of what is happening in directx. ... I just need to use sprites. ... making the graphics that he is going to have to do multiple versions of ...
    (microsoft.public.win32.programmer.directx.graphics)
  • Problem with sprites in directx 9.0c
    ... I've gotten directx up and running, using Managed DirectX 9.0c in C#. ... I just need to use sprites. ... created the alpha mask all anti aliasing options were turned off. ... the graphics that he is going to have to do multiple versions of the same ...
    (microsoft.public.win32.programmer.directx.graphics)
  • Re: transparency in PNG images
    ... Knute Johnsonwrote: ... Is there any way to get part of the image back to transparent? ... Doesn't Clear set the alpha to 1.0f? ... When the graphics context's composite is set to an instance of ...
    (comp.lang.java.gui)