PDA

View Full Version : Direct3D Texture problem



technomage
05-03-2007, 11:25 PM
I was wondering if anyone had seen this problem before.

Here are tow screenshots. The first is the Opengl Version of the renderer working, the second is the direct 3D verison.

http://www.infinitespace-online.net/images/screenshots/InfinitEngineOpengl3.png
http://www.infinitespace-online.net/images/screenshots/InfinitEngineDirectX3.png

I have checked the texture after it is loaded and saved it using D3DXSaveTextureToFile and the texture looks fine. So I can only assume it's something to do with the direct3Ddevice setup.

Any tips or hints on setting up the device :?:

The weird thing is that the Logo in the bottom right is also a texture and that works fine :?: :?:

Clootie
06-03-2007, 12:45 AM
Looks like a problem with texture atlas (if you use it). Can you disable mip-mapping in D3D?

Huehnerschaender
06-03-2007, 05:39 AM
Wasn't there something like bottom up / top down problem in texture positioning when converting from OpenGL to DirectX?

Have you tried to mirror the texture vertically and look at the result?

Dan
06-03-2007, 09:38 AM
Looks like mip filter is enabled but mip maps have not been generated...

technomage
06-03-2007, 12:28 PM
Thanks for all the tips people.

I am calling


FTexture.GenerateMipSubLevels;


So how do you turn on/off MipMap Filtering?

chronozphere
06-03-2007, 06:19 PM
I think you need to call fD3DDevice.SetRenderState like this:


//set Mipmap filtering type (you can also specify D3DTEXF_NONE).
SetTextureStageState(0, D3DTSS_MIPFILTER, D3DTEXF_LINEAR);


This works for DX8. I've looked it up and it seems that DX9 is different at this point. :?

http://msdn2.microsoft.com/en-us/library/bb172617.aspx

D3DTSS_MIPFILTER isn't present in D3DTEXTURESTAGESTATE struct.

Dan
06-03-2007, 07:52 PM
Device.SetSamplerState(0, D3DSAMP_MIPFILTER, D3DTEXF_LINEAR);

technomage
06-03-2007, 08:54 PM
Well

I removed the


FTexture.GenerateMipSubLevels;


and it now works :)

So the next thing is to get the MipMapping working correctly :)