Search Unity

  1. The 2022.1 beta is now available for testing. To find out what's new, have a look at our 2022.1 beta blog post.
    Dismiss Notice

Tree leaves are glowing?

Discussion in 'Shaders' started by AgentParsec, Jul 7, 2012.

  1. AgentParsec

    AgentParsec

    Joined:
    May 5, 2012
    Posts:
    393
    Not really sure if this is a shader question or not, but I'm not sure where else this would fit in.

    In my game, it's pitch black and the player has a flashlight (represented by a spot light of course). On the terrain I'm using, if I shine the flashlight anywhere NEAR a tree, the leaves of that tree light up. Here's a picture:



    If I switch the same light over to a point light instead, the leaves render normally (i.e., get brighter as I get the light closer to them). The rest of the tree and any other details I've added (such as grass) are unaffected.

    For reference, I'm using the Tree Creator Leaves Fast shader, but I've tried it with the regular one as well and it seems to do the same thing.
     
  2. AgentParsec

    AgentParsec

    Joined:
    May 5, 2012
    Posts:
    393
    Sorry to bump this, but this still has me stumped (tree pun not intended). Does anyone know how I can fix this?
     
  3. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,670
    I'm not sure exactly what's going on here. Can you explain how your trees are made? Or upload a simple sample package for people to test?
     
  4. AgentParsec

    AgentParsec

    Joined:
    May 5, 2012
    Posts:
    393
    The trees are made using the tree creator, and then used in a terrain.

    The beta of the game is downloadable right now: http://forum.unity3d.com/threads/141488-Slender-Beta-0.9

    Just start up the game and start moving the flashlight around by the trees at the start, and you can easily see the weird problem with the leaves.
     
  5. AgentParsec

    AgentParsec

    Joined:
    May 5, 2012
    Posts:
    393
    Anyone? This has been bothering me for a while now and I would like to know if it's fixable or not.
     
  6. AgentParsec

    AgentParsec

    Joined:
    May 5, 2012
    Posts:
    393
    Sorry to bump this again. I really don't what the deal is. Is this a bug with Unity in general or is there a setting I'm missing here?
     
  7. darky

    darky

    Joined:
    Dec 9, 2010
    Posts:
    180
    I've tried to replicate this. It seems to be related to the Leaves Shader. It happens to me when I use for the Shader "Tree Creator Leaves Fast" for the Leaves so I'm assuming you are using that one. It does not happen when using only "Tree Creator Leaves". So try changing the Shader and make sure to press the "Recompute Tree" button on your Tree Prefabs in order for the change to apply.

    You don't need to fill in the extra texture slots that appear when selecting that Shader. Just keep what you already have.

    I don't know what the difference is exactly between those Shaders (I don't know much about Shaders), but it's probably safe to say the extra light computations and extra-features on this Shader are going to increase the performance demand to some degree. At the very least it will look nicer..
     
  8. AgentParsec

    AgentParsec

    Joined:
    May 5, 2012
    Posts:
    393
    That was it! I had tried to change the leaves to the regular shader and didn't seen an effect, but I was forgetting to hit Recompute Tree. Thanks!
     
unityunity