Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

arunvb

Texture Mapping Help wanted urgently

This topic is 6938 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

I have loaded a 3D terrain from a .x file using D3D. I have a texture map associated with and hence I have created a texture surface in 32 bit format ( I am using 32 bit mode ). I have the dimensions for the texture file as 1024 * 1024 (while the actual size of texture image is 800 * 600. I did this because I read that textures do no normally render if the dimensions are not to the power of 2). And before begin scene I am calling the SetTexture function - lpD3DDevice->SetTexture(0, CountyTexture); The problem is the model gets loading and rendered to the screen but the texture does not show up. I am been struggling with this for the entire day. Can anyone help me on this and let me know what could be the possible problems. Thanks in Advance Arun

Share this post


Link to post
Share on other sites
Advertisement
Hello again,

There are lots of reasons why this may be happening, but here are just a couple...

Try checking if the texture is lost, then restore it, before the start of the scene..

if (lpCountyTexture->IsLost()==DDERR_SURFACELOST)
lpCountyTexture->Restore();

How does your texture loading routine work? It may be worth re-saving the texture in 16bit, then opening up a 16bit mode..

The texture may be just too big. I read somewhere Voodoo cards don''t like textures over 256x256 (that was old info though, so it prolly won''t apply to VoodooII?) Try scaling the texture down to 256x256 in your paint program.

How have you generated the x file? If you''ve used the Conv3ds utility, try using the -x -m switches.

Anyway, try all of the above and every possible permuatation

Bye

Matt



Check out my project at: www.btinternet.com/~Matthew.Bennett

Share this post


Link to post
Share on other sites
Hi there. Here is a list of reasons why D3D fails to render a texture:

1) Texture dimensions are too big.
Check the D3DDEVICEDESC7.dwMaxTextureWidth and the D3DDEVICEDESC7.dwMaxTextureHeight

2) Unsupported texture format. The only way to find out if the driver supports the format you are trying to create, is to enumerate all the texture formats with the IDirect3DDevice7->EnumTextureFormats method.

One of those is probably the problem.

take care

Share this post


Link to post
Share on other sites
Thanks for the help guys.

I finally got the Texture loaded. The problem was that since I was using CD3DFile, the SetTexture, which I call is getting nullified by a call to SetTexture inside the Render function of CD3DFile object.

Thanks
Arun

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!