Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

[FREE] VR Tunnelling Pro - Plug-And-Play VR Comfort

Discussion in 'Assets and Asset Store' started by Lyje, Feb 14, 2018.

  1. raganvald

    raganvald

    Joined:
    Feb 1, 2019
    Posts:
    5
    How do I enable/disable debug mode Force Effect in c# script, for my game? When I. I want to use your packages for a simulated effect but I don't want it tied to locomotion but disable/enable in game as needed.

    Ok i figured out how to enable it constantly. I just downloaded the github version than changed hte default value to true.

    However I do have a different problem. Where the tunneling works fine in the editor but in a windows build it doesn't show up. I'm using it with the Oculus OVRcamera. Anyone have any ideas on how to fix that?
     
    Last edited: May 8, 2020
  2. Lyje

    Lyje

    Joined:
    Mar 24, 2013
    Posts:
    168
    Afraid I can't reproduce that issue - does it happen in the example scene?

    The effect should never trigger from head movement if correctly set up. Could you post a screenshot of the hierarchy?
     
  3. Lyje

    Lyje

    Joined:
    Mar 24, 2013
    Posts:
    168
    I'm considering exposing that in the API to easily open VRTP up to other uses (such as damage vignettes) - but glad you found a workaround :)

    A previous poster reported the same issue, but I've been unable to reproduce - could you perhaps send a repro project?
     
    Hobodi likes this.
  4. Hobodi

    Hobodi

    Joined:
    Dec 30, 2017
    Posts:
    99
    @Lyje Hi! Can you do this values publis with next update? It's can be usefull.
    tunnellingMobile._debugForceOn = true;
    tunnellingMobile._debugForceValue = 0.2f;
     
  5. Lyje

    Lyje

    Joined:
    Mar 24, 2013
    Posts:
    168
    Yes - it'll be in there :)
     
    Hobodi likes this.
  6. Lyje

    Lyje

    Joined:
    Mar 24, 2013
    Posts:
    168
    VRTP V1.4.0 is out now on GitHub!

    By popular demand, you can now take full manual control of tunnelling with the new Force Vignette modes, from code and the editor.



    This replaces the Force Effect setting in the Debug section.
     
    ugur and Hobodi like this.
  7. yendou

    yendou

    Joined:
    Jan 17, 2017
    Posts:
    12
    Hello,
    Thanks for the great asset.Im experiencing a problem,where during compilation of shader SeparableBlur the editor crashes on "stripping vertex programs" without any error,just crash.
    Never saw that before.I found out when trying to build it,sample was working ok in editor.When I create a new project and import just VRTunelling,there is no issue.Does someone have an idea what it could be?using windows 64 build,unity 2019.4,steamvr plugin and old xr management system.
    Must be some of my assets,but no idea what or why.I got to the shader only by watching compiler progressbar and catching the last thing before it crashes lead me to this shader,when i compile it manualy,it crashes too.
    other shaders are ok.
    I need a hint please.
     
  8. Lyje

    Lyje

    Joined:
    Mar 24, 2013
    Posts:
    168
    Wow... that's a really weird one! I'm afraid I've got no idea what would cause that, there shouldn't be anything in the shader able to break compilation so badly.

    Are you able to upload a copy of your entire project to something like WeTransfer? If so I can try to replicate the issue and see if there's anything obvious, but I'll warn ahead of time that this sounds very strange and I don't know if I'll be able to work it out.
     
  9. lethbridgestart

    lethbridgestart

    Joined:
    Apr 1, 2020
    Posts:
    3
    Just wondering if VRTP works with SteamVR? I've tried to add the component to the VRCamera in the Player prefab, but I can't even force the effect.
     
  10. Lyje

    Lyje

    Joined:
    Mar 24, 2013
    Posts:
    168
    It should work fine - can you screenshot the hierarchy? What render pipeline are you using?
     
  11. MiroMarionette

    MiroMarionette

    Joined:
    Nov 5, 2020
    Posts:
    9
    Hello! So we are using the Universal Rendering Pipeline and we can't get the tunnelling to work in either version 1.2 or 1.4. It does not work in the example scene, with the CONSTANT or any other way/settings. We are using SteamVR and Unity version is 2019.4.1f1 and on a different project with the default RP, it works.
     
  12. Lyje

    Lyje

    Joined:
    Mar 24, 2013
    Posts:
    168
    The regular VRTP Tunnelling component currently requires the default render pipeline. To use VRTP with URP you must use the Tunnelling Mobile component - adding native URP support is on our roadmap but we don't know when it'll be available sorry!
     
  13. MiroMarionette

    MiroMarionette

    Joined:
    Nov 5, 2020
    Posts:
    9
    That's alright. You were right that the Mobile component works with the URP, but it doesn't really work with the Skybox enabled. When using any Skybox I can see it only on the Left Eye and it is moving together with the headset (it is not saying stationary/static), which kind of defeats the purpose of decreasing motion sickness. On the Right Eye all I see is just a blue colour when using for example VRTP_Skybox_CageWithSky (or any of the other ones). Currently on version 1.4.
     
  14. Lyje

    Lyje

    Joined:
    Mar 24, 2013
    Posts:
    168
    That's strange - are you using multi pass, single pass or single pass instanced? Does the issue go away if you switch to a different setting?
     
  15. MiroMarionette

    MiroMarionette

    Joined:
    Nov 5, 2020
    Posts:
    9
    We are using Single Pass, but changing it has no effect. These are the settings I have put on the component and the results we get on our main scene.

    Untitled.png Untitled2.png
     
  16. Lyje

    Lyje

    Joined:
    Mar 24, 2013
    Posts:
    168
    Could you post your project settings please? Which SteamVR version are you using? Asset or XR plugin?
     
  17. MiroMarionette

    MiroMarionette

    Joined:
    Nov 5, 2020
    Posts:
    9
    So we are using the old version Asset SteamVR
    # SteamVR Unity Plugin - v2.5 (sdk 1.8.19)

    Here are some pictures of our settings but I have also attached a copy of our Project Settings Asset.
    Graphics.png Graphics.png Pipeline.png render.png Settings.png
     

    Attached Files:

  18. Lyje

    Lyje

    Joined:
    Mar 24, 2013
    Posts:
    168
    I've reproduced the issue - taking a look at a fix now.
     
  19. Lyje

    Lyje

    Joined:
    Mar 24, 2013
    Posts:
    168
  20. MiroMarionette

    MiroMarionette

    Joined:
    Nov 5, 2020
    Posts:
    9
  21. Lyje

    Lyje

    Joined:
    Mar 24, 2013
    Posts:
    168
    Great, thank you for the feedback! I'll aim to get that into master soon.
     
  22. IgnisIncendio

    IgnisIncendio

    Joined:
    Aug 16, 2017
    Posts:
    223
    Just wanted to say THANK YOU for this commit. I was using the Asset Store version, which didn't contain this fix, so I actually started to go and try and hack in single-pass URP support myself, to no success :p It's all shader black magic to me haha!

    Then I chanced upon this forum post, downloaded master, realized it wasn't in master, downloaded dev, and lo-and-behold, it just works!

    This is an amazing asset. Thank you.

    Though I have one question. How does this affect performance on the Oculus Quest 2? I heard that it doesn't handle transparency very well... and isn't the mobile version a giant transparent mesh in front of the camera? Wouldn't that be bad for performance on Quest 2?

    Running on URP single-pass mock HMD:

    upload_2021-3-15_15-3-27.png
     
  23. Lyje

    Lyje

    Joined:
    Mar 24, 2013
    Posts:
    168
    No problem!

    I've been meaning to get that commit into master and onto the asset store for ages now - in my defense I've got a baby now so things have been a bit slow haha!

    Believe it or not, you will usually see performance increase while VRTP is active on Quest and Quest 2. It's actually not (mostly) a transparent mesh - there are two meshes, the outer solid section and the inner transparent section, which is only as wide a ring as the feather requires. The clear section in the middle is not covered by the mesh at all.

    The reason it usually increases performance is I draw the outer solid mesh before the rest of your scene at the near clip plane, so all pixels from your scene in that area fail the z-test immediately, eliminating overdraw.
     
    IgnisIncendio likes this.
  24. bugdomxd

    bugdomxd

    Joined:
    Apr 27, 2020
    Posts:
    2
    Hello,
    Your asset looks great! I would like to ask if it is possible to have a color vignette only for one side (left or right) of the screen?
     
  25. Lyje

    Lyje

    Joined:
    Mar 24, 2013
    Posts:
    168
    Thank you! I'm not entirely sure what you mean - per eye? Half of each eye? Different colour on each? Vignette only on one?

    Whichever the particular combination you mean, the simple answer is no - however, if you've got code and/or shader experience, depending on what you want it might be relatively easy to modify VRTP to do it if you poke around in the code and docs.
     
  26. bugdomxd

    bugdomxd

    Joined:
    Apr 27, 2020
    Posts:
    2
    Thanks for your reply. Sorry for being unclear, I try to explain it better. What I need to do is to have two seperate vignettes, one for left half of the screen and one for the right. So each vignette only affects one half of the screen of each eye. In the quest application Im working on there is a 90 degree turn every few seconds, so when turning left I need a vignette active on the right half of each eye and vice versa.

    I have little shader experience and with my own shader I don't get an acceptable result. But I will have a further look into the VRTP code and try to make something work.
     
  27. Lyje

    Lyje

    Joined:
    Mar 24, 2013
    Posts:
    168
    If you use the mobile version of the effect, you might be able to alter the iris mesh - cut it in half, then rotate it 180 degrees around the camera z vector depending which side you need at any given time. If you do, make sure to preserve the vertex colours of the mesh!
     
    bugdomxd likes this.
  28. njwoodthorpe

    njwoodthorpe

    Joined:
    Aug 1, 2020
    Posts:
    3
    Hey! This doesn't seem to work with Oculus Multiview rendering mode. I've switched to Multi pass for now and it's working as expected. In multi view the whole screen just fills with white, in Unity 2019.4.19f1.

    Is there a way I can make this work in multiview mode? Not a huge deal, still an awesome asset :)
     
  29. Lyje

    Lyje

    Joined:
    Mar 24, 2013
    Posts:
    168
    Hi - if you grab the dev branch from the github this should be fixed!
     
    njwoodthorpe likes this.
  30. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    4,396
    Hey, I used the 1.4 release on github and it also worked fine. Is there a reason there is a 1.4 version on github, but on the Unity asset store the latest version is 1.2?
     
  31. Lyje

    Lyje

    Joined:
    Mar 24, 2013
    Posts:
    168
    Yeah, apologies - I just really haven't been able to find the time for ages! I've been meaning to do it for a long time.
     
    DevDunk likes this.
  32. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    4,396
    No problem, I totally understand. I was just wondering if there was a specific reason for it
     
  33. njwoodthorpe

    njwoodthorpe

    Joined:
    Aug 1, 2020
    Posts:
    3
    So it's all working fine on multiview now, but we're noticing an issue where it's causing _tons_ of GPU usage, but nothing odd is slowing up in our profiles. On Quest 1 it causes 99% GPU usage on level 4, and quest 2 it causes a 20-30% GPU usage increase. Any idea what might cause this? It causes the game to be unplayable on Quest 1. We're on Unity 2019.4.26f1.

    A deep profile:


    The render stats:


    Thanks :)
     
  34. Lyje

    Lyje

    Joined:
    Mar 24, 2013
    Posts:
    168
    To clarify - are you using the Tunneling Mobile component?
     
  35. njwoodthorpe

    njwoodthorpe

    Joined:
    Aug 1, 2020
    Posts:
    3
    Oh we're using the regular Tunneling component. That probably explains that :D I'll look into using the mobile component instead.
     
  36. HAIRGROW

    HAIRGROW

    Joined:
    May 17, 2013
    Posts:
    17
    Has OpenXR been considered when using VR Tunneling Pro?

    I've recently upgraded my project to Unity 2020.3 in order to take advantage of using OpenXR. Thus far every thing has ported fairly well, but now that I'm looking into reimplementing VRTP, with OpenXR, I've notice some issues with the camera.

    For instance, the VRTP settings won't take affect upon scene start up. Once the scene does start, I have to toggle the component on and off before they take affect.
     
  37. Lyje

    Lyje

    Joined:
    Mar 24, 2013
    Posts:
    168
    VRTP hasn't yet been tested with OpenXR I'm afraid. What rendering pipeline are you using? Are there other issues you've noticed?
     
  38. HAIRGROW

    HAIRGROW

    Joined:
    May 17, 2013
    Posts:
    17

    Hey there, I do apologize. I know it's been like 2 months since I asked my question, but I once I worked in a small hack to get it to work, I actually forgot I even asked. But in response to your question, currently I'm not using a render pipeline at the moment of prototyping, but in the end I do plan on using the Lightweight render pipeline.

    I haven't notice any other issues beyond my specific use case for VRTP. There's tons of other features I haven't touched yet. I'm specifically using just the Angular Velocity, Linear Acceleration, and Linear Velocity, under Motion Detection.

    Since using OpenXR I have to leave the component disabled, upon application start. If the user wants vignetting for camera comfort, it has to be turned on before it takes affect. If the component is enabled upon application start, everything is black.
     
  39. Lyje

    Lyje

    Joined:
    Mar 24, 2013
    Posts:
    168
    Interesting! Not sure why it would be doing that but glad you found a workaround. Due to time constraints I can't really go deeper into OpenXR right now unfortunately but I'll add it to my list of things to eventually test!
     
  40. NineDGuy

    NineDGuy

    Joined:
    Nov 5, 2017
    Posts:
    1
    FWIW same here on the issues with OpenXR

    If Tunneling is on one of my eyes is fully white and the other is fully black

    Experimenting with HAIRGROW's method now but it doesn't seem to help to turn it on after the fact.

    Edit: More accurately, it's freezing the frame visually to some extent. I have a system where I swap cameras and if I swap from another camera to one with the tunneling on it jitters between the frame and the white/black thing but if I start with the one that has it then it just stays on the white/black.

    Edit 2: Looks like mobile works (with or without it being enabled initially) but it only works on the left eye which partially explains why on the other version one eye was white and the other was black. The black eye was the frozen image of the first frame, the white eye was the effect trying to render but failing / causing both to freeze.

    Edit 3: Changing the render mode to Multi-Pass in the OpenXR settings did the trick. Now I can use either mobile or standard and it's rendering in both eyes.
     
    Last edited: Feb 17, 2022
  41. Lyje

    Lyje

    Joined:
    Mar 24, 2013
    Posts:
    168
    Currently working on an OpenXR project and hoping to fix some of these issues (although not currently able to reproduce the exact same thing). Can't promise when it'll make it back into the GitHub right now though!
     
  42. TheSheyper

    TheSheyper

    Joined:
    Jul 3, 2013
    Posts:
    21
    Hello !
    I'm using the 1.4 from github (Master not dev branch)
    Tunnelling works well on PC and Quest 2 but I had to make a fix in TunnellingMobile.cs
    I commented this (line 276 to 282)
    Code (CSharp):
    1. //Find a layer the camera will render
    2. int camLayer = 0;
    3. for (int i = 0; i < 32; ++i)
    4. {
    5.     camLayer = 1 << i;
    6.     if ((_cam.cullingMask & camLayer) != 0)
    7.     {
    8.         break;
    9.     }
    10. }
    as it gave me an error (camLayer was equal to 32 so Unity did not like it)
    I exposed camLayer as an explicit parameter in the inspector instead.
    Not sure why I got this error, maybe because I use 2 differents TunnellingMobile on 2 differents camera. And I, sometimes, active/deactive gameobjet and enable/disable TunnellingMobile script but strange that this small piece of code did not work.
    It works for me now and I don't have time to investigate more right now, so... That it!
    Thanks for this great asset
     
  43. junnyboi

    junnyboi

    Joined:
    May 8, 2020
    Posts:
    1
    Thanks NineDGuy! Changing to multi-pass did the trick for me too :)
    And thanks so much Lyje for making this free for the community to use, I was getting motion sick testing my own games before this haha ><

     
  44. C0ND3RS

    C0ND3RS

    Joined:
    Dec 2, 2016
    Posts:
    4
    I am having exactly the same issue!

    Trying to develop for Quest, using Unity 2020.3.30f1 and the Tunneling Mobile script.
    It only works for the left eye with no effect at all on the right one.

     
  45. C0ND3RS

    C0ND3RS

    Joined:
    Dec 2, 2016
    Posts:
    4
    The issue is that VRTP does not support single-pass stereo on mobile platforms. I guess what was happening is OpenXR was using single-pass stereo instead of multi-pass. Thanks for the fix!

     
  46. Liam-C

    Liam-C

    Joined:
    Mar 6, 2017
    Posts:
    17
    I had a hard to debug issue with the tunnel effect flickering when I walked forwards using smooth locomotion. Just sharing this here in case it helps anyone else.

    I'm controlling the scale of the tunnel effect manually based on locomotion and turning inputs and it was working well, except when smooth locomoting forwards. For some reason, it was flickering when moving forwards close to the Vector3.right and Vector3.left directions in world space.

    These days, with OpenXR and the Unity XR Interaction toolkit, it's common practice to update the player's head position in OnBeforeRender, so that your head position receives the most up-to-date input information and thus less latency. My tunnel was rendering, but my head was translating beyond the tunnel after the irises had been drawn. My fix was to move the logic for drawing the irises from LateUpdate in TunnellingMobileBase to BeforeRender in TunnellingMobileURP. I draw the irises before BeforeRender calls UpdateEyeMatrices and ApplyEyeMatrices.
     
  47. spuchals

    spuchals

    Joined:
    Sep 29, 2018
    Posts:
    8
    Hi, Thank you very much for this powerful tool.
    Is there a method I could call when I make a snap turn to force a tunneling at that moment, WITHOUT overriding the normal behavior (angular velocity etc.).
    If I call Force Vignette by code, I guess I lose the other behaviors until I set it to None again?
    Thank you