- Home /
Black trees barks?
Hi! I've got a terrain with some trees on it. There's no problem but when I Bake the scene the trees barks are very dark. When I clear the lightmaps, they are still dark. Please help.
[EDIT] I can use lights to illuminate barks.
Please help! I don't believe there're no ideas to fix my problem!
$$anonymous$$aybe it's because of your scene Ambient light...by default it's greyish. You can view that in Edit/Render Settings
Are they marked static? and in the lightmap settings, what do they display? It could be about setting up the advanced, generate lightmap UV settings in the objects mesh data
Thank you for help... The way to solve problem is set ambient light to light grey.
Answer by team_eden · Dec 12, 2014 at 12:51 AM
TreeInstance contains a variable called 'lightmap' which is a type Color. Set this to something like Color(0.5,0.5,0.5,1.0);
Works now. And this answer trumps all others I have found up til now. My terrain trees are also generated by code, this was all I needed.
function genTrees()
{ for (var c=0; c<4; c++)
{ var tempTreeInstances:TreeInstance[] = new TreeInstance[100];
var tempTerrain:Terrain =grid[c].GetComponent(Terrain);
for(var d=0; d<tempTreeInstances.length; d++)
{ tempTreeInstances[d].position=Vector3(0,0,0);
tempTreeInstances[d].prototypeIndex=Random.Range(0,4);
tempTreeInstances[d].color=Color(0.5,0.5,0.5,1.0);
tempTreeInstances[d].lightmapColor=Color(0.5,0.5,0.5,1.0);
}
//Refresh
tempTerrain.terrainData.treeInstances=tempTreeInstances;
tempTerrain.terrainData.SetHeights(0, 0, tempTerrain.terrainData.GetHeights(0,0,1,1));}}
Enjoy!
This is another ANSWER to this problem, as simply changing the ambient light did NOT work in my instance. I had to set the LIGHT$$anonymous$$AP property of the TreeInstance.
If anyone else does not accept the first answer, please check $$anonymous$$e atleast once.
These issues also have identical symptoms, so it is basically two flavors of the same problem
Your answer
Follow this Question
Related Questions
Tree brush making very tiny trees 0 Answers
Initial rotation of trees with a script 1 Answer
My trees have their collider misplaced 0 Answers
whats a good size for a standard terrain? Details, grass, trees disappear when zoomed out editing. 1 Answer
how to add collider to trees made with terrain tool? 1 Answer