Jump to content

  • Log In with Google      Sign In   
  • Create Account


Downscaling sprite -> black screen


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 Juliean   GDNet+   -  Reputation: 2246

Like
0Likes
Like

Posted 20 August 2012 - 04:16 PM

Hello,

I've tested out a scale thats smaller than 1.0f for the first time, and when I do so things won't get rendered. I'm using the lpd3dxsprite-interface. Well, according to the output of Nvidia PerfHUD (see attached screen). When applying a scale like 0.5f, the rendered geometry is reduced to a line oO. So obivously its no mipmapping-issue or anything like that.

Thats how I apply the scale:


void D3DSprite::DrawEx(LPDIRECT3DTEXTURE9 lpTexture, D3DXVECTOR3 vPosition, D3DXVECTOR3 vOrigin, RECT rSourceRect, D3DXVECTOR2 vScale, float fAngle)
{
 //dummy variables to spare constructor calls
 m_vDummyCenter.x = vOrigin.x;
 m_vDummyCenter.y = vOrigin.y;
 m_vDummyScaleCenter.x = vPosition.x;
 m_vDummyScaleCenter.y = vPosition.y;
 //apply transform
 D3DXMatrixTransformation2D(&m_mxTransform,&m_vDummyScaleCenter,0.0f,&vScale,&m_vDummyCenter,fAngle,NULL);
 m_lpD3DSprite->SetTransform(&m_mxTransform);
 //draw the sprite
 m_lpD3DSprite->Draw(lpTexture,&rSourceRect,&vOrigin,&vPosition,D3DCOLOR_ARGB(255, 255, 255, 255));
}

Is there anything obviously wrong with this? Upscaling works fine so I don't see why downscaling shouldn't..

Attached Thumbnails

  • Bug.jpg

Edited by The King2, 20 August 2012 - 04:19 PM.


Sponsor:

#2 Seabolt   Members   -  Reputation: 632

Like
1Likes
Like

Posted 20 August 2012 - 05:26 PM

Try taking this into PIX and see what exactly is happening to the geometry. I see you have a scissor rect enabled, that could be clipping it, or your scale may end up evaluating to 0, or any of those matrices created by the transform could be evaluating to 0.0f. Good luck!
Perception is when one imagination clashes with another

#3 Juliean   GDNet+   -  Reputation: 2246

Like
0Likes
Like

Posted 21 August 2012 - 05:03 AM

Thanks for the hint,

the scaling indeed was 0, I noticed when playing around in PIX and setting both the X and Y scale to 0.5, now there wasn't even a line anymore. I defined the SetScale-method to accept an integer, so no wonder scale was 0.. problem solved :)




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS