I'm using Direct3D 9 to draw an layered interface with extensive alpha blending. To draw antialiased lines I use the ID3DXLine interface, which works fine to me.
Problem is that if I call ->SetAntialias(true) on my line interface, alphablending stops working for any sprites drawn with ID3DXSprite afterwards. But If I draw a line without antialiasing it starts working again. I'm no expert on 3D and D3D, but I cannot seem to detect any texture state changes or render state changes made by the interface, and I don't know what to fix
I can get around the problem by drawing the line twice, one time with antialiasing and one time without (with zero alpha) but I'd rather have a proper solution. I don't have this problem on all computers, ie it seems to work fine on my stationary but not on my laptop that uses an older graphics board.
Any ideas on how to get around this

State changes made by ID3DXLine?
Marius F
jamesofthedead
My images are in fact alphablended, but onto a black background instead of the back buffer if I've previously drawn an antialiased line with ID3DXLine. Which means that some of my images get a black frame (but not in a randomized fashion). As usual it works fine again as soon as I draw an aliased line with ID3DXLine.
I use ID3DXSprite for drawing plain bitmaps with an alpha channel. Alpha modulation + color modulation works fine. From what I've understood, the ID3DXSprite and the ID3DXLine interfaces should be taking care of all state changes necessary (and also restore the previous state).
I'd blame the old Radeon Mobility card in my laptop, if it wasn't for the fact that I'm able to correct the problem quite easily by always drawing a dummy aliased line before using ID3DXSprite. If I do this, everything works perfectly.
/hee00awa
Edit:
I should add that I have no problems with the visibility of the antialiased lines. The lines look fine, it's just bitmaps drawn with ID3DXSprite directly afterwards that are affected.
Edit again:
It's bound to SINGLE WIDTH ANTIALIASED lines only. If I add 0.001 to the line width, the problem goes away. Also, It only affects the first sprite drawn afterwards. I.e. a call to ID3DXLine::Draw with an antialiased line with the exact width of 1 does something to the alphablending on the next sprite drawn through ID3DXSprite, on my ATI Radeon. The Begin/Ends of my ID3DXSprite/ID3DXLine interfaces are not nested in any way.
Fergal_OC
Thanks
hee00awa
MrJP
Also, if you suspect your card's driver, then you can always run your program in RefRast to see if it gives the same results...
donnie100