texture disappear

Started by
11 comments, last by hegel 18 years ago
I write a directx viewer of my own, it can load .x files but the objects shown in it don't have any texture. The .x files are exported from Maya. The confusing point is that my viewer can show .x files exported from 3dMax well. Anybody meet the same problem? BTW, I don't use sas in my application.
Advertisement
hi,

you stated your problem, but didn't provide any detail / source code so that anybody could solve it. having this question I can just guess (are the textures loaded correctly? check HRESULTS, are the textures assigned to the appropriate sampler? does the textures have correct mip levels - if they are DDSs? are your UVs ok?)
first, you should check the X file (in text format) by hand, and have a look at the texture references.

kp
------------------------------------------------------------Neo, the Matrix should be 16-byte aligned for better performance!
the HRESULT is fail for loading texture, which means texture loading fails.
the teturefiles are .jpg.
The code doesn't work with .x files exported from Maya only. This is the confusing point.
You are indeed providing way too little information for anyone to be able to assists you in this matter.

How are you retrieving texture filename information from the x file?
Are the filenames valid (correct path etc) ?
Are the textures being loaded correctly?
Are the textures being set correctly when rendering?

There are many different possibilites to what might be causing your problem.
So post some source code, show us your loading code so that we can examine if you are loading the textures correctly, and your rendering code so that we can examine whether or not you are setting the textures correctly when you are rendering the mesh.

Hope this helps

Regards,
/Omid
Best regards, Omid
Quote:Original post by hegel
the HRESULT is fail for loading texture, which means texture loading fails.
the teturefiles are .jpg.
The code doesn't work with .x files exported from Maya only. This is the confusing point.


Debug and see what file it's trying to load. My guess is that you the paths are not entirely correct. That would also explain why maya wouldn't work but 3dsmax would, since 3dsmax is probably exporting the full path name to the file whilst maya is only exporting the filename, or some relative path.

Hope this helps

Regards,
/Omid
Best regards, Omid
Quote:Original post by hegel
the HRESULT is fail for loading texture, which means texture loading fails.
the teturefiles are .jpg.
The code doesn't work with .x files exported from Maya only. This is the confusing point.
If texture loading fails, then chack the filename that you pass to the texture loading function (D3DXCreateTextureFromFile()?), and check is the texture file itself isn't corrupted. Then check any other parameters you possibly send to texture loading.

kp
------------------------------------------------------------Neo, the Matrix should be 16-byte aligned for better performance!
I ported Keith Ditchburn's x file loading program. You can download his source code in http://www.toymaker.info/Games/XFileLoadingCode.zip. His viewer got the same problem. Fro maya .x file, the display of textures and sometimes animations will get some problem.
I've check the texture filename in .x files exported both from maya and 3dx. They are the same.
But the frame formats are a little bit different. Is that the problem?
Have you tried using the debug runtimes? The D3DX functions are pretty good at outputting a better reason (e.g. that it can't find the file, or the dimensions are invalid).

Also, have you tried using dxviewer.exe? If that has the same problems then you might have found an issue with how Maya exports it's files - however, if that tool displays them fine then it's much more likely that your code is the problem [oh]

hth
Jack

<hr align="left" width="25%" />
Jack Hoxley <small>[</small><small> Forum FAQ | Revised FAQ | MVP Profile | Developer Journal ]</small>

DxViewer is fine. But DxViewer using DXUT and SAS. It seems that the fixed-function pipeline of DirectX used in my program can't work with .x file format exported from Maya.

This topic is closed to new replies.

Advertisement