Search Unity

[RELEASED] URP & LWRP Mirror Shaders

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

  1. Sheynes

    Sheynes

    Joined:
    Mar 27, 2017
    Posts:
    66
    Well, alright, got it.
    Thanks for the answer. Be sure to tell me, here or via mp, if you ever release a version HDRP compatible for VR, and i'll buy it.

    Have a good day !
     
    AkilliMum likes this.
  2. jorgeolothar

    jorgeolothar

    Joined:
    Mar 27, 2016
    Posts:
    26
    Any news on Vive support? Does the Steam Beta OpenVR support for Unity’s XR-Plugin change anything?
     
  3. AkilliMum

    AkilliMum

    Joined:
    Dec 6, 2014
    Posts:
    111
    Could not get vive yet. Sorry :( This corona thing broke everything.
     
  4. RoyalCoder

    RoyalCoder

    Joined:
    Oct 4, 2013
    Posts:
    301
    Last edited: May 20, 2020
  5. AkilliMum

    AkilliMum

    Joined:
    Dec 6, 2014
    Posts:
    111
    Good to hear that :) I will add that to docs. please email me if you have other questions. Regards.
     
    RoyalCoder likes this.
  6. Dreamback

    Dreamback

    Joined:
    Jul 29, 2016
    Posts:
    220
    Hi, how are we supposed to use this in VR? The instructions don't explain clearly, it says to put the script on "the camera", but there are three cameras in Oculus' OVRCameraRig: LeftEyeAnchor, CenterEyeAnchor, RightEyeAnchor. I ask because it's not working for me in VR, it works out of the corner of my eye but as I turn towards the mirror, the reflection gets covered up in blue (this is if I put it on either all three cameras, or just the left and right eye anchors).

    This is with Unity 2019.3.9, URP, Oculus Quest (choosing OculusVR as the device). I tried adding in the fake Skybox using the Standard/Invisible/Skyboxes shader.
     
    Last edited: Jun 23, 2020
  7. AkilliMum

    AkilliMum

    Joined:
    Dec 6, 2014
    Posts:
    111
  8. Dreamback

    Dreamback

    Joined:
    Jul 29, 2016
    Posts:
    220
    Thanks, the actual problem ended up being our axis - what was reflected looked correct, aside from weird blue blocking the image in VR, but switching the axis from red to red-negative fixed it up, got rid of the blue.

    It's a great package, lots of settings for tweaking performance.
     
  9. AkilliMum

    AkilliMum

    Joined:
    Dec 6, 2014
    Posts:
    111
    Good to hear that. It works according to object facing direction. Most of the time it is greenY positive. But it can change according to the model or exports (fbx) etc. So, may need to try every axis :)
     
    747423517 likes this.
  10. b4gn0

    b4gn0

    Joined:
    Jul 26, 2019
    Posts:
    119
    Hi AkilliMum, just a quick question before buying.

    Is it possible to add planar reflection to our existing water shader (written in shadergraph) using your forward renderer?
    We would just need the reflected texture, and we can blend it ourselves.
    Or, is there a way to use your shader inside a shadergraph shader?

    Thank you!
     
  11. AkilliMum

    AkilliMum

    Joined:
    Dec 6, 2014
    Posts:
    111
    Hi, please write me via akillimum@gmail.com we can find a way i suppose :)
     
  12. Backbrainer

    Backbrainer

    Joined:
    Jan 24, 2013
    Posts:
    2
    Hi,
    I recently bought the asset for a small project for Oculus Quest and it is finally working but with some flickering issues. In the bug fixes section it says that the reflections may flicker if Temporal AA is selected but it should work with any other type. I have been finding where to change this but so far I have only been able to disable MSAA completely (fixing the issue) but degrading dramatically the quality of the graphics.

    I'm using Unity 202.1.1f1 URP
     
  13. AkilliMum

    AkilliMum

    Joined:
    Dec 6, 2014
    Posts:
    111
    Hi, i will try a simple project with latest 2020. But it will be good if you send me a simple project with the error exists. Because it maybe related with an option you selected or another script or an effect etc. So i can find the problem easily. Please send it to me via akillimum@gmail.com
     
  14. Backbrainer

    Backbrainer

    Joined:
    Jan 24, 2013
    Posts:
    2
    Hello, and thanks for the quick response. I have it working now but it might be something to consider further. The flickering happens when antialiasing is enabled and Render every X frames is set to a value greater than 1.

    Because my project is a small VR simulation of my home, just to see how the renovations we are making would look, the performance hit is not so bad and I can still use it without skipping any frames but it might be a thing to consider for a new version of the asset.

    Great work btw!!
     
  15. AkilliMum

    AkilliMum

    Joined:
    Dec 6, 2014
    Posts:
    111
    Hmm, i suppose i may be missed something with RenderXthFrame option with VR :) thanks for the info, i will look into that. And please consider using reflectionProbes and myScript together (please look into MixBlackColorRefProbes scenes for samples). So you may gain very much performance with static objects comes from reflection probes but the moving objects from my script :) It actually mixes refProbes and realtime reflections as you can understand. Please write me if you can not get them work together.
     
  16. Passeridae

    Passeridae

    Joined:
    Jun 16, 2019
    Posts:
    395
    Hi!
    Do you have any plans regarding HDRP?
     
  17. AkilliMum

    AkilliMum

    Joined:
    Dec 6, 2014
    Posts:
    111
    I suppose there are planar ref probes there, is not that good enough for similar jobs?
     
  18. Passeridae

    Passeridae

    Joined:
    Jun 16, 2019
    Posts:
    395
    Aren't yours more performant? I mean, the ones you made support VR, interreflections, etc. Such stuff is generally not possible with HDRP planar reflections which kill almost 50% of your performance just for having one such planar probe in the view.
     
  19. AkilliMum

    AkilliMum

    Joined:
    Dec 6, 2014
    Posts:
    111
    Yeah maybe i have more options for optimization, i really did not checked the HDRP. If you are saying VR and mirror in mirror, yeah you maybe right.
    So if I come to your first question, I did not look into HDRP detailed yet. So i do not plan to move mirror to HDRP right now. As i know it does not have a rendersinglecam method etc for easy camera rendering (another cam). So if anyone know how to render another cam (dynamic) easily on a scene, it may help me :)
     
  20. angrydev

    angrydev

    Joined:
    Sep 20, 2018
    Posts:
    1
    Hi!
    Do you have any plans regarding Steam VR devices like HTC Vive, Valve index, etc, and if so, is there an approximate date when their support will appear?
     
  21. AkilliMum

    AkilliMum

    Joined:
    Dec 6, 2014
    Posts:
    111
    Please write me on akillimum@gmail.com , i can send you some test data
     
  22. ericbing

    ericbing

    Joined:
    Jun 27, 2016
    Posts:
    7
    Hi, there. I am working on a wood floor visualization VR project on Ouclus Quest 2. The reflection looks great so far, but can't achieve the effects as same as "Advanced depth and blur calculations" example above, and can't find any info about how to set it up.
     
  23. AkilliMum

    AkilliMum

    Joined:
    Dec 6, 2014
    Posts:
    111
    Hi, you can just copy the "camera shade" script from the sample scenes to your scene camera. And play with the values. But advanced depth blur maybe heavy for mobile kind devices!
     
  24. morphtekstreaming

    morphtekstreaming

    Joined:
    Sep 2, 2020
    Posts:
    7
    does it work with urp in 2020.2 unity ?
     
  25. AkilliMum

    AkilliMum

    Joined:
    Dec 6, 2014
    Posts:
    111
    Unity changed the shaders a little bit on 2020.2. But of course i will update it this weekend for 2020.2 changes. So you can be sure it will work :)
     
    ZenUnity and RoyalCoder like this.
  26. Autarkis

    Autarkis

    Joined:
    Oct 10, 2011
    Posts:
    318
    Great and fast support ! Can't wait for the 2020.2 upgrade ( just upgraded my project to it and realized it broke your asset.
     
  27. imranhoshimi

    imranhoshimi

    Joined:
    Jun 26, 2013
    Posts:
    1
    Nice Work. Will it work with curve up/down hilly roads?
     
  28. AkilliMum

    AkilliMum

    Joined:
    Dec 6, 2014
    Posts:
    111
    It is just a planar reflection. It would not work on curved objects, sorry.
     
    imranhoshimi likes this.
  29. RiccardoAxed

    RiccardoAxed

    Joined:
    Aug 29, 2017
    Posts:
    119
    Hi @AkilliMum, I'm interested in your package, especially for the "URP Rotatable Box Projection Probes" asset, and i would ask you a question.

    I'm working on a VR walk-through (for Oculus Quest) where I have a huge, rectangular indoor environment, with big windows on every side, and an equally big glass box in the center. My need is then for vertical reflections, on all four directions, so could your Box Projection Probes asset help me to achieve this effect, or is it somehow limited to horizontal (that is, a floor) or unidirectional reflections? And in such a case, could I use your mirror shader instead, for every glass surface in the room?
     
  30. tektonspace

    tektonspace

    Joined:
    Dec 28, 2016
    Posts:
    19
    Hi @AkilliMum, Thanks for the great asset. Its been a great help to our project.
    We've been working on VR project (Oculus Quest) based on URP, with Unity 2019.4.12.
    and I believe that I ve set all the options that is need for me to run VR projects.
    We are trygin to achieve perfect mirror reflection on a circular object.

    so, In the game view, everything looks okay.
    and even when I press play button, Mirror looks just the way I wanted.
    but once I build the game and play them,, the mirror is just washed away.
    its just bright and no matter what I do, I cannot find right solution.
    please see attached photo, and please shed some light on this issue! I ve been working for 3days figuring out this thing.
    thanks ahead!
     

    Attached Files:

    • 001.png
      001.png
      File size:
      718.9 KB
      Views:
      303
  31. AkilliMum

    AkilliMum

    Joined:
    Dec 6, 2014
    Posts:
    111
    It is quite a problem builds behave differently :) I can not tell what can be the problem. Can you prepare a different project with the same problem and send to me? (maybe a post process is on the way etc.). So i can test it (i have a quest) and solve it quickly.
     
  32. AkilliMum

    AkilliMum

    Joined:
    Dec 6, 2014
    Posts:
    111
    Hi, box projected reflection only reflects baked reflection. So if you have dynamically moving objects it will not work (also it reflects only probe box-touch areas like floor,ceiling and walls perfectly, other indoor environment may not be reflected perfectly.
    You can mix the reflections with realtime though. But realtime does not works with box shaped etc obejcts. It must be planar. But you can create your glass box with planes too :) So you need 6 planes and attach them on the sides :) And create a different reflection script for each side of the cube.But it may be a little heavy for the weak systems.
    I will demonstrate it with a simple sample videos.
    Here is a box projection reflections on a cube. So you can see all probe touched areas perfectly reflects without no performance hit, cause it is a baked probe:

    And here is the box projection baked probes (for room) and the realtime together (for the sphere only) with transparency. I simulated cube (only two sides with two planes) to tell how to create a reflective cube, hopefully you can understand the case:
     
    Last edited: Jan 14, 2021
    RiccardoAxed likes this.
  33. RiccardoAxed

    RiccardoAxed

    Joined:
    Aug 29, 2017
    Posts:
    119
    Thanks for your answers.

    I just need the usually baked environment reflections - not dynamic reflections from moving objects - so the box projected probes could work to me.

    The only issue I see is when you say "also it reflects only probe box-touch areas like floor,ceiling and walls perfectly, other indoor environment may not be reflected perfectly". That could be a problem, because I've several big objects inside the room, and I would see them reflected on the glass box in the center of the room. It all depends on that "may not be reflected perfectly", if it's a not-so-big issue it could work anyway, considering that the usually "infinite" probe projection doesn't work at all in an indoor environment.

    So I'll wait for you demo video then.
     
    Last edited: Jan 14, 2021
  34. RiccardoAxed

    RiccardoAxed

    Joined:
    Aug 29, 2017
    Posts:
    119
    Ok, I watched your videos and they clarifies a lot, thanks. The first one (LCRS on a Cube) is rather convincing and very close to my needs, the only element that I would watch in action is having some static object in the room, other than the ones incorporated in the walls-floor-ceiling, and see what happens to the reflection when you move the camera inside the room. I guess parallax will not work properly, but I would see if it stays somehow convincing.
     
  35. AkilliMum

    AkilliMum

    Joined:
    Dec 6, 2014
    Posts:
    111
    I may create a sample scene if you can send a screenshot to me and tell me how big are they (so i can simulate the the room similar to your room and set some other objects simlar to yours). So we can see how centered box reflects them. But as you said, if the cube is at the center and other objects are closer to walls; reflection will be good enogh. And the cube position is important too. Cause probes reflection point will be at the center of the room; cube's position must be there too to reflect other items beautifully :)
     
  36. tektonspace

    tektonspace

    Joined:
    Dec 28, 2016
    Posts:
    19
    Thanks for the quick reply. I will send you project through your gmail. thanks again.
     
  37. RiccardoAxed

    RiccardoAxed

    Joined:
    Aug 29, 2017
    Posts:
    119
    Here's four screenshot to give you an idea.

    The scene is just a rough draft: the environment is rather huge (70m. x 35m. x 6m. or 230ft. x 115ft. x 20ft.), and you can see the glass box (a parallelepiped indeed) in the center. It's a sort of art museum, and you can see the many panels hanging from the ceiling, or the big colorful structures on the other side. On every wall there is also a big window, that should reflect a little too.

    Room_1.png Room_2.png Room_3.png Room_4.png
     
  38. AkilliMum

    AkilliMum

    Joined:
    Dec 6, 2014
    Posts:
    111
    Oh my :) The scene is huge and elements are big and close to the reflective box. Probe solution may not work there. You should go for the realtime, what is the target device?
     
  39. RiccardoAxed

    RiccardoAxed

    Joined:
    Aug 29, 2017
    Posts:
    119
    First one is the Oculus Quest, next I'll have to port it on Android/iOS (ARCore and ARKit) and PC.
     
  40. AkilliMum

    AkilliMum

    Joined:
    Dec 6, 2014
    Posts:
    111
    I see, actually realtime reflection can be a little heavy for the mobile devices. Especially if there are more than one mirror. I suppose you should try and make your choice about real time or baked one.
     
  41. RiccardoAxed

    RiccardoAxed

    Joined:
    Aug 29, 2017
    Posts:
    119
    Ok, I've to think about it, anyway I believe that using multiple baked probes with box projection, and setting the reflection intensity to a mild level, maybe I could achieve a decent and passable effect, at least more consistent than the infinite projection.
    I'll have a go with it :)
     
    AkilliMum likes this.
  42. samshool

    samshool

    Joined:
    Sep 21, 2017
    Posts:
    31
    hello i just purchased your plugin and i was interested in the Rotatable Box Projection Probes! to create baked planar reflections. However i wasnt able to find the related scripts or samples in the imported files like the LCRS script or the URP locally corrected shaders. I downloaded the latest 3.31 from the asset store. Kindly help thank you!!
     
  43. AkilliMum

    AkilliMum

    Joined:
    Dec 6, 2014
    Posts:
    111
    It is there after 2019.3.1. Hope you are using a version after that.

    Upgrading may create import problems. So please look into the docs for "How to Update to 2020.2" section. It may help you to upgrade to other unity versions too. Please try that.

    I have created a new project with 2021.1.17 and imported the package, it imported everythig correctly and the shaders (and samples) are there. Please try again and write me on email if it fails again :) Will look into it together :)
     
  44. samshool

    samshool

    Joined:
    Sep 21, 2017
    Posts:
    31
    im using unity 2020.1.17f1 ...wont it be supported on this unity version? here ive attached my screenshot...tried the method in the docs for "How to update to 2020.2"...still no luck.
     

    Attached Files:

  45. samshool

    samshool

    Joined:
    Sep 21, 2017
    Posts:
    31
    Nevermind i think i got it to work!! thanks!! there were multiple asset store folders - asset store & asset store 5x...the 5x had the old files!
     
  46. samshool

    samshool

    Joined:
    Sep 21, 2017
    Posts:
    31
    HOWEVER.....after imported in correctly i tried to open the akilliMum/samples/srp/locallycorrected/scenes/interior or any other....the script attached to camera shows following error in all demo scenes...im able to see the baked reflections just fine but i get that error and also in console >>

    Could not create a custom UI for the shader 'AkilliMum/URP/LCRS/2019'. The shader has the following: 'CustomEditor = AkilliMum.SRP.LCRS.LCRSEditor'. Does the custom editor specified include its namespace? And does the class either derive from ShaderGUI or MaterialEditor?
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr, Boolean&)

    This is in unity 2020.1.17f1 URP

    QUICKUPDATE...this seems to work fine only in 2020.2...how can i get it to work in 2020.1!
     

    Attached Files:

    Last edited: Jan 27, 2021
  47. AkilliMum

    AkilliMum

    Joined:
    Dec 6, 2014
    Posts:
    111
    Actually i wrote the unity version wrong :) My test was same as yours 2010.1.17 :) anyway URP works in all unity versions after 2019.3.1 :)

    So maybe the URP version has some specific problem. what is the URP version? I already tested with an empty project with 2020.1.17 and all samples etc are fine.

    If you are getting errors again please write me via "akillimum@gmail.com". Or send me your email via private message :)
     
  48. hasseyg

    hasseyg

    Joined:
    Nov 16, 2013
    Posts:
    82
    Hi, I have a question about your 'URP Rotatable Box Projection Probes' asset, but since there is no forum for it, I am asking it here. In my project I have modular track pieces. The problem I am having is that when 1 track piece is in a tunnel and the other is outside, I am getting a visible edge, due to the different reflection probes they are using (as
    shown below). Do you think your asset would help fix this problem? and if not then do you know a way of blending 2 reflection probes across an object, so that one half is one probe and the other half is another. This is for a URP VR project, so I am unable to use SSR.

    thanks

     
  49. AkilliMum

    AkilliMum

    Joined:
    Dec 6, 2014
    Posts:
    111
    Hi, i can understand your problem but my shader does not blend the probes too. Actually i did not think about that before (someone did ask before too though). I may look into that but as it is now: the answer is no, sorry.
     
  50. hasseyg

    hasseyg

    Joined:
    Nov 16, 2013
    Posts:
    82
    Hi, yes I know your asset doesn't blend probes but I thought it may help, as it fixed the projection, so that the outside track piece would reflect the tunnel entrance at the side that connects to the tunnel, instead of reflecting the sky, which it does now. I have duplicated my project into an HDRP version and it seems to not be as much of a problem, but I will have to test the fps. If I revert back to URP then I will probably buy your asset anyway.

    thanks