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
    forums.png

    See-Through System provides an easy and highly configurable way for implementing partial transparency in your projects. Use it to make your character visible behind obstacles in isometric RPGs or strategies, see enemies behind walls in shooters or improve any other projects requiring handling of visibility obstruction.

    Unity 5, Android, iOS compatible.

    See-through System on Asset Store

    Manual

    See-Through System is completely shader-independent, so you don't need to change your materials, shaders or touch your scene objects at all for it to work.

    You can control see-through parts rendering by enabling image effects only for these parts, using Outline or Hologram built-in shaders, or using your own shaders with help from "RenderWithShader" settings.

    Each transparency trigger(e.g. character or unit) can be colored individually, giving you ability to designate allies and enemies, for example.

    Despite usage of multi-camera rendering, there's option for preserving original depth texture, so your other image effects won't be affected by it.

    Lastest version: 1.6b with orthographic camera fix. Full changelog can be found on Asset Store.

    P.S. You can check out my other assets:
    ArcReactor procedural ray generator
    Colorify recolor shader pack
    Advanced Selective Coloring image effect
    U Chroma Key solution
    0.JPG
    2.JPG
    3.JPG
    4.jpg
     
    Last edited: Mar 16, 2021
  2. imtrobin

    imtrobin

    Joined:
    Nov 30, 2009
    Posts:
    1,548
    No shader change? That's quite amazing. Are you rendering object/scene twice? Works on mobile?
     
    Gozdek likes this.
  3. CatsPawGames

    CatsPawGames

    Joined:
    Jun 4, 2014
    Posts:
    443
    Yep, no shader/material changes required at all, took a while to make everything work as it should =)
    There is additional render passes, one for obscurance mask using shader replacement with only obstacles and triggers(so very small GPU cost), one for rendering triggered areas behind obstacles - cost of that one dependent solely on your scene setup (there's option for disabling this pass if there's no obscured triggers on the screen). You can also choose what to render for those areas, so you can shave off cost by disabling extra layers. I'm also working on alternative solution with only 1 extra pass(quick one), but it's not going to support shadows at minimum (probably there'll be other downsides). I plan to include that solution in this system as an option.
     
    Last edited: Nov 16, 2014
  4. imaginaryhuman

    imaginaryhuman

    Joined:
    Mar 21, 2010
    Posts:
    5,834
    Hm. So dies it like wipe out some of the z-buffer values and then draw `on top` of the scene?
     
  5. CatsPawGames

    CatsPawGames

    Joined:
    Jun 4, 2014
    Posts:
    443
    It first gets a trigger-obscurance mask using triggers and obstacles z-buffers, transforms/blurs/saturates that mask based on your settings, then blends original pass with no-obstacles-pass using that mask. It also uses original triggers and obstacles mask to prevent blending on edge areas and on visible triggers where blend intersects with them.

    It does affect z-buffer, but there's option for preserving original z-buffer texture to allow other post-effects to work correctly.
     
  6. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,761
    That looks a very handy system, though I can't seem to get your demo to work, the scene comes up and I can move the sliders etc but I cant move the character or change the camera etc, tried in both Firefox and Chrome.
     
  7. CatsPawGames

    CatsPawGames

    Joined:
    Jun 4, 2014
    Posts:
    443
    Arrow keys should move the character. Movement script uses Unity axis for input, so maybe you have standard Unity input redefined (to be honest I don't know much about how webplayer handles axis input).
    I'll put clarification in the main post, thanks for bringing it up.
     
  8. sicga123

    sicga123

    Joined:
    Jan 26, 2011
    Posts:
    782
    Couldn't get the demo to work at first, however, it works perfectly in fullscreen mode but not at reduced window size even when one goes from fullscreen to windowed it stops working. Possibly a peculiarity of my machine and/or the webplayer.

    Looks good.
     
  9. amonitzer

    amonitzer

    Joined:
    Sep 9, 2012
    Posts:
    6
    I'm having a similar issue (Mac OS X 10.10). In fullscreen mode, the web player build works fine, but in windowed mode, I get a strange rasterization issue that's flickering around. It gets worse when I enter a zone where the effect is shown, and it disappears when I stand still for a while.
     
  10. MikeUpchat

    MikeUpchat

    Joined:
    Sep 24, 2010
    Posts:
    1,056
    Same here, cant move the character at all.
     
  11. CatsPawGames

    CatsPawGames

    Joined:
    Jun 4, 2014
    Posts:
    443
    Hmmm, that's really strange. I don't have mac and can't test or reproduce this bug, sadly. I had some issues with other image effects in non-fullscreen mode, so it seems like it's an issue with webplayer. I've rebuilt and reuploaded the webplayer just in case.
     
    Last edited: Nov 6, 2014
  12. CatsPawGames

    CatsPawGames

    Joined:
    Jun 4, 2014
    Posts:
    443
    As for movement problem, I changed input controls to simple key binding, now WASD and arrow keys should work regardless of settings.
     
  13. amonitzer

    amonitzer

    Joined:
    Sep 9, 2012
    Posts:
    6
    Unfortunately, that didn't change anything.
     
  14. CatsPawGames

    CatsPawGames

    Joined:
    Jun 4, 2014
    Posts:
    443
    If it's showing in the areas where effect is not in place, then I'm afraid it's definitely webplayer issue, since new build had mask check enabled, so effect isn't doing anything when there's nothing to make transparent - it just outputs source image.
     
  15. imtrobin

    imtrobin

    Joined:
    Nov 30, 2009
    Posts:
    1,548
    Just build the apk and post here for us to test.
     
  16. CatsPawGames

    CatsPawGames

    Joined:
    Jun 4, 2014
    Posts:
    443
    Some kind people provided me with Android device for testing, there was some minor syntax issues in shaders but I already fixed that and uploaded version 1.1 with Android support (should also work on iOS) - it should be available sometime next week.
     
    Last edited: Nov 16, 2014
  17. CatsPawGames

    CatsPawGames

    Joined:
    Jun 4, 2014
    Posts:
    443
    Could anyone who experienced problems with non-fullscreen mode of webplayer try out new one and report if problems still exist? (It should say "See-through system demo" in the upper right corner of the screen. If it's not, you have to refresh page or clear browser cache). I changed a few things but unfortunately can't reproduce original problems on any of my machines.
     
  18. CatsPawGames

    CatsPawGames

    Joined:
    Jun 4, 2014
    Posts:
    443
    Version 1.1 is available at Asset Store, support for mobile platforms added.
     
  19. CatsPawGames

    CatsPawGames

    Joined:
    Jun 4, 2014
    Posts:
    443
    Version 1.2 submitted to the Asset Store, containing major performance optimization. With transparency check enabled, STS now dynamically changes background camera matrix projection, rendering only parts of the background visible through obstacles.

    Should be available at the beginning of the next week.
     
  20. sicga123

    sicga123

    Joined:
    Jan 26, 2011
    Posts:
    782
    Possibly you know this already, but I checked the webplayer version again, now works fine in the reduced size window. There was some confusion when it came on in that the screen was black. When I disabled the STS in the top corner everything appeared, then enabling STS again had everything working perfectly. No idea why it is blacked out at the start and why it didn't register input at first. Could be a glitch in my machine, and it's only a niggardly thing that is happening anyway.
     
  21. CatsPawGames

    CatsPawGames

    Joined:
    Jun 4, 2014
    Posts:
    443
    @sicga123
    Thanks, I'm glad that reduced window problems are solved.
     
  22. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,684
    I get a black screen on the reduced size window till I toggle the STS button. (Windows 8.1, Firefox)

    This looks very nice! :)
     
  23. CatsPawGames

    CatsPawGames

    Joined:
    Jun 4, 2014
    Posts:
    443
    Version 1.2 available on Asset Store with improved performance! Also, webplayer demo has been updated, that should fix the enable/disable problems.
     
  24. CatsPawGames

    CatsPawGames

    Joined:
    Jun 4, 2014
    Posts:
    443
    Coming in version 1.3 : individual coloring of see-through triggers, allowing you to differentiate teams, object types etc.
     
    Last edited: Nov 17, 2014
  25. CatsPawGames

    CatsPawGames

    Joined:
    Jun 4, 2014
    Posts:
    443
    Colored trigger objects WIP:
    ColoredTriggers.jpg
     
    Last edited: Nov 18, 2014
    hopeful likes this.
  26. CatsPawGames

    CatsPawGames

    Joined:
    Jun 4, 2014
    Posts:
    443
    1.3 additions: improved API for disabling/enabling/coloring triggers and colliders.
     
  27. CatsPawGames

    CatsPawGames

    Joined:
    Jun 4, 2014
    Posts:
    443
    Trigger color mixing WIP:
    trigger_color_mix.jpg
     
  28. CatsPawGames

    CatsPawGames

    Joined:
    Jun 4, 2014
    Posts:
    443
    Version 1.3 uploaded to asset store, changelog:
    - added Colorize triggers option
    - improved API for disabling/enabling/coloring triggers at runtime
    - fixed D3D anti-aliasing mask flip problem

    You can expect update to be live in 3-7 days.
     
  29. CatsPawGames

    CatsPawGames

    Joined:
    Jun 4, 2014
    Posts:
    443
  30. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,348
    The system looks great. Some questions

    - Do i need to change shader on my hero to use the shost like effect ?
    - If i dont change shaders, do i get to use the full transparency look (like mid of first image in the OP) ?
    - Does the 2ond camera introduce heavy load (for example does it render the hero a 2ond time ?

    Thanks
     
  31. CatsPawGames

    CatsPawGames

    Joined:
    Jun 4, 2014
    Posts:
    443
    Thanks for kind words.

    - You don't need to change shaders for any effects.
    - Same as the first answer =)
    - 2nd camera does render characters second time.
     
    hopeful likes this.
  32. PlayingKarrde

    PlayingKarrde

    Joined:
    Aug 19, 2013
    Posts:
    38
    Hi, I'm having issues with this running on Mac. On PC everything seems fine but when I run on OSX the scene only shows pink. I verified it being this asset but turning off the script and everything shows fine.

    This occurs both in my own scene and in the demo scene.

    Do you have any ideas?
     
  33. CatsPawGames

    CatsPawGames

    Joined:
    Jun 4, 2014
    Posts:
    443
    Hi. I'm sorry, but this asset wasn't tested on OSX, only on Windows, iOS and Android. The main reason for that behaviour would be shader problem, most likely one of the custom shaders used by See-through system can't be compiled on your OSX machine. I can offer you a refund, or you can wait while I try to fix that in future versions(I try to make shaders as platform-independent as possible).
     
  34. PlayingKarrde

    PlayingKarrde

    Joined:
    Aug 19, 2013
    Posts:
    38
    That's fine I'm doing most of my development on PC. I can wait for a fix. This asset has basically saved me a ton of work since other assets that try and solve this issue just aren't really up to snuff.

    Hopefully the fix will be easy enough but I can be patient. Thanks for the reply.

    -edit- by the way I'm seeing this in the editor. I haven't tested compiling an OSX build on Windows and playing it on OSX. No idea if that works or not. I'll try it out and report back.
     
  35. PlayingKarrde

    PlayingKarrde

    Joined:
    Aug 19, 2013
    Posts:
    38
    Hi, another issue I'm having is when using this with Amplify Color. What's happening is that it is flipping the image upside down. It's very bizarre.

    Amplify Color is a very common tool (and super useful) so are you aware of this issue and/or how to fix it?
     
  36. CatsPawGames

    CatsPawGames

    Joined:
    Jun 4, 2014
    Posts:
    443
    Hi.

    It's most likely due to both Amplify Color and See-Through System compensating for texture y-coordinate inversion on some platforms. Since they both try to compensate for it, image become flipped. I can probably make compensation optional by introducing toggle control in the next version. For now, you can try to find out if coordinate inversion compensation can be disabled in Amplify Color(though I doubt it). Basically, what you need is only 1 image effect perform this compensation.


    Edit: I found a friend with Amplify Color, he tested it and there's no problem in his case. So it's definitely platform-dependent.

    Edit2: Please send me your email either in PM or to leonidmv (at) gmail (dot) com, I made some changes and can send you updated files.
     
    Last edited: Jan 14, 2015
  37. Jesse_Pixelsmith

    Jesse_Pixelsmith

    Joined:
    Nov 22, 2009
    Posts:
    296
    This looks like exactly what I need, and love that it is shader independent :) Doing a top down game with a 3d perspective and sometimes the character gets behind a large obstacle and i want to see him. Will probably pick up soon :)
     
  38. CatsPawGames

    CatsPawGames

    Joined:
    Jun 4, 2014
    Posts:
    443
    Thanks! I created it at first specifically for that scenario since I didn't want to bother with my custom hero shaders. Hope you'll find it useful ;)
     
  39. CatsPawGames

    CatsPawGames

    Joined:
    Jun 4, 2014
    Posts:
    443
    Version 1.3a uploaded to Asset Store, includes shader fixes that should improve performance on non-dx platforms and remove some bugs.
     
  40. pfernan

    pfernan

    Joined:
    Jan 13, 2015
    Posts:
    10
    Would this work on 2d games. I have sprites with different Z-axis value, would the sprites occluding the player sprite be transparent using this tool?
     
  41. CatsPawGames

    CatsPawGames

    Joined:
    Jun 4, 2014
    Posts:
    443
    Hi, just tested STS on simple 2D sprites setup. Everything works as expected, but hologram and outline effects don't look good because they use geometry. So, if you need transparency and coloring only, you can use it for 2D projects. I'll try to include some special effects for 2D settings in future releases.
     
  42. CatsPawGames

    CatsPawGames

    Joined:
    Jun 4, 2014
    Posts:
    443
    Version 1.4 uploaded to Asset Store!
    Changes:
    • added more integration options for 2D projects:
    • "check render type" toggle allows precision trigger checking with sprites
    • "alpha hologram" effect allows hologram effect to work correctly with sprites (and generally produces better resutls than simple hologram)
    • minor fixes
     
    Last edited: Jan 25, 2015
  43. CatsPawGames

    CatsPawGames

    Joined:
    Jun 4, 2014
    Posts:
    443
    Accepting requests for new effects besides holograms and outlines.

    Also, online manual was updated, be sure to check it.
     
  44. Jesse_Pixelsmith

    Jesse_Pixelsmith

    Joined:
    Nov 22, 2009
    Posts:
    296
    Does this only work with forward rendering? I couldn't get it to work in my project and had no idea why, then I switched to forward rendering and it was fine. Also I switched a clean project with your demo to deferred and it stopped working, so that seems like an issue, but I don't see it mentioned anywhere in this thread, the asset store page, or documentation. Any way to fix this? I generally use deferred rendering and I think Unity 5 does by default.
     
  45. CatsPawGames

    CatsPawGames

    Joined:
    Jun 4, 2014
    Posts:
    443
    Hi and thanks for bringing this problem to my attention. I made a quick fix, but since working with deferred rendering in Unity with multiple cameras is tricky at best, there will be lighting problems in visible background areas(this obviously will not affect backround rendered with special effects). I also made "force forward rendering on background" toggle, so that you can use deferred rendering globally, and STS will switch to forward rendering on visible background areas to avoid problems with lighting.

    Please send me your email and I will send fixed version to you. If you'll find that this functionality with deferred rendering still not cutting it for you, I can offer you a refund.
     
  46. pfernan

    pfernan

    Joined:
    Jan 13, 2015
    Posts:
    10
    Would it be possible to make only the objects occluding your visions transparent, and not the ones in the background?
     
  47. CatsPawGames

    CatsPawGames

    Joined:
    Jun 4, 2014
    Posts:
    443
    Not sure what you have in mind. You can setup layers that will be rendered as background. If that's not what you meant, please provide a drawing, screenshot or more detailed desription.
     
  48. CatsPawGames

    CatsPawGames

    Joined:
    Jun 4, 2014
    Posts:
    443
    Version 1.4 is live on Asset Store. 1.4a coming soon with dererred rendering support.
     
    Last edited: Jan 29, 2015
  49. Nadan

    Nadan

    Joined:
    Jan 20, 2013
    Posts:
    341
    Does this work with Unity free or does it require pro version?
     
  50. CatsPawGames

    CatsPawGames

    Joined:
    Jun 4, 2014
    Posts:
    443
    It's image effect, so Unity Pro is required.