Forest Kit doesnt apply textures to the tree's - RESOLVED
by Simon Sejer Nielsen · in Torque 3D Professional · 11/25/2009 (10:28 am) · 12 replies
So I went about to try and use the Forest Kit after 1.1 Alpha got out, and since I had bought the Sticks and Twigs pack I thought it to be a good idea to start out with those tree's.
So I got the DAE/DTS file loaded into the forest kit and started to place down tree's when I then realised that the Tree's texture was the No Material texture however the leafs on the tree's had the correct textures.
I then tried to put a static version of the tree in and the texture then showed up correctly.
Not entirely sure if this is a bug or if I have done something wrong - but I tried a few things but none of it diddent really seem to work.
So I got the DAE/DTS file loaded into the forest kit and started to place down tree's when I then realised that the Tree's texture was the No Material texture however the leafs on the tree's had the correct textures.
I then tried to put a static version of the tree in and the texture then showed up correctly.
Not entirely sure if this is a bug or if I have done something wrong - but I tried a few things but none of it diddent really seem to work.
#2
Anyway, I do have material.cs file in the Sticks and Twigs folder which came with the package, not sure if its valid however.
i'll try and have a look at it again and try and have.
UPDATE: Right so I had a look at the material.cs file I tried to copy the content of the file into the Art folders material.cs file, when I did that and opened up the game the leafs were then gone and the tree only had the No Material texture on it.
I then tried to remove the content of the file again saved it, and opened up the game, placed the same tree, and the leafs were back but the tree still had the no material texture on it.
Actully I just had a second look on the material.cs file and it does appear like that the only thing that is in that file is the leafs for the tree's and not the texture for the tree its self.
EDIT: I wanted to post the material.cs code but Apparently its to long not sure if it would had helped in any way - but tell me and i'll try and split up the code for you to have a look at.
11/25/2009 (1:28 pm)
if the material.cs file werent proper, would't the No Material Texture also be showing on the static version ?Anyway, I do have material.cs file in the Sticks and Twigs folder which came with the package, not sure if its valid however.
i'll try and have a look at it again and try and have.
UPDATE: Right so I had a look at the material.cs file I tried to copy the content of the file into the Art folders material.cs file, when I did that and opened up the game the leafs were then gone and the tree only had the No Material texture on it.
I then tried to remove the content of the file again saved it, and opened up the game, placed the same tree, and the leafs were back but the tree still had the no material texture on it.
Actully I just had a second look on the material.cs file and it does appear like that the only thing that is in that file is the leafs for the tree's and not the texture for the tree its self.
EDIT: I wanted to post the material.cs code but Apparently its to long not sure if it would had helped in any way - but tell me and i'll try and split up the code for you to have a look at.
#3
(from the default tree included)
Hope that helps.
11/25/2009 (1:40 pm)
Here's what you need:(from the default tree included)
//--- oak1.dae MATERIALS BEGIN ---
singleton Material(oak1_oak_bark)// trunk
{
diffuseMap[0] = "oak_bark";
mapTo = "oak_bark";
diffuseColor[0] = "1 1 1 1";
specular[0] = "0 0 0 1";
specularPower[0] = 1.07177;
pixelSpecular[0] = false;
emissive[0] = false;
doubleSided = false;
translucent = false;
translucentBlendOp = "None";
};
singleton Material(oak1_oak_branch) // Leaves
{
diffuseMap[0] = "oak_branch";
mapTo = "oak_branch";
diffuseColor[0] = "1 1 1 1";
doubleSided = false;
translucent = true;
translucentZWrite = true;
alphaRef = 120;
};
//--- oak1.dae MATERIALS END ---Hope that helps.
#4
11/25/2009 (1:45 pm)
Just for kicks, have you tried removing the materials.cs and building the materials from scratch in the Material Editor? There have been a few slight changes to the formatting of the materials.cs over the course of T3D's development... I'm just wondering if that might be the problem here. Building the materials in the Materials Editor from scratch would get around any of that and show you how the materials.cs should be formatted. Placing the tree as a static should allow you to view/create/modify all the materials associated with that static shape from the Materials Editor (pull-down menu at the top of the Materials Editor displays all the relevent materials). Save the materials to file, then see if having proper materials helps in the Forest Kit.
#5
11/25/2009 (2:17 pm)
@Russell: I will try that, and will update the thread as soon as ive tried it
#6
Okay I diddent delete the material file yet, however I tried ti import the tree DTS file, when I did that the tree's texture was there but the leafs on the tree looks all wrong compared to when using the foret kit to put it into the world, where if I get the static mesh in, the lefas are all transparent but the tree's other texture is there. i'll just try and delete the material.cs file and see what happens.
EDIT: When I removed the Material.cs file from the folder same thing happens, the tree gets imported into the world with all its textures transparent leafs that gets black when your looking towards the sky with scatter sky on.
EDIT 2: Right okay well that seemed to work. Atleast the tree's texture is showing correctly now. However the transparent leafs which turns black towards the sky is still there so any way to fix that would be greatly appriciated
11/25/2009 (2:49 pm)
Update:Okay I diddent delete the material file yet, however I tried ti import the tree DTS file, when I did that the tree's texture was there but the leafs on the tree looks all wrong compared to when using the foret kit to put it into the world, where if I get the static mesh in, the lefas are all transparent but the tree's other texture is there. i'll just try and delete the material.cs file and see what happens.
EDIT: When I removed the Material.cs file from the folder same thing happens, the tree gets imported into the world with all its textures transparent leafs that gets black when your looking towards the sky with scatter sky on.
EDIT 2: Right okay well that seemed to work. Atleast the tree's texture is showing correctly now. However the transparent leafs which turns black towards the sky is still there so any way to fix that would be greatly appriciated
#7
11/25/2009 (3:52 pm)
alphaRef = 120; seems to fix the black leaves problem. (at least it did for me)
#8
What Russell told me with trying to make a static version of the tree first and then applying all the texture maps helped... To avoid this issue with the leafs getting black and all I'd just had to move the material file back into the Forest folder, then making a static version of the tree, go into the material editor, put on the maps, save it, go back into the forest editor tool and Voila, The tree has both leafs that arent transparent, not turning balck when faced towards the sky, and textures on the tree its self !
Thanks :) !
11/25/2009 (4:56 pm)
Awesome ! Thanks guys...What Russell told me with trying to make a static version of the tree first and then applying all the texture maps helped... To avoid this issue with the leafs getting black and all I'd just had to move the material file back into the Forest folder, then making a static version of the tree, go into the material editor, put on the maps, save it, go back into the forest editor tool and Voila, The tree has both leafs that arent transparent, not turning balck when faced towards the sky, and textures on the tree its self !
Thanks :) !
#9
11/29/2009 (3:08 am)
Oddly enough, I got the weird alpha issue but after I exited the world editor, played the game and altered my video settings in-game to turn HDR, Post Effects and SSAA on and off again then exited the game and returned to the world editor - all was fixed.... I have no idea what happened.
#10
12/01/2009 (3:35 pm)
I am also using The Sticks and Twigs models. I had exactly this same problem. Richard's solution, ie twiddling the video settings on and off, solved it. That was certainly much easier than playing around with the material.cs file, but I leave the problem of *why* this cured the problem to those more knowledgable than myself. Thanks so much everyone for this post, saved me a lot of trouble.
#11
06/13/2010 (6:44 pm)
Logged as TQA-359.
#12
08/02/2010 (5:10 pm)
Fixed in 1.1 Beta 2
Associate Russell Fincher
Sickhead Games
I'm excited to see this pack used with the Forest Kit. :)