Hi all
I'm trying to load object files from Xfrog - all goes well until I look for the texture files. The mtl file does not seem to load with the object a shader is allocated but it is empty - do I have to manually load each texture image and alpha?
Mick
I haven't worked with a straight xFrog file to any major degree, but I know with even Wavefront OBJ files I needed to rearrange the MTL and the Multishader to make it work right.
I'm expecting to have to directly edit the multishader but it looks like I'm going to have to load in each image and alpha file by hand after analysing the MTL file. I had hope that at least the data would be read from the mtl file and loaded automatically.
I haven't seen that it's all automated. Something going on, but it appears to me to be out of order.
OK
Could some post a file that works so that I can play?
Mick
Mick,
I don't have access to anything right now, but maybe this weekend I'll find time to put something together for you on this site - http://forums.planetside.co.uk/index.php?board=14.0
I need to be careful, since I won't give any objects that I had to pay for, due to copyright limits.
Just thought that I would throw in my two cents here. :P
It seems to me that if the mtl file is set up right everything should load right. -I haven't fully tested this yet
However, if you have to manually set up the textures like you have mentioned, be sure to export the model to .tgo and you won't need to do it over using the new file.
note: this will also work with objs that don't have a mtl file. if you have the original textures just manually add a default shader to the multi shader of the object. Do this for each texture you have, adding the texture as the color image or alpha where appropriate. If you are able (obj are not very stable in TG2tp) be sure to do a render to make sure you got the textures into the right shader slot. other wise export to tgo and then render to see if the tex. are right.
This is a very basic explanation and I'm sure I confused a few people there but perhaps it might help somebody ;D
Thanks calico any of the free xfrog files will do
Thaks all for all the tips but it seems that the mtl file only contains colour definitions so maybe I'm using the wrong xfrog models! I'll try again tomorrow
Mick
There are currently problems with certain OBJ files in particular, notably the free XFrog models that are available. We're improving the OBJ loading and rendering behavior for an upcoming patch.
In general if the .mtl file is setup correctly it should indeed load properly and shouldn't require manual texture loading. It may be that pathing issues are getting in the way though. The easiest approach currently is to keep all objects and textures in the folder that your .tgd is saved in. If that is already the case then you may simply need to edit the paths in the .mtl to be local rather than absolute.
- Oshyan
The problem turned out to be the paths. So thanks everyone for your help.
So far so good...
How do I LOAD a mtl-file?
How can I correct the data there?
Sorry, just don´t have a clue at the moment.....
.mtl files are loaded automatically in TG2 if they are associated with a given object. This association happens on export to the OBJ format from an application which supports writing texture information to an .mtl.
To edit a .mtl manually use a general text editor such as Notepad (in Windows), go to Open a file, select "All Files" from the format drop-down, then navigate to the location of your .mtl and open it. Be sure to save under "All Files" when you're done editing rather than ".txt", or rename to .mtl after you save if it changes it to .txt.
- Oshyan
thanks a bunch Oshyan!!!!!!!!!!!!!!!!!!!!
I´ll try to do that as soon as I´m home....hopefully I can solve my problems with the tree obj in terragen.
I´m very close to get a wonderful tree from the old xfrog material. Like suggested in this forum I edited it with 3dwings so I was able to import it into terragen, but what annoys me still, is that the leaves and the trunk doesn´t look much realistic. Think there are still some mistakes in my multishader options as well as in the right picture association in the color tab and the opacity tab...will play around a bit with it.....
Maybe the mtl-file can solve some of my problems....
Thanks!
daphne
Quote from: Oshyan on February 14, 2007, 02:56:24 AM
.mtl files are loaded automatically in TG2 if they are associated with a given object. This association happens on export to the OBJ format from an application which supports writing texture information to an .mtl.
To edit a .mtl manually use a general text editor such as Notepad (in Windows), go to Open a file, select "All Files" from the format drop-down, then navigate to the location of your .mtl and open it. Be sure to save under "All Files" when you're done editing rather than ".txt", or rename to .mtl after you save if it changes it to .txt.
- Oshyan
Does anyone out there know if there is any set order to load textures in the multishader in relation to what order they are listed in the mtl file ??? I have tried rearranging items orders in the multishader till I'm blue in the face and always end up with textures on the wrong part of the model.
Quote from: Aenea on February 14, 2007, 04:36:55 AM
thanks a bunch Oshyan!!!!!!!!!!!!!!!!!!!!
I´ll try to do that as soon as I´m home....hopefully I can solve my problems with the tree obj in terragen.
I´m very close to get a wonderful tree from the old xfrog material. Like suggested in this forum I edited it with 3dwings so I was able to import it into terragen, but what annoys me still, is that the leaves and the trunk doesn´t look much realistic. Think there are still some mistakes in my multishader options as well as in the right picture association in the color tab and the opacity tab...will play around a bit with it.....
Maybe the mtl-file can solve some of my problems....
Thanks!
daphne
Did you try my tutorial? http://forums.planetside.co.uk/index.php?topic=575.msg4880#msg4880
The old Xfrog plants did not have the right image for opacity and you need to make one.
Helen
Ahhhhhhhh....that´s the point...so you cannot use the image maps coming with the old obj????
I just posted this in another thread:
QuoteHi there!
I also tried several things with the old xfrog obj. And I also used your tut Helen, but I wasn´t 100% successful. Just let me tell you what I did...
I imported the purple leaved plum (prunus cersifera nigra) obj into wings3d.
Then I followed the instructions in the tutorial.
I selected the trunk, the leaves, and strangely you were able to select two different types of branches too.
I saved them as new material and assigned a color.
Then I saved everything as new obj.
I got the obj and the mtl file and tried to import it into Terragen, what worked without problems.
I figured out that the mtl-file hadn´t the textures included, meaning, the saved images of trunk and leaves. I changed the png and rgb files into jpg files and put them into the same folder as the obj and mtl file. After I added the location of the image-files to the mtl-file, they all loaded in Terragen without problems, I found them all in the multishader.
So far so good.
I got a tree after the first render, but what I got wasn´t much satisfying. Somehow the leaves were green, they should be plum-colored like the image file of the leaves. Well, as well I couldn´t see any leaf-texture on the leaves. They were leave-shaped but had a bright-green colour - and now comes the clou. In the middle of the bright-green shapes leaves, there are smaller, dark-green leaves with texture.... At least there is some texture, but again in the wrong colour...and why do they have this strange bright-green border (also leaf-shaped, but no text). It´a real riddle to me. Whatever I did with the image files, and the alhpa-image files...nothing seem to work.
The trunk as well is very square-cut and there´s also not the right texture on it.
I don´t have any clue where the problem is....maybe someone has some idea what else I can try to get a natural looking tree?
Maybe I did something wrong in the wings3d program? I´m not sure...cause when I added the colour in the program it seemed to keep exact this colour in Terragen...and I wasn´t able to change that (as pointed out above).
Maybe, when I´m home, I can add a picture so you can see more clearly what I was referring to...it´s always difficult to describe such things....a picture often says more than thousand words.
Maybe you have to add the right textures in 3dwings?
And what else wondered me a bit, when I changed the images, first the png: I followed again the instructions and in the end the leaf was white (only the shape remained) and then the background was all black. I saved it as jpg and was done. With the rgb file it was more difficult, because there wasn´t only the leaf, there was some strange texture in the background. I considered that to be the alpha-channel picture, cause when I finally succeeded in changing it the same way like the png, and wanted to save it as jpg, the program said that with saving the alpha-channel will be lost.
I also saved the original pictures as jpg and with the rgb it was again the same: the alpha-channel will be lost.
So I´m not sure if this has something to do with it. Any suggestions about that?
Hell, I hope I´m someday able to get these things right.....
Thanks in advance for ANY help on that...I´m really at a loss at the moment....
So is there any way to make them look more realistic instead of only colouring them new???
Aenea
Quote from: mr-miley on February 14, 2007, 03:32:48 PM
Does anyone out there know if there is any set order to load textures in the multishader in relation to what order they are listed in the mtl file ??? I have tried rearranging items orders in the multishader till I'm blue in the face and always end up with textures on the wrong part of the model.
As far as I know the order of the textures is determined by the obj file -whatever is mentioned first will be the first in Teragen. You can open an obj file in a text editor to determine this (preferably something that can handle very large files like wordpad) however locating your texture instances in the file can be painful :)
I'm just guessing at this so don't quote me :P
Ta for that §ardine. This is what I had presumed. I'll have to go away and beat som mtl files with a big stick to see if I can get them to work :)
as I alread pointed out in the tgo plant thread....
I have the order of the mtl files correct now.....but the textures won´t work...
it´s really strange....
Aenea
Go through the multishader one texture at at time and make sure that the path to each texture is correct. I bet they aren't.
How do you mean that moodflow?
In the multishader I have the single parts of the tree: leaves, bark
Then I click '...' leaves
In the color tab I put in the leaf.tif (or jpg)
(the real picture), and in opacity the leaf_a.tif (black white alpha channel).
But I never get the right textures.
Oh, use alpha channel is checked.
Aenea
I'm not moodflow, but I'll try to answer.
In the Default Shader or ImageMap Shader (Default shader is best so you can use displacement maps) inside of the Multishader, make sure the image is selected by browsing for it. Then, check to see if you have the Projection Type set where you want it, which I think will probably be Through Camera. On the images I've used, I don't mess with the Alphas (usually), so that should keep you pretty plain and not fancy. Nevertheless, the key (after ordering the MTL) is to get the textures in the right order in the Multishader as in the MTL and make sure you can see the Multishader's individual textures.
For images in the Default Shader, choose a color image and set your Diffuse to 1. Do the same in Luminosity (at the bottom of the same page) and start with a 1 value there. Once this is done, go to the Displacement tab, choose a BUMP image and set the Displacement multiplier for a .05 to begin. Play with these values until you see them like you want in the preview window and, of course, for your final render.
Hope this helps and is not redundant information for you.
Thanks for all the help - especially to Helen!
The trees work now, just a little color problem, but I think this will be fixed soon too (hope so).
I think I will wirte a tutorial about that.
The info why it hadn´t worked in my case:
my transparency was at 50%, I checked "use alpha channel" in the opacity tab, but I used a jpg and jpg´s don´t have an alpha channel...so if you use jpg - don´t check the "use alpha channel" box!
Be back with a tutorial asap.
Thanks again for your help!
Aenea
Quote from: calico on February 16, 2007, 10:31:20 AM
I'm not moodflow, but I'll try to answer.
In the Default Shader or ImageMap Shader (Default shader is best so you can use displacement maps) inside of the Multishader, make sure the image is selected by browsing for it. Then, check to see if you have the Projection Type set where you want it, which I think will probably be Through Camera.
Actually "through camera" will cause unexpected results since the texture will literally be projected through the current camera view. What you want is "Object UV (if available)". This will properly respect the UV maps previously created and put the textures into the correct positions.
- Oshyan