Re: Problem with sprites in directx 9.0c
- From: "Wessam Bahnassi" <wbahnassi@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 24 Jul 2006 14:11:35 -0400
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.
.
- Follow-Ups:
- Re: Problem with sprites in directx 9.0c
- From: Bill
- Re: Problem with sprites in directx 9.0c
- References:
- Problem with sprites in directx 9.0c
- From: Bill
- Problem with sprites in directx 9.0c
- Prev by Date: Re: Writing a 3dsmax to Direct3D Exporter
- Next by Date: Re: Animated skinned mesh bone boundings?
- Previous by thread: Problem with sprites in directx 9.0c
- Next by thread: Re: Problem with sprites in directx 9.0c
- Index(es):
Relevant Pages
|