Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

See-Through System - shader-independent visibility obstruction handling

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

  1. Nadan

    Nadan

    Joined:
    Jan 20, 2013
    Posts:
    341
    Thanks for the answer.

    I need to show the player enemies that are behind obsicles at the end of the game. I tried shader Toon > Basic Outline for example. It shows the outline, but not the ones behind walls. Are there shaders that show gameobjects behind walls as well?

    Anyway, I originally bought STS for another game where the player needs to see himself behind walls so there is no need for refund. :)
     
  2. CatsPawGames

    CatsPawGames

    Joined:
    Jun 4, 2014
    Posts:
    443
    There's this basic Silhouette-Outlined shader:
    http://wiki.unity3d.com/index.php/Silhouette-Outlined_Diffuse

    There's no problem with using STS when you highlight objects behind obstacles, but to make fullscreen highlight look good you'll need to tweak parameters. I think most visually-pleasing way would be simple background, 20-50% transparency and colorized triggers with enemies colored.
     
  3. Nadan

    Nadan

    Joined:
    Jan 20, 2013
    Posts:
    341
    OK thanks! I think I'll go with the Silhouette-Outlined shader with this one. Just tried it and looks good.
     
  4. ninjapps

    ninjapps

    Joined:
    Mar 4, 2015
    Posts:
    15

    Thanks.

    I have tried that but I am getting a grey screen. with the following error:

    Code (CSharp):
    1. NullReferenceException: Object reference not set to an instance of an object
    2. SeeThroughSystem.OnRenderImage (UnityEngine.RenderTexture src, UnityEngine.RenderTexture dest) (at Assets/SeeThroughSystem/Scripts/SeeThroughSystem.cs:568)
     
  5. CatsPawGames

    CatsPawGames

    Joined:
    Jun 4, 2014
    Posts:
    443
    Try to add at least one record to colorized triggers in inspector. Content of this record doesn't matter, you can set color of some trigger to white so it wouldn't affect anything.
     
  6. ninjapps

    ninjapps

    Joined:
    Mar 4, 2015
    Posts:
    15
    Did not work. Still getting a full grey screen.
     
  7. CatsPawGames

    CatsPawGames

    Joined:
    Jun 4, 2014
    Posts:
    443
    Can you send me your scene or some test project with this problem present? (Or I can offer you a refund if you don't want to wait.)
     
  8. ninjapps

    ninjapps

    Joined:
    Mar 4, 2015
    Posts:
    15
    Hi,

    Yes just emailed you a test scene. I do not want a refund because I want this asset to work and I am sure you want the same thing :)

    I am not getting the grey screen in the test scene but I am getting the same error.

    I can see that the trigger is being added to the camera but the color and the mesh rendered aren't. I think the error is coming up because its finding the size to be 0.
     
  9. CatsPawGames

    CatsPawGames

    Joined:
    Jun 4, 2014
    Posts:
    443
    Replied to your email, please send me a PM if you didn't recieve my email.
     
  10. BigAppear

    BigAppear

    Joined:
    May 15, 2015
    Posts:
    7
    Hello CatsPawGames !

    I hesitate to buy your asset. I'd like to know if performance issues have been resolved ? I'd like to use your asset for mobile.

    Thanks !
     
  11. CatsPawGames

    CatsPawGames

    Joined:
    Jun 4, 2014
    Posts:
    443
    Hello.

    While there were improvements performance-wise from earlier versions, it's still pretty heavy system. All I can offer you is to buy and try it - if performance hit is critical, then you can get a no-question-asked refund during 2 weeks from the moment of purchase.
     
  12. ninjapps

    ninjapps

    Joined:
    Mar 4, 2015
    Posts:
    15
    Thanks Mate for fixing the issue! This asset is 100% awesome now :p
     
  13. Deleted User

    Deleted User

    Guest

    Hi! I was just wondering when the next version (with no shadows and lights on the secondary cameras) will be released. Thanks!
     
  14. CatsPawGames

    CatsPawGames

    Joined:
    Jun 4, 2014
    Posts:
    443
    Sorry for the delay. It will be uploaded today, so expect it to be approved at the beginning of the next week.
     
  15. CatsPawGames

    CatsPawGames

    Joined:
    Jun 4, 2014
    Posts:
    443
    My (not-so-reliable)hosting killed ArcReactor site that was hosting demos and manual, so they are unavailable right now. I'm in the process of moving materials to my own server, new links should be up at the beginning of next week.

    My apologies to people who were trying to access demos or manual.

    P.S.: New version with shadows and lights disabling is up.
     
    Last edited: Aug 15, 2015
    hopeful likes this.
  16. Wiseman17

    Wiseman17

    Joined:
    Aug 17, 2013
    Posts:
    24
    Hi CatsPawGames,
    I've got a question about your asset. May be a manual could help me to answer, but it's still no accessible ;). Your system is using a second camera, right?
    Is it possible to show an object you are going to see through a wall not at once, but slowly? For example by slowly moving camera far clipping plane? So it would give some kind of "radar" effect... you see?
     
  17. CatsPawGames

    CatsPawGames

    Joined:
    Jun 4, 2014
    Posts:
    443
    Hmm... You can change transparency at run-time, so it can give you slow apperance of see-through windows, but I'm not sure that's what you have in mind.

    You can also change clipping plane of STS camera using STS-specific event that's called before rendering, so maybe that's what you want. It won't affect usual rendering of your scene, but it will affect at what distance objects will trigger transparency.

    I know about problems with manual accesibility, sorry about that, I had really bad lack with my hosting and provider. It should be up by the end of this week.
     
  18. DomDom

    DomDom

    Joined:
    Oct 18, 2013
    Posts:
    33
    Hi There

    I'm trying to get the See-Through to work with two cameras. I've read the docs and used the demo scene to make it work, but in my actual scene I'm having a second camera which render on the Unity UI. I have a panel on a canvas which is on the obstacle layer and there are 3D Models which are on the trigger layer. Also the position of the whole UI and it's camera is way different then the 3D Models.

    I couldn't get it to work, do you have any idea how to solve the problem?

    Best
     
  19. CatsPawGames

    CatsPawGames

    Joined:
    Jun 4, 2014
    Posts:
    443
    I don't exactly understand what you're trying to achieve. Do you want for UI to behave as if it's an obstacle?

    It will be better if you send me a demo scene where you achieved what you want, and your current scene.
     
  20. DomDom

    DomDom

    Joined:
    Oct 18, 2013
    Posts:
    33
    Basically is a scenario with two cameras on the them is for the UI, the other for the 3D environment. The UI has one Panel which should work as an obstacle (NOT everything on the canvas).

    How can I do it?
    Because it seems that layers only work on the whole canvas not on single Elements.
     
    Last edited: Sep 28, 2015
  21. CatsPawGames

    CatsPawGames

    Joined:
    Jun 4, 2014
    Posts:
    443
    Look at "Disabled obstacles" option. Just put your objects belonging to the same layer as your obstacle panel into this array, and they wouldn't trigger transparency.
     
  22. Sh4D

    Sh4D

    Joined:
    Dec 8, 2014
    Posts:
    17
    Hi, im intrested in your asset but got few questions first.
    I am making a tactical rpg using isometric view (orthographic camera) fully in 2D. I worked a lot on a depth rendering and I got a shader for the lighting on my sprites, so therefor im intrested into a non shader solution for characters, objects behind walls. I have an outline code working on PreCull() within the camera changing shader to calculate outline and getting old one back. But this is a huge performance drop.
    My questions are :
    1. My characters are composed with different sprites, will outline from them be merged?
    2. Can I define when my characters are behind a wall as this is calculated within my depth rendering code and there is no other way to know when a char is behind a wall or not?
    3. How big are the performances drop of 2 cameras use?
    O yea also i don't have unity pro ( not needing it yet for my 2D project, do I need it with this asset? Ive been reading it is required but then with unity 5 didn't that change??)
    Thanks a lot
     
  23. CatsPawGames

    CatsPawGames

    Joined:
    Jun 4, 2014
    Posts:
    443
    Hello.

    1) Outline effect doesn't work well for sprites, I advise using alpha-hologram effect if you want some special effect for transparent areas.
    2) Theoretically you can modify STS for that, but it handles obstruction detection based on custom depth shaders and mask comparison, so it wouldn't be an easy task.
    3) Depends on your scene setup and platfrom. For mobiles, performance costs are pretty steep.

    If you have Unity 5, you don't have to worry about licenses, it works on any version. Pro required only for Unity 4.

    Overall, if you have your own custom obstruction detection, it will probably be easier(and better performance-wise) for you to make your system for that purpose.
     
  24. xpation

    xpation

    Joined:
    Mar 8, 2013
    Posts:
    9
    Is there a way to use this system for something that isn't based on obscuring a renderer? For instance, I would like to show areas based on intersection with an invisible collider.

    This would allow me to eg:
    1. Have an invisible sphere trigger around the player and make nearby objects fade out as they get near the player.
    2. Have an object emit a cone trigger (like a flashlight) and the surfaces that the cone hits turns invisible.

    Any way to get this effect with the current STS?
     
  25. CatsPawGames

    CatsPawGames

    Joined:
    Jun 4, 2014
    Posts:
    443
    I don't think these effects are possible without modifications.

    I'll think about possible solutions for that and if I'll think of something that doesn't affect performance much, I'll include it in next version.
     
  26. xpation

    xpation

    Joined:
    Mar 8, 2013
    Posts:
    9
    Okay thanks :) So the only way to have have a section of geometry be invisible is to actually have some renderer behind it that is actually rendering, correct? No way to cheat around this like have an invisible object be the trigger?
     
  27. CatsPawGames

    CatsPawGames

    Joined:
    Jun 4, 2014
    Posts:
    443
    You can place your trigger on layer excluded from your cameras culling mask. This way it will trigger transparency but will not be visible.
     
  28. CatsPawGames

    CatsPawGames

    Joined:
    Jun 4, 2014
    Posts:
    443
    Version 1.7b is available on Asset Store. It contains fix for STS inspector serialization problems.
     
  29. christougher

    christougher

    Joined:
    Mar 6, 2015
    Posts:
    558
    using Unity 5.3.1

    I get this repeating red error at runtime when I destroy an object that has a mesh renderer listed as a colored trigger on the STS camera.

    MissingReferenceException: The object of type 'MeshRenderer' has been destroyed but you are still trying to access it.
    Your script should either check if it is null or you should not destroy the object.
    SeeThroughSystem.OnRenderImage (UnityEngine.RenderTexture src, UnityEngine.RenderTexture dest) (at Assets/SeeThroughSystem/Scripts/SeeThroughSystem.cs:572)

    I add the triggers to the STS script with the following script attached to each GO, and that works perfectly... the disabling it tho is a problem...

    Code (CSharp):
    1.  
    2. using UnityEngine;
    3. using System.Collections;
    4.  
    5. publicclassSeeThroughSysSetColorizeTrigger:MonoBehaviour{
    6. publicColorcolor;
    7.  
    8. voidStart(){
    9.  
    10. SeeThroughSystemsts=Camera.main.GetComponent<SeeThroughSystem>();
    11.  
    12.  
    13. /*sts.ColorizeTriggerObject(gameObject,Color.red);*/
    14. sts.ColorizeTriggerObject(gameObject,color);
    15.  
    16.  
    17. }
    18.  
    19.  
    20. voidOnDisable()
    21. {
    22. SeeThroughSystemsts=Camera.main.GetComponent<SeeThroughSystem>();
    23.  
    24. sts.DecolorizeTriggerObject();  //???????
    25.  
    26. }
    27.  
    28. }
    29.  
    I'm not so great at scripting, could you help me to get this to work when it gets destroyed?

    Also these types of actions would make great Playmaker actions. Playmaker support would increase your customer base. :)
     
  30. CatsPawGames

    CatsPawGames

    Joined:
    Jun 4, 2014
    Posts:
    443
    You were on the right track, change
    Code (CSharp):
    1. sts.DecolorizeTriggerObject()
    to
    Code (CSharp):
    1. sts.DecolorizeTriggerObject(GetComponent<Renderer>())
    Basically you must provide renderer that needs to be decolorized to Decolorize function. If your renderer isn't on GameObject that calls OnDisable(), you need to somehow provide it to sts. Easiest way would be to declare public Renderer variable and manually drag'n'drop renderer in inspector.

    I'll include triggers destruction check in future version so you wouldn't have to decolorize them manually.

    I get PlayMaker support requests a lot for my assets, so it's on my to-do list.
     
  31. MiniMe13

    MiniMe13

    Joined:
    Feb 20, 2016
    Posts:
    1
    Добрый день.
    Хочу приобрести See-Through System. Есть несколько вопросов на Вашей системе:
    1. Игра 2D RPG, хочу сделать такой see-throught для игрока и ИИ (как это реализовано fallout 2). Там получается 2 разных шейдера или даже 3. Игрок и подсветка контура "друзей" и "врагов", как ИИ так и игроков.
    2. Сколько будет draw-call'ов если использовать Вашу систему с вышеупомянутой конфигурацией? На сколько или в сколько раз можно сократить/оптимизировать draw-call? Игра планируется на мобильные гаджеты.
    Спасибо.
     

    Attached Files:

    • 1.jpg
      1.jpg
      File size:
      161.8 KB
      Views:
      841
    • 2.jpg
      2.jpg
      File size:
      227.9 KB
      Views:
      863
  32. MarcoMeter

    MarcoMeter

    Joined:
    Jun 14, 2013
    Posts:
    69
    Hello,

    I'm wondering if this asset could solve my problem posted in this thread. Might this package turn out as proper solution?
     
  33. CatsPawGames

    CatsPawGames

    Joined:
    Jun 4, 2014
    Posts:
    443
    Hello.

    I don't think STS will completely solve your problem since in STS object can't be both trigger and obstacle, and that's what you need as far as I can understand. Also I don't recommend using it with Oculus since it can affect performance.
     
  34. ajk48n

    ajk48n

    Joined:
    Mar 27, 2014
    Posts:
    5
    Hi,

    I'm having a problem with STS when reloading a Unity scene.

    I have a scene with STS included and everything is working fine. However when I reload the level Unity will freeze. Although this only happens in builds, not the editor

    It doesn't freeze on the first reload. Only after a random amount, maybe 5-15 reloads
    If I disable STS on a camera, then everything works fine.

    I've tried debugging the script, and I can track down the offending section to one line of code:
    backgroundCamera.RenderWithShader(outlineShader, "")

    When this line is commented out, everything works fine. When I re-enable it the freezes start happening again.

    Checking the build error log, it crashes right after this line:
    Unloading 3 Unused Serialized files (Serialized files now loaded: 0)

    Any idea what might be going on?
     
  35. CatsPawGames

    CatsPawGames

    Joined:
    Jun 4, 2014
    Posts:
    443
    Hello.

    No idea off the top of my head, serialization shouldn't be an issue here. Can you send me test project with this problem present for easy replication? (Email is in the asset store publisher description)
     
  36. Deleted User

    Deleted User

    Guest

    Hi, brand new to using this asset. I'm having an issue where it's sort of flickering on and off at intervals about once every second in some situations. Depending on how I move/rotate the camera, it will sometimes do this and sometimes work fine. I generally see it in situations where nothing is blocking the view of the triggers, so I'm unclear why it would be turning on (and then subsequently off). Any ideas? I saw a couple people mentioned flickering a while back, but didn't find a resolution to it. Thanks.
     
  37. CatsPawGames

    CatsPawGames

    Joined:
    Jun 4, 2014
    Posts:
    443
    Hello. If flickering is triggered by moving your camera, most likely culprits are:
    1) Layers setup/invisible(or duplicate) objects. Make sure you your triggers and obstacles are correctly designated.
    2) Multiple-camera setup.

    You can send me a project with this problem present, and I'll take a look for possible causes of this behavior.
     
  38. tsharath

    tsharath

    Joined:
    May 2, 2016
    Posts:
    4
    Hello
    how would I go about changing the trigger object's color dynamically from script upon reaching a certain event in game?
     
  39. CatsPawGames

    CatsPawGames

    Joined:
    Jun 4, 2014
    Posts:
    443
    Hello.

    Use ColorizeTriggerObject method. There's several overloaded versions of this method, easiest one is this:
    Code (CSharp):
    1. ColorizeTriggerObject(GameObject trigger, Color color, bool newArrayField = false)
    Just provide GameObject containing trigger renderers and new color, newArrayField can be left as false (it will force-create new record in colorized triggers array if set to true).
     
  40. tsharath

    tsharath

    Joined:
    May 2, 2016
    Posts:
    4
    Thank you!
     
  41. Glock113

    Glock113

    Joined:
    Sep 6, 2013
    Posts:
    14
    Any way to stop the bleed through to obstacles that the user isn't behind? For an example you can open the demo scene and walk to the right but stay behind the small wall you start behind. depending on the size of "hole" you can see back behind the wall behind green robot kyle.
     
  42. Glock113

    Glock113

    Joined:
    Sep 6, 2013
    Posts:
    14
    also is there a way to have the obstacle object change to transparent when the player is behind it. For example if my player is behind a wall instead of cutting out a hole in the wall have the option to adjust the transparency of the wall and also have the option to cut a hole out to see the player better even if the wall is somewhat transparent?
     
  43. Zeldafreakneo

    Zeldafreakneo

    Joined:
    Mar 21, 2015
    Posts:
    9
    I am very interested in this product and have one question for you. Are you able to increase the size of the transparency around the character? I'm making an isometric dungeon crawler and I would like the player to have a large zone of transparency around them when a wall obscures their character so they can see more action and not be blinded.

    Thank you.
     
  44. CatsPawGames

    CatsPawGames

    Joined:
    Jun 4, 2014
    Posts:
    443
    Yes, there are several tweakable parameters that affect the size of transparency window.
     
  45. CatsPawGames

    CatsPawGames

    Joined:
    Jun 4, 2014
    Posts:
    443
    Unity 5.5 seems to broke some of See-Through System functionality, expect compatibility fix during next week. Apologies for inconvenience to all STS users.
     
    BBLOCK_Digital and Chinafreak like this.
  46. BBLOCK_Digital

    BBLOCK_Digital

    Joined:
    Dec 17, 2014
    Posts:
    12
    Hello, awesome asset, just to let you know the component isn't working anymore on parallel camera in 5.5....
    when are you planning to release compatibility fix?
    by the way great work!
     
    Chinafreak likes this.
  47. CatsPawGames

    CatsPawGames

    Joined:
    Jun 4, 2014
    Posts:
    443
    ETA for update is 11 December, but Asset Store usually takes up to a week to approve it. Everyone needing update without this delay - please send email with your invoice # to my support email (available on my Asset Store page) and I'll reply with updated files as soon as they're ready.
     
  48. Chinafreak

    Chinafreak

    Joined:
    Apr 6, 2013
    Posts:
    44
    Sound good! :) Is my issue fixed, too? About using outlines shader + walls on top?
     
  49. CatsPawGames

    CatsPawGames

    Joined:
    Jun 4, 2014
    Posts:
    443
    Yes, updated version includes fixes for all reported issues.
     
    Chinafreak likes this.
  50. CatsPawGames

    CatsPawGames

    Joined:
    Jun 4, 2014
    Posts:
    443
    Version 1.8 is uploaded to Asset Store, should be available for download during next week after review process.

    Changelog:
    • Unity 5.5 compatibility fixes
      • Orthogonal camera depth buffer handling changes
      • Outline width range recalibration
      • Null material handling on transparency mask component
    • Deprecated "Check render types" parameter (always on from now on)
    • Updated outline shader - now it normalizes lines thickness for distance and camera FOV
     
    Chinafreak and BBLOCK_Digital like this.