Search Unity

  1. Check out our Unite Austin 2017 YouTube playlist to catch up on what you missed. More videos coming soon.
    Dismiss Notice
  2. Unity 2017.2 is now released.
    Dismiss Notice
  3. The Unity Gear Store is here to help you look great at your next meetup, user group or conference. With all new Unity apparel, stickers and more!
    Dismiss Notice
  4. Introducing the Unity Essentials Packs! Find out more.
    Dismiss Notice
  5. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice
  6. Unity 2017.3 beta is now available for download.
    Dismiss Notice

See Through - Fade away objects in line of sight

Discussion in 'Assets and Asset Store' started by cygnusprojects, Nov 27, 2015.

  1. cygnusprojects

    cygnusprojects

    Joined:
    Mar 13, 2011
    Posts:
    428
    Don’t miss out on any action as from now on you can always make sure your player character is visible. With the See Through asset from Cygnus Projects it is possible to fade away objects that are in line of sight.

    [​IMG]

    Features:
    • No special shaders and post effect
    • Easy to set up
    • Fully documented source code included
    • Allow linked objects (when only a part of the object is obscuring the sight you can fade away the complete object)
    • Works with any game object including legacy trees and SpeedTrees

    Overview video:



    Screen shots (with included standard assets)
    Even if the player is only behind a part of the column the whole column renders transparant:
    [​IMG]
    and even when the player is behind a second column he's still visible:
    [​IMG]
    Now available on the Asset Store

    Questions? Comments? Feel free to post them here or contact me at support@cygnusprojects.com.
     
  2. Saturn-Ent

    Saturn-Ent

    Joined:
    Jan 25, 2013
    Posts:
    59
    Does this work even when the terrain tree painter have been used? And not placed the tree by hand
     
  3. cygnusprojects

    cygnusprojects

    Joined:
    Mar 13, 2011
    Posts:
    428
    Hi @Saturn-Ent, no I don't support this feature.
    Let me explain: The system always returns the terrain as the object it is hitting. Of course it it possible to get all the trees within that terrain but it has some huge drawbacks:
    1. One has to check all trees on every hit to determine which ones should be faded
    2. The tree prefabs placed on the terrain should all have some sort of collider.
    In my opinion this will make your project slowing down way to much, so it is best to determine the playable area and place fading trees where you know the player can be obscured by it.
     
  4. Saturn-Ent

    Saturn-Ent

    Joined:
    Jan 25, 2013
    Posts:
    59
    Bah, I use top down camera but the trees are in the view often. The terrain is quite big so placing the trees by hand would be a massive task and it would draw down the performance.
     
  5. cygnusprojects

    cygnusprojects

    Joined:
    Mar 13, 2011
    Posts:
    428
    You don't have to place all trees by hand, but yeah if you are building some kind of an open world game you can't predict the paths players will take. Don't see the link why manual placing trees are source of performance though as when you use occlusion culling (specially with a top down camera) trees not visible won't even draw. But yeah, anyway, thanks for the interest in the asset though.
     
  6. Dunfee

    Dunfee

    Joined:
    Jan 14, 2013
    Posts:
    14
    Hey!
    Few questions because this looks like a solution I can use!
    Does the tree need to have a collider on it?
    Is there a way to smooth fade in/out instead of jumping straight to the full transparency?
     
  7. cygnusprojects

    cygnusprojects

    Joined:
    Mar 13, 2011
    Posts:
    428
    Hi @Dunfee, thanks for the interest. To answer your questions:
    - Yes the tree needs to have a collider as the manager component is ray casting towards to player to detect the game objects that need to be faded.
    - Not at the current stage of the product. I'll add this feature request to the list of improvements and see if it's possible to implement it for a next version.
     
  8. Dunfee

    Dunfee

    Joined:
    Jan 14, 2013
    Posts:
    14
    Thanks for the info!
    One last question. Is there a way to keep the shadows the same while fading out the object?
     
  9. cygnusprojects

    cygnusprojects

    Joined:
    Mar 13, 2011
    Posts:
    428
    Not in any way I can think off, as the materials is changed to a transparent alternative the shadows do indeed vanish (which is quite noticeable but not something that can be fixed due to the nature how the system works). While I was typing this I was wondering if baking should make this possible but then you can't use dynamic sky boxes (where the sun or moon is changing positions in game) any longer.
     
  10. Dunfee

    Dunfee

    Joined:
    Jan 14, 2013
    Posts:
    14
    I have a sort of solution to this but it involves having two versions of the same gameobject. One that doesnt cast shadows and another one with its mesh renderer set to "shadows only"

    Not ideal but it seems to be the only way that it will work at the moment
     
  11. cygnusprojects

    cygnusprojects

    Joined:
    Mar 13, 2011
    Posts:
    428
    Hi @Dunfee, that's indeed another way to achieve the desired results. But as you mention, not that ideal as well. I think it will always be a trade-off.