Search Unity

See-Through System - shader-independent visibility obstruction handling

Discussion in 'Assets and Asset Store' started by CatsPawGames, Nov 6, 2014.

  1. CatsPawGames

    CatsPawGames

    Joined:
    Jun 4, 2014
    Posts:
    443
    Full changelog for version 1.6 (currently pending review by Asset Store team):
    - complete overhaul of mask generating and composition algorithms
    - removed RenderTexture restore operation (performance boost on mobiles)
    - improved compatibility with Unity 5 and Android combination
    - improved 1-pass blur looks (range blur - added outline smoothing)
    - improved depth sensitivity consistency
    - added colored holograms support
    - added transparency masks support for obstacles
    - added multi-camera rendering support
    - added mask and background downsampling options

    Also, you can read updated manual to see how to use new functions .
     
  2. CatsPawGames

    CatsPawGames

    Joined:
    Jun 4, 2014
    Posts:
    443
    hopeful likes this.
  3. CatsPawGames

    CatsPawGames

    Joined:
    Jun 4, 2014
    Posts:
    443
    If you use orthographic camera in version 1.6 of See-through system, you might have encountered a bug with STS incorrectly triggering - it was caused by different format of depth buffer for orthographic cameras.

    Version 1.6b with bugfix for that will be available on Asset Store during next week, or you can send me PM or email with your invoice # for updated version if you don't want to wait.
     
  4. Nadan

    Nadan

    Joined:
    Jan 20, 2013
    Posts:
    341
    I quess that this now works with Unity 5 free version?
     
  5. CatsPawGames

    CatsPawGames

    Joined:
    Jun 4, 2014
    Posts:
    443
    Yes, of course. If you're using Unity 5, both personal and pro editions are fine.
     
  6. Turnspender

    Turnspender

    Joined:
    Jun 27, 2013
    Posts:
    16
    Hello, I bought this for my project and this is working fine... except when I'm using the orthographic camera mode.
    When in the orthographic mode, Trigger models will trigger even if they are front of Obstacle models.

    Would you please address the issue?

    This is captured in the Demo (something is wrong with robot model by the way, but that's not point here)
    c1.PNG

    And this is how it happened in my project.
    c2.PNG
     
  7. CatsPawGames

    CatsPawGames

    Joined:
    Jun 4, 2014
    Posts:
    443
    Hello, as mentioned earlier in this thread, I'm aware of this issue and there's a hotfix available, please send me email and I'll reply with updated version. I'll also upload fixed version to asset store today, but review process always take some time.
     
  8. Turnspender

    Turnspender

    Joined:
    Jun 27, 2013
    Posts:
    16
    I'm terribly sorry, I should've done better than (or at) just skimming through. And thanks for the fix

    By the way, I'm not really in hurry, so I'll just wait for update on the store. Don't mind me.
     
  9. CatsPawGames

    CatsPawGames

    Joined:
    Jun 4, 2014
    Posts:
    443
    Version 1.6b is approved by and avaliable on Asset Store
     
  10. Deleted User

    Deleted User

    Guest

    Hi! The system is cool. Can you add a setting to disable lights and shadows on the secondary cameras? Thanks!
     
  11. CatsPawGames

    CatsPawGames

    Joined:
    Jun 4, 2014
    Posts:
    443
    Hello and thank you.

    Of course, I'll add that to future features. Shadows will be easy, lights will be a little trickier - you'll probably would have to manually designate lights that needs to be disabled.
     
  12. Deleted User

    Deleted User

    Guest

    Thanks, even without shadows it would be much better. Do you have an ETA?
     
  13. CatsPawGames

    CatsPawGames

    Joined:
    Jun 4, 2014
    Posts:
    443
    ETA is about a week from now on.
     
  14. CatsPawGames

    CatsPawGames

    Joined:
    Jun 4, 2014
    Posts:
    443
    Danirey likes this.
  15. Danirey

    Danirey

    Joined:
    Apr 3, 2013
    Posts:
    548
    One more customer here! ;)

    Good job!
     
  16. BindingForceDev

    BindingForceDev

    Joined:
    Aug 13, 2014
    Posts:
    40
    I'm unfortunately having some trouble using this with 2D in Unity 5, but I can't wait to get this working! The script does cut out where my triggers are, however, it does not shape the cutout to fit my sprite. My sprite is using the standard shader. Here are some screen shots showing how everything is being masked.
    When I use the Sprites-Default shader, I am able to get the correct outline, as you can see in the second screen shot. I have adjusted the rendering modes but can't get the standard shader to work like the default sprite one. This is big for me as I really want to normal map my sprites and the standard shader makes this pretty easy. The protrusion in the first shot is my player's weapon, rendered as a default sprite, so that is why it is working while the body appears to be using the border of the body as if I used cutout render mode and set the transparency threshold too low. Anyway, any thoughts would be really appreciated! Thanks for putting out such an amazing asset :)
     

    Attached Files:

  17. CatsPawGames

    CatsPawGames

    Joined:
    Jun 4, 2014
    Posts:
    443
    Try turning "check render types" on - this option was created specifically for sprites. If this doesn't help, please send me a test scene with problem present to leonidmv@gmail.com.
     
  18. Duende

    Duende

    Joined:
    Oct 11, 2014
    Posts:
    200
    In the demo of the robot you do not use shadows.

    When a character is behind an object that throws shadow, the transparent area respects the shadow of the object throws in the ground?
     
  19. CatsPawGames

    CatsPawGames

    Joined:
    Jun 4, 2014
    Posts:
    443
    Transparent area will not show shadows of obstacles since they're not rendered in background pass (shadows of other objects will be shown as usual).
     
  20. Al-

    Al-

    Joined:
    Jun 5, 2015
    Posts:
    26
    2D Demo is working properly but I don't get work 3D Demo using Unity Personal 64 bits v 5.0.1f1. Thanks
     
  21. CatsPawGames

    CatsPawGames

    Joined:
    Jun 4, 2014
    Posts:
    443
    Try updating to at least 5.0.2, there's some weird issues with scene import in 5.0.1.
     
    Al- likes this.
  22. EDarkness

    EDarkness

    Joined:
    Feb 1, 2013
    Posts:
    506
    Hello. I posted this on Twitter, but I guess you don't use it as often. I'm wondering about the framerate hit when moving behind something when using two cameras. My personal solution was to use two cameras that are mirrored and then turn on the other camera real quick and render the scene onto a mask and overlay that onto the screen. Was giving me some trouble, so I haven't messed with it in a while. I was wondering about your solution.

    Performance is a huge issue and I don't want this to be a big problem, however if the framerate hit isn't too crazy, I might go for it.

    Also, is there a serious problem with the system working with 5.0.1? I can't upgrade to 5.0.2 or higher right now. Thanks for any assistance.
     
  23. CatsPawGames

    CatsPawGames

    Joined:
    Jun 4, 2014
    Posts:
    443
    Performance hit is pretty considerable and depends on your system. On mobiles, you'll need to cut costs by using mask downsampling etc.(there's short guide for mobile optimization in the manual), on desktops, on the other hand, this is not much of a problem, especially when you're not rendering your every layer as background or when using special effects for background rendering - I personally use this for my PC project with lots of special effects and fancy graphics.

    It's not a problem with a system working in 5.0.1, just it was uploaded from 5.0.2 version and for some reason, some scenes saved in 5.0.2 won't import correctly in 5.0.1. You can also download version from 4.5 or 4.6 client and then upgrade it manually to 5 - there's no changes in scripts or shaders between versions.
     
    Last edited: Jun 9, 2015
  24. ninjapps

    ninjapps

    Joined:
    Mar 4, 2015
    Posts:
    15
    Hi, I got this today and I must say its a great asset thanks!

    I have a little issue when i switch on the colorize triggers the camera goes black. All I want is to have different colors for enemies and player.

    Here is my setup

     
  25. CatsPawGames

    CatsPawGames

    Joined:
    Jun 4, 2014
    Posts:
    443
    If you're using deferred lighting, try switching "force forward rendering on background". Also, check if your layers setup is correct - it seems like your obstacles and background layers are the same, which usually is not correct.
     
  26. EDarkness

    EDarkness

    Joined:
    Feb 1, 2013
    Posts:
    506
    Thanks for the update. I didn't make the sale, so I'll try to pick it up in the next couple of days. I'm still not confident it'll work with my game, but I'm thinking about giving it a shot.
     
  27. ninjapps

    ninjapps

    Joined:
    Mar 4, 2015
    Posts:
    15
    Hi,

    I tried forward rendering no luck.

    Yes that's because I have been trying everything! I inverted the selection as it should in the background selection and selected everything apart for the obstacles. Still same issue.

    Note: If I turn off the color triggers everything works well.

    Here is an image of what I am getting if I switch it on.



    Here is my layer setup in the background layer.



    Here is my layer setup in the obstacle layer.

     
  28. CatsPawGames

    CatsPawGames

    Joined:
    Jun 4, 2014
    Posts:
    443
    Can you make some test scene with this problem present and send it to me? It will be fastest way of solving this.
     
  29. ninjapps

    ninjapps

    Joined:
    Mar 4, 2015
    Posts:
    15
    Hi,

    Sure, sent you a link via email. I am not getting notifications here so better continue over that if you don't mind.
     
  30. ninjapps

    ninjapps

    Joined:
    Mar 4, 2015
    Posts:
    15
    Hi friend, any feedback please?

     
  31. Al-

    Al-

    Joined:
    Jun 5, 2015
    Posts:
    26
    ninjaps, have you tried to activate the option: use transparency masks (together with forcé forward rendering)?. Mine didn't work because it wasn't active.

    Thanks all!
     
    Last edited: Jun 12, 2015
  32. ninjapps

    ninjapps

    Joined:
    Mar 4, 2015
    Posts:
    15
    Hi, Baruja,

    Yes I tried that no luck.
     
  33. ninjapps

    ninjapps

    Joined:
    Mar 4, 2015
    Posts:
    15
    Hi, Just to let you know that I also get the same issue in your demo scenes without setting up anything just enabling the colorize triggers.
     
  34. CatsPawGames

    CatsPawGames

    Joined:
    Jun 4, 2014
    Posts:
    443
    Yes, I confirmed and reproduced that bug and currently I'm working on fixing it. Can't give ETA yet.
     
  35. ninjapps

    ninjapps

    Joined:
    Mar 4, 2015
    Posts:
    15
    I understand. Will wait for an update then.
     
  36. CatsPawGames

    CatsPawGames

    Joined:
    Jun 4, 2014
    Posts:
    443
    Notes for anyone using Standard shader on sprites in conjuction with See-through System:
    Standard shader always have "opaque" render type tag, so it wouldn't provide correct outline to STS when used on sprites. If you're using that setup, please send me a message and I'll send slightly modified Standard shader to you that'll resolve that problem (it wouldn't affect your normal Standard shader). Or you can just copy Standard shader from shader sources and change tag to "transparent" by hand.

    P.S. Colorized triggers black screen bug was due to incompatibility of one of the STS shaders with DX11, fixed version is currently awaiting review by Asset Store team.
     
  37. super-cypher

    super-cypher

    Joined:
    May 10, 2014
    Posts:
    117
    hi

    is it possible to use this to simply fade an object out? so for example an enemy is killed on floor, now fade him out over a few seconds?

    if so how?

    Many thanks
     
  38. CatsPawGames

    CatsPawGames

    Joined:
    Jun 4, 2014
    Posts:
    443
    Hello.

    It is possible, although I must warn you against it because it's extremely ineffective way of doing fade-out effect. Simple transparent or dissolve shader would be much easier and faster.

    If you still want to do that, you have to designate object that you want to fade as obstacle, your floor as trigger (you floor must completely cover fading object silhouette, if it doesn't, you should create some object that does and put it on invisible layer). After that, you'll have to change transparency power of See-Through System gradually from 0 to 1 when you need fading-out.

    As I said, it's extremely round-about way of doing that, and See-Through System was never intended for that purpose.
     
  39. ninjapps

    ninjapps

    Joined:
    Mar 4, 2015
    Posts:
    15
    Hi,

    I can now confirm that this works well, good Job!

    Can you also please provide an example of how I can fill 2 different triggers with 2 different gameobjects at runtime?
     
  40. CatsPawGames

    CatsPawGames

    Joined:
    Jun 4, 2014
    Posts:
    443
    Hello, if I understood you correctly, easiest way of controlling triggers at runtime is changing gameobjects layers. I can provide more in-depth answer if you explain what you need further.
     
  41. CatsPawGames

    CatsPawGames

    Joined:
    Jun 4, 2014
    Posts:
    443
    Also, my apologies for late announcement, but version 1.6c with fixes is available on Asset Store.
     
  42. Deleted User

    Deleted User

    Guest

    Is there a changelog for the new version? Is there support for disabling shadows and/or lighting on the secondary camera now?
     
  43. CatsPawGames

    CatsPawGames

    Joined:
    Jun 4, 2014
    Posts:
    443
    Changelog is available on Asset Store (click on the version), but changelog for 1.6c contains only bugfixes. I remember your request and I'm sorry for the delay, version 1.6d with it will be uploaded in a couple of day - I wanted to get the bugfixes out as soon as possible.
     
  44. Deleted User

    Deleted User

    Guest

    That's fine man, thanks.
     
  45. ninjapps

    ninjapps

    Joined:
    Mar 4, 2015
    Posts:
    15
    Thanks.

    Ok Let me explain.

    I have 2 empty game objects called Heroes and Enemies. These 2 objects contain the models of the characters which the amount changes over time (or I would add them manually).

    Within the Colored Triggers I want to assign at runtime all child objects of Heroes to Element 0 and Enemies to Element 1 by filling in the size and elements according to the amount of child objects.

    So For Example If Heroes has 3 Child Objects Colored Triggers Element 0 should have Triggers Size 3 and have 3 Elements With each child object Mesh.

    Thanks
     
  46. CatsPawGames

    CatsPawGames

    Joined:
    Jun 4, 2014
    Posts:
    443
    Best way of doing that is to use ColorizeTriggerObject method of SeeThroughSystem component. You can feed your renderers to it, or you can feed it your GameObjects - STS will search for renderers by itself. Example of usage:

    Code (CSharp):
    1. sts.ColorizeTriggerObject(playerObject, desiredColor);
    In this example, SeeThroughSystem is cached into "sts" variable.

    Here's all variations of ColorizeTriggerObject method:

    Code (CSharp):
    1. ColorizeTriggerObject(GameObject trigger, Color color, bool newArrayField = false)
    2. ColorizeTriggerObject(Renderer triggerRend, Color color, bool newArrayField = false)
    3. ColorizeTriggerObject(Renderer triggerRend, int coloredTriggersInd) //This version designates renderer to already existing color record in ColorizedTriggers array.
     
    Last edited: Jul 7, 2015
  47. ninjapps

    ninjapps

    Joined:
    Mar 4, 2015
    Posts:
    15
    Thanks,

    Sorry for the questions but I am new to unity. I placed the below within a script on one of the game objects but its not working. I am sure I am doing something wrong.

    Code (CSharp):
    1. SeeThroughSystem sts = Camera.main.GetComponent<SeeThroughSystem>();
    2.             MeshRenderer _meshRend = gameObject.GetComponent<MeshRenderer> ();
    3.             sts.ColorizeTriggerObject(_meshRend, Color.red, bool newArrayField = false)
    It would be a good idea to have a separate script within this asset by default that you can just attach to the object :)
     
  48. CatsPawGames

    CatsPawGames

    Joined:
    Jun 4, 2014
    Posts:
    443
    You're on the right path, there's no need to get renderer of gameobject, here's the code:
    Code (CSharp):
    1. SeeThroughSystem sts = Camera.main.GetComponent<SeeThroughSystem>();
    2. sts.ColorizeTriggerObject(gameObject, Color.red);
     
  49. Nadan

    Nadan

    Joined:
    Jan 20, 2013
    Posts:
    341
    Is it possible to outline the parts that are not behind obsticles? At the end of my game I want to highlight player all the enemies that remained. This works well with enemies that are behind walls, but I would also like to outline the enemies that are not behind anything.

    Also if I deactivate the See Trough System -script, does that mean that it won't affect the performance at all? Since I only need this effect at the end of the game, not during gameplay.
     
  50. CatsPawGames

    CatsPawGames

    Joined:
    Jun 4, 2014
    Posts:
    443
    It is possible, but in a quite round-about way, and I don't think it will look good. Place a disabled quad right before your camera, set layer of this quad to something not in culling layers of your camera, and put that layer in obstacles layers of see-through system. Then, enable this quad when you need fullscreen effect.

    Yes, of course. If you disable see-through system component, it will have no impact on performance. You can also just set transparency parameter of STS to 0, it will cut performance overhead of it almost to zero.

    Judging from your questions, I think you'll achieve better results with simple outline shaders. Main point of see-though system is visibility obstruction detection, not effects, and it seems like you don't need that. If you find other solution that suits you better and realize that you don't need STS, I'll be glad to provide you with refund.