Jump to content
  • Advertisement
Sign in to follow this  
inkcomic

Any one CanHelp me

This topic is 4782 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 a question: how can i,get mutitexture info from .x file,i want to get specular tex filepath to blend.how to do it~? forgive my pool english : (

Share this post


Link to post
Share on other sites
Advertisement
You are going to have to set up your material information in your model editor so that it will export all of your textures (ie the diffuse texture, specular texture, ect...). Doing things like this with X can be tricky, so you are going to have to work around it.

The easiest approach would be to make a simple file separate from your X file, describing its material properties (since X's material info is somewhat lacking). Something like this maybe:

(X Material Description File)
DIFFUSE_TEXTURE: myDiffuseTexture.tga
SPECULAR_TEXTURE: mySpecularTexture.tga
AMBIENT_COLOR: (255,255,255,255)
CONSTANT_VALUE1: 15
CONSTANT_VALUE2: 0.5023

I have done this in the past, and it worked pretty well for me.

Share this post


Link to post
Share on other sites
Another, very hacky way of doing this, would be to adopt a naming convention in your application. Many of the SDK samples do this.

Say you call your original diffuse texture "house.bmp". You could adopt the convention that the name of the specular map to go along with this texture would just append "_specular" to the end. So the file name would be "house_specular.bmp". You could have "house_bumpmap.bmp", and so on. So the texture name you read from your .x model would just have different tags appended to the end to signify different textures.

Granted, this is not very flexible at all but if you're just doing a small applicaiton for your own purposes, it will work just fine.

neneboricua

Share this post


Link to post
Share on other sites
Quote:
Original post by circlesoft
You are going to have to set up your material information in your model editor so that it will export all of your textures (ie the diffuse texture, specular texture, ect...). Doing things like this with X can be tricky, so you are going to have to work around it.

The easiest approach would be to make a simple file separate from your X file, describing its material properties (since X's material info is somewhat lacking). Something like this maybe:

(X Material Description File)
DIFFUSE_TEXTURE: myDiffuseTexture.tga
SPECULAR_TEXTURE: mySpecularTexture.tga
AMBIENT_COLOR: (255,255,255,255)
CONSTANT_VALUE1: 15
CONSTANT_VALUE2: 0.5023

I have done this in the past, and it worked pretty well for me.


circlesoft : )
thanks ~,your means i must write a exporter to exporter the .x file and a (X Material Description File)?
i exporter the model from max by panda~

Share this post


Link to post
Share on other sites
Quote:
Original post by neneboricua19
Another, very hacky way of doing this, would be to adopt a naming convention in your application. Many of the SDK samples do this.

Say you call your original diffuse texture "house.bmp". You could adopt the convention that the name of the specular map to go along with this texture would just append "_specular" to the end. So the file name would be "house_specular.bmp". You could have "house_bumpmap.bmp", and so on. So the texture name you read from your .x model would just have different tags appended to the end to signify different textures.

Granted, this is not very flexible at all but if you're just doing a small applicaiton for your own purposes, it will work just fine.

neneboricua

thanks neneboricua19 too,: )
very tricky way : p ,i will try this ,
because i don't want to write a plugin at present :p~
by the way, i'm a chinese beginner ,and have pool english .so don't laught at my
solecism~ : p.

Share this post


Link to post
Share on other sites
Quote:
Original post by inkcomic
circlesoft : )
thanks ~,your means i must write a exporter to exporter the .x file and a (X Material Description File)?
i exporter the model from max by panda~

Actually, I just write it out by hand. When I was doing things like that, I didn't have a lot of art content, so when I wanted to use a model, I would just write up a new text file like that. It's a simple solution, but it worked (and it let me store a lot of extra data that Max didn't take care of).

Nene's way works quite well too, I recommend that if you only need to texture semantic + filename stuff.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Quote:
Original post by circlesoft
Quote:
Original post by inkcomic
circlesoft : )
thanks ~,your means i must write a exporter to exporter the .x file and a (X Material Description File)?
i exporter the model from max by panda~

Actually, I just write it out by hand. When I was doing things like that, I didn't have a lot of art content, so when I wanted to use a model, I would just write up a new text file like that. It's a simple solution, but it worked (and it let me store a lot of extra data that Max didn't take care of).

Nene's way works quite well too, I recommend that if you only need to texture semantic + filename stuff.


i want to bind item model to a animation model ,do you know how can i do from .x?

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!