PDA

View Full Version : DirectX frustration - texture movement is odd



Eriken
31-10-2004, 07:33 PM
Eriken.SetDirectXKnowledge := Newbie;

So, here is the story, I am trying to figure out why the paddle and the ball in an Arkanoid-clone isn't drawn completely when they are moving. Once they stop moving, they are drawn completely.

Reading several pages and forums the last days haven't cleared up the mystery, so I might as well try and see if you guys have any ideas. In the end it might just be something silly.

I am taking a wild guess that is has to do with masking, or anti-aliasing in some odd way. Tried setting MULTISAMPLETYPE to ..._NONE but that didn't do much, also turned D3DRS_MULTISAMPLEANTIALIAS off but it looks like I'm on a wild goosechase..

Let us take the ball, it blends in with the background on the side of the ball that is facing the direction. So, if the ball moves left, and the background is red (255,0,0) the left edge of the ball turns dark-red.

I've tried images like bmp and dds for the ball, with the same result.. I also tried porting it to c++ and got the same stuff there.. So I have a feeling it's either got to do with my code or maybe the Debug-DirectX is playing games with me.

I'm not going to post any code now because it looks like a mess, but if there is anything obvious I'm missing please let me know ;-)

I'll copy in code on request if it helps.
_____
Eriken
- Annoyed with DirectX (probably another MS-feature "Be pissed off") and going to watch a movie.

Clootie
31-10-2004, 07:38 PM
Hmm.., it's VERY hard to tell you something.
... alpha-blending?

Traveler
31-10-2004, 09:57 PM
Indeed, I have no clue as to what you mean by " isn't drawn completely when they are moving." Also to which arkanoid clone are you refering? If yours, then perhaps a screenhots of the problem might help us.

Eriken
01-11-2004, 07:30 AM
I'm refering to an Arkanoid-clone we're trying to make just to get familiarized with DirectX.

Now.. let us see here... Screencapturing didn't work very well, so I had to do it this way.

http://home.online.no/~eeinebae/Ball3.gif

Ball 1 is the effect I get on screen when the ball moves right.
Ball 2 is the effect I get on screen when the ball moves left.
Ball 3 is the original texture which is loaded, and also what I get on screen (if you imagine a red background) when there is no movement.

What I want is that the ball always is like the loaded image, without these edges going red on me..

Any ideas?
_____
Eriken

Traveler
01-11-2004, 12:02 PM
It's a guess, but i'd say your alpha map is not correct. Perhaps it is smaller or has pixels with different values for what you think is white.

Clootie
02-11-2004, 09:08 PM
It's hard to code that effect specially, so probability of you're getting this just by little bug are really low. Maybe it's just the way your LCD monitor works? :)
Try to use debug version of Direct3D runtime and look in debug output of your application.