Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

how do I modify a unity tree shader?

Discussion in 'Shaders' started by stiltskin, Oct 12, 2013.

  1. stiltskin

    stiltskin

    Joined:
    Feb 27, 2010
    Posts:
    93
    I would like to add something to the tree leaf and bark shaders that are created by unity trees - TreeCreatorLeavesFastOptimized TreeCreatorBarkOptimized.

    I downloaded the latest built-in shaders zip available on the unity site, but as soon as I place those two shaders in my project, I get tons of errors. Has anyone has any success doing this?

    thanks!
     
    Claytonious likes this.
  2. stiltskin

    stiltskin

    Joined:
    Feb 27, 2010
    Posts:
    93
    ok, I got the shaders to not cause errors. I needed to inclue the Tree.cginc and TreeVertexLit.cginc files as well. But for some reason my shaders on the trees don't update when with the changes I've made to the downloaded one.

    Has anyone run into this issue?
     
    Claytonious likes this.
  3. Lulucifer

    Lulucifer

    Joined:
    Jul 8, 2012
    Posts:
    358
    As far as i know,unity will render trees as 2D billboard if it is far from camera,on that case, it will check if there is custom shader named as BillboardTree
     
  4. stiltskin

    stiltskin

    Joined:
    Feb 27, 2010
    Posts:
    93
    Thanks for the idea, but it doesn't seem to be doing anything at all. Either way, I need to modify the trees in their normal state, not the billboard state.

    I did what little info I can find on it says - import the "built-in" version of the shader that you can download from the site and the engine should automatically replace it.

    This does not seem to be the case.
     
    Claytonious likes this.
  5. Riftstalker

    Riftstalker

    Joined:
    Oct 17, 2013
    Posts:
    3
    Did you have any luck with tree shaders? I've stumbled upon same problem, guess it is possible to make totally new custom shader which will make use of the "Amb. Occlusion" property.

    You can make a tree prefab and assign any shader you want.
     
unityunity