   DirectX 9 ID3DXSPRITE Scaling Effecting ALPHA!?
  After researching fairly heavily the implementation of the D3DXSPRITE interface, I found most of this stuff is really outdated, but I'm working away at it and have a very specific issue.I have a working font rasterizing system that is very nice, except after porting from DX8.1 to 9, the ::Draw method of D3DXSPRITE changed. Now, in order to scale my sprites, I have to create and set a transformation matrix, set the sprite to it, and then draw. My confusion begins when both the D3DXMatrixTransformation2D() method and D3DXSPRITE::Draw() method have position/translation parameters, although setting all attributes to the matrix, and passing NULL to D3DXSPRITE::Draw() works almost perfectly.The PROBLEM is this: Whenever I scale my sprites, their alphas decrease! Even when disabling alphatesting/blending and passing full white D3DCOLOR to D3DXSPRITE:Draw()!I've messed around with texture stage states and render states, but the fact remains that if alpha blending is disabled, I can't see any reason why just the scaling factor would decrease transparency... Here's my code:D3DXMATRIXpTransform;D3DXVECTOR2spriteScale = D3DXVECTOR2( m_fScale.x, m_fScale.y);D3DXVECTOR2spritePos;D3DXVECTOR2spriteCenter;D3DXMatrixIdentity( &pTransform );spritePos = D3DXVECTOR2( m_fPosition.x, m_fPosition.y );spriteCenter = D3DXVECTOR2( m_fTextureOrigin.y,m_fTextureOrigin.y );D3DXMatrixTransformation2D( &pTransform, NULL, 0.0f, &spriteScale, &spriteCenter, fAngle, &spritePos );if( FAILED( m_pkGraphics->GetSpriteCOM()->Begin( 0 ) ) )AppError( myFalse, L"cRasterFont::Render sprite begin call failed." );m_pkGraphics->EnableAlphaBlending( myFalse );m_pkGraphics->GetSpriteCOM()->SetTransform( &pTransform );if( FAILED( m_pkGraphics->GetSpriteCOM()->Draw( m_pkTexture->GetTextureCOM(),   &m_pkAnimations[0].m_kFrameRect,  NULL,NULL,  m_iColor )) ){m_pkGraphics->GetSpriteCOM()->End(); m_pkGraphics->EnableAlphaBlending( myTrue );return myErrorDrawSprite;}m_pkGraphics->GetSpriteCOM()->End();m_pkGraphics->EnableAlphaBlending( myTrue );return myNoError;Everything works perfectly, except as the scaling factor is decreased below 1.0, the graphic becomes more and more transparent...Lighting and Z-Buffer are disabled.. I really like this interface and just can't find any information regarding this particular effect I'm seeing..Any insight at all would be greatly appreciated. THANKS![Edited by - sinmangas on August 8, 2010 12:15:26 AM]
  Is it happening only when you scale down ? Reminds me of this problem, i.e. some mipmapping going wrong. Since you say you checked with render/texture stage states already, I'd check if the texture is loaded properly (automatic generation of mipmaps). Can you provide some screenshots, please ?   ;  Yes, only when scaling down. See, I'm only using screen space - I have the ZBuffer disabled, I'm not even clearing the zbuffer, I'm operating entirely in 2D (as far as I know, anyway..), so I don't see how mipmapping would effect this because that effects the sampling depending on the texture's "distance" from the screen, right?Anyway, here is a screenshot - four lines of text printed while only clearing the screen to black.AlphaBlending AND AlphaTesting ENABLED.Left shows AlphaTesting:Enabled, AlphaBlending: Disabled.Right shows AlphaTesting:Disabled, AlphaBlending: Disabled.WEIRD, HUH!? When AlphaBlending is disabled, it shows the one at 55%, but when it is enabled, you can't see it at all at 0.55..[Edited by - sinmangas on August 8, 2010 5:43:01 AM];  WELL, then... I do thank you, sir, for your comment on mipmapping, because I went through my code and found that as I was loading the texture like this:pkGraphics->GetDeviceCOM()->CreateTexture( m_pRawImage->GetWidth(),   m_pRawImage->GetHeight(),   0, 0,   D3DFMT_A8R8G8B8,   D3DPOOL_MANAGED,   &m_pTexture, NULL )) )That second 0, there, has a usage flag that when I looked it up, I could set to "D3DUSAGE_AUTOGENMIPMAP," and surely enough, it fixed the weird "ghost alpha" problem. THANKS AGAIN FOR READING AND POSTING![Edited by - sinmangas on August 8, 2010 5:39:47 AM];  Glad, I could help [smile].By the way, nice old-school graphics, gives me nostalgia (Amiga).   