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. Voting for the Unity Awards are OPEN! We’re looking to celebrate creators across games, industry, film, and many more categories. Cast your vote now for all categories
    Dismiss Notice
  3. Dismiss Notice

[RELEASED] URP & LWRP Mirror Shaders

Discussion in 'Assets and Asset Store' started by AkilliMum, Dec 11, 2018.

  1. dreamerz_lab

    dreamerz_lab

    Joined:
    Jun 9, 2017
    Posts:
    3
    @AkilliMum, We are really appreciate that, about your supports, Thank you again. We will get back to you soon.......
     
  2. unity_j85F9sXoh3fwFQ

    unity_j85F9sXoh3fwFQ

    Joined:
    Jan 30, 2022
    Posts:
    4
  3. AkilliMum

    AkilliMum

    Joined:
    Dec 6, 2014
    Posts:
    107
  4. danielesuppo

    danielesuppo

    Joined:
    Oct 20, 2015
    Posts:
    331
    I'm working on VR scene for Oculus Quest2, and suddenly I got this error message:
    upload_2022-9-8_16-17-52.png
     
  5. AkilliMum

    AkilliMum

    Joined:
    Dec 6, 2014
    Posts:
    107
    Are you using DepthBlur etc.? It is not recomennded to use that on mobile or VR, that is very heavy. If your error continues please write me from "akillimum@gmail.com". we will solve it for sure...
     
  6. oliran

    oliran

    Joined:
    Sep 29, 2015
    Posts:
    48
    UPDATE: solved! I changed FOV in Mirror Manager to 60 (it was initially set to 0 because the documentation says it will auto adjust to match camera's FOV if set to 0).

    Hi, I'm using Unity 2022.3.5 and just bought this asset. Everything looks fantastic in editor, but when I build for Quest 2, the objects in the mirror move strangely when I move my head. Hard to explain, but if I close one eye (either one) it looks fine. With both eyes open, the objects move oddly in the mirror. This doesn't happen in editor even in VR, only in build. My set up:
    Mirror Manager script on only camera.
    Plane with Mirror material using ANMirrorTwoEyes shader.

    I'm using multipass. Here's Mirror Manager settings:
    upload_2023-7-24_12-27-14.png

    Any advice appreciated. Thank you!

    Note: I'm using Vulkan Graphics API. The situation is much worse when if I switch to GLES3 where the reflection is completely wrong.
     
    Last edited: Jul 24, 2023
  7. AkilliMum

    AkilliMum

    Joined:
    Dec 6, 2014
    Posts:
    107
    Good to hear the problem is solved. Actually forcing multipass is experimental and fov is used for clipping settings. Will look into your case though :)
     
  8. Immersive-Matthew

    Immersive-Matthew

    Joined:
    Mar 24, 2020
    Posts:
    137
    I am suddenly getting the error below despite the mirror working fine for weeks. Figured I must have just accidentally changed something to cause it so I went to a backup of my project and discovered the same error there too which was a big surprise as for sure it was working in that backup. So I created a new, blank Unity project, installed this mirror package and to my surprise...I am also getting the same error. WTF? I cannot get this asset to work in any version of Unity from 2020 through to 2023 suddenly whereas the first time I installed it, it worked fine. I am assuming something in Windows is messed up given the error is everywhere now, so I am about to reinstall Windows 11 to see if that solves it. Will report back, but in the meantime, posting in case someone has some insights here.



    Camera.GetStereoProjectionMatrix is returning an invalid valid value since the value has not been set.


    UnityEngine.Camera:GetStereoProjectionMatrix (UnityEngine.Camera/StereoscopicEye)

    AkilliMum.SRP.Mirror.CameraManager:Draw (AkilliMum.SRP.Mirror.RendererManager,AkilliMum.SRP.Mirror.RenderTextureManager,UnityEngine.Rendering.ScriptableRenderContext,AkilliMum.SRP.Mirror.MirrorMultiManager,UnityEngine.StereoTargetEyeMask,bool,bool) (at Assets/AkilliMum/SRP/Mirror/Script/MirrorManager.cs:1837)

    AkilliMum.SRP.Mirror.MirrorManager:RenderMe (AkilliMum.SRP.Mirror.MirrorMultiManager,UnityEngine.StereoTargetEyeMask,UnityEngine.Camera,bool,bool) (at Assets/AkilliMum/SRP/Mirror/Script/MirrorManager.cs:516)

    AkilliMum.SRP.Mirror.MirrorManager:RenderReflective (AkilliMum.SRP.Mirror.MirrorMultiManager,UnityEngine.Camera,bool,bool) (at Assets/AkilliMum/SRP/Mirror/Script/MirrorManager.cs:401)

    AkilliMum.SRP.Mirror.MirrorManager:ExecuteBeforeCameraRender (UnityEngine.Rendering.ScriptableRenderContext,UnityEngine.Camera) (at Assets/AkilliMum/SRP/Mirror/Script/MirrorManager.cs:372)

    UnityEngine.GUIUtility:processEvent (int,intptr,bool&)


    UPDATE: The mirror works just fine when I build to the Meta Quest Android headset. It only has this show stopper error when running in the Editor.
     
    Last edited: Oct 10, 2023
  9. AkilliMum

    AkilliMum

    Joined:
    Dec 6, 2014
    Posts:
    107
    Hi, not sure what can be the problem. Maybe when you want to run the game in editor via OculsuLink etc. editor may not be initializing the SDK. If you can create a small project with the error and send me; I can try on my PC.
     
  10. Immersive-Matthew

    Immersive-Matthew

    Joined:
    Mar 24, 2020
    Posts:
    137


    Thank you so much for the quick reply. Since I wrote the above I completed a fresh install of Windows 11 (nuke and pave) and the same error is occuring in Unity 2022.3.10f1 from a fresh, new project creation which has me wondering how I ever had it working. I suspect if you create a 2022.3.10f1 project yourself, you too will find the "Camera.GetStereoProjectionMatrix is returning an invalid valid value since the value has not been set." error occurring over and over again. If not, then here is my sample project with URP, XR Management and your mirror package all installed that generates this error when you play the scene "Mirror Shader Graph" in the editor.



    2022.3.10f1 project files: https://drive.google.com/file/d/1MNVjqngLHAIijnziKwvlbdRpYQUw6WCI/view?usp=sharing



    I also tried 2020.3.48f1 and while I am not getting the error, the mirror is not working out of the box with your "Mirror Shader Graph" scene (either of them).



    2020.3.48f1 project files: https://drive.google.com/file/d/1F29mDwe7BUMgILN8Tn6NOdaF9I3P-U-M/view?usp=sharing



    If I missed some step, I apologize for wasting your time, but I did have this all working before, and thus I am really confused as to why I am having these issues now.



    BTW, the cubes under StandartObjects are missing some script, but I am certain this is unrelated to the error as I had it all working before even with these missing scripts.
     
  11. Gaidzin

    Gaidzin

    Joined:
    Nov 14, 2012
    Posts:
    14
    Faced with a similar problem.
     
  12. AkilliMum

    AkilliMum

    Joined:
    Dec 6, 2014
    Posts:
    107
    Hi. Is that the "Camera.GetStereoProjectionMatrix is returning an invalid valid value since the value has not been set." again?
     
    Gaidzin likes this.
  13. Gaidzin

    Gaidzin

    Joined:
    Nov 14, 2012
    Posts:
    14
    Yes.
    2022.3.6f1 -force-d3d11

    upload_2023-10-17_11-52-41.png
     

    Attached Files:

  14. AkilliMum

    AkilliMum

    Joined:
    Dec 6, 2014
    Posts:
    107