• Advertisement
Sign in to follow this  

ID3DXSprite Distorts my Graphics in HAL-Mode!

This topic is 4381 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi! I'm making an isometric game. I'm tiling a bunch of walls to form a room so perfect fit is important. I use the following three rows to turn of the antialias effect: GfxDevice->SetSamplerState(0, D3DSAMP_MINFILTER,D3DTEXF_POINT); GfxDevice->SetSamplerState(0, D3DSAMP_MAGFILTER,D3DTEXF_POINT); GfxDevice->SetSamplerState(0, D3DSAMP_MIPFILTER,D3DTEXF_POINT); Now my graphics gets distorted somehow, just like if the graphics has been rotated a very small angle counter clockwise or something (without antialiasing). Not even perfect vertical lines are rendered currectly. I've tried cutting down my image size to 512x512 and 1024x1024 with no luck. I've loaded my texture with D3DXCreateTextureFromFileEx with D3DX_FILTER_NONE, still no change. However when creating my graphicsdevice as REF instead of HAL I get perfect result. I wish I could show you a screenshot but printscreen doesn't seem to work in fullscreen mode. Distortion is to be expected in windowed mode. REF is of course horribly slow. Has anyone else had this problem? WinXP, DirectX9.0, Geforce3 Here's the code I use for drawing: Sprite->GetTransform(&MatOld); D3DXMatrixIdentity(&MatScale); MatScale._41 = x; MatScale._42 = y; Sprite->SetTransform(&MatScale); Sprite->Draw(Textures[t], &r, NULL, NULL, 0xFFFFFFFF); Sprite->SetTransform(&MatOld);

Share this post


Link to post
Share on other sites
Advertisement
It's 5 a'clock in the morning and I can now update you with the following:

Rendering to a texture and then render the result to the real backbuffer does not help. It makes zooming easy if you can spare the extra cpu load though..

It has something to do with my gfxcard/drive though. Latest driver is installed (Geforce3). Works fine in REF-device but not in HAL. I haven't had the opportunity to test it on another computer.

Share this post


Link to post
Share on other sites
If you want a screenshot in fullscreen, create an offscreen surface with the size of the backbuffer, save front buffer data on it with the device, then save the surface as a file with D3DXSaveTextureToFile.

Share this post


Link to post
Share on other sites
Ok, that was easy, especially since I just tried to fix the problem by rendering to a texture :)

Here are the shots, make sure your browser don't resize the images or anything.

http://it-bubblan.se/junkbilder/screenshots/

One is in HAL-mode and the other is rendered with the desired result in REF.

Share this post


Link to post
Share on other sites
I fixed the problem by accident by forcing the palette format of the texture instead of using a default. Now it looks nice.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement