New to D3D - Textures not visible!?

Started by
15 comments, last by TheAdmiral 17 years, 6 months ago
Quote:Original post by Namethatnobodyelsetook
Quote:Original post by Wixner
pDevice->SetFVF( D3DFVF_XYZ | D3DFVF_TEX0 ) might help?
Using D3DFVF_TEX1 might help even more. ;)


O RLY? :p

pDevice->SetFVF( D3DFVF_XYZ | D3DFVF_TEX1);
might do the trick, unless you're using IDirect3DVertexDeclaration9's

Edit:
I typo'd again :)
Advertisement
Actually I call SetFVF! (Using the structure seen in my first code segment).
So this can't be the problem either...
Does the Direct3D Debug Runtime spew some debug information? Assuming you're using Visual Studio, you can take a look here http://nexe.gamedev.net/directKnowledge/default.asp?p=Debugging about Direct3D Debugging
Have you set D3DRS_WRAP0 to anything other than 0? It's an odd form of wrapping, not what you usually associate with texture wrapping. Enabling it could cause you to only get a single texel of your texture.

Is D3DTSS_TEXCOORDINDEX on stage 0 set to 0? It should be.

edit: Is fogging turned off (D3DRS_FOGENABLE, false)?

[Edited by - Namethatnobodyelsetook on October 24, 2006 9:04:20 AM]
Are you absolutely sure the image file loaded to the texture (assuming this is what you do) is in the right directory. Execution directories can be pretty unintuitive, especially in VS2005. To make sure, put your executable file in the same directory as you image file and run from explorer. This error usually gives white textures, but your error handling should have caught it.

//Emil
Emil Jonssonvild
Yep, like the last poster I think you should verify the image loading process somehow... are you sure your BMP file is standard and is in memory? Maybe try another file format, etc. just for kicks; I've seen stranger things...
So it appears all the steps are present. The next goal is to ensure they are all correct. Check the return value of every relevant function. One of them will probably return a failure. My money, like the previous posters', is on the D3DXCreateTextureFromFileExA, if that's what you're using.

Regards
Admiral
Ring3 Circus - Diary of a programmer, journal of a hacker.

This topic is closed to new replies.

Advertisement