Jump to content
  • Advertisement
Sign in to follow this  
hegel

texture disappear

This topic is 4474 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 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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


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

  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!