The Mixed Reality Forums here are no longer being used or maintained.
There are a few other places we would like to direct you to for support, both from Microsoft and from the community.
The first way we want to connect with you is our mixed reality developer program, which you can sign up for at https://aka.ms/IWantMR.
For technical questions, please use Stack Overflow, and tag your questions using either hololens or windows-mixed-reality.
If you want to join in discussions, please do so in the HoloDevelopers Slack, which you can join by going to https://aka.ms/holodevelopers, or in our Microsoft Tech Communities forums at https://techcommunity.microsoft.com/t5/mixed-reality/ct-p/MicrosoftMixedReality.
And always feel free to hit us up on Twitter @MxdRealityDev.
Shadow catcher or Matte shadow shader
Hello,
Is anyone using a Shadow Catcher shader in any of their Hololens projects ?
I have a feeling more people will ask for such functionality.Especially those of us coming from VFX.
The image below illustrates what I'm trying to describe:
http://www.roadtovr.com/wp-content/uploads/2015/01/hololens-vid-0.jpg
The image might be an artistic impression and a Post Processed render but those shadows really ground / Anchor the hologram onto the table.
A video in blender that illustrates the process:
https://www.youtube.com/watch?v=99NTQUUGWUY
Any Unity shader wizards around here who can write a shader that only renders shadows being cast on an object (ideally a plane) and renders everything else transparent ?
Thank you,
b
Best Answer
-
Optionsthebanjomatic ✭✭✭
Shadows are tricky on hololens because of the way black renders as transparent (being an additive display). The "designing for mixed reality" page mentions the following technique where you simultaneously light the surface mesh and then cast regular shadows:
"Many designers have found that they can even more believably integrate holograms by creating a "negative shadow" on the surface that the hologram is sitting on. They do this by creating a soft glow on the ground around the hologram and then subtracting the "shadow" from the glow. The soft glow integrates with the light from the real world and the shadow grounds the hologram in the environment."
https://developer.microsoft.com/en-us/windows/holographic/designing_for_mixed_reality
6
Answers
Shadows are tricky on hololens because of the way black renders as transparent (being an additive display). The "designing for mixed reality" page mentions the following technique where you simultaneously light the surface mesh and then cast regular shadows:
"Many designers have found that they can even more believably integrate holograms by creating a "negative shadow" on the surface that the hologram is sitting on. They do this by creating a soft glow on the ground around the hologram and then subtracting the "shadow" from the glow. The soft glow integrates with the light from the real world and the shadow grounds the hologram in the environment."
https://developer.microsoft.com/en-us/windows/holographic/designing_for_mixed_reality
Thanks banjomatic.
I'll have a look at the linked document.
(I have not dealt with how to light the scanned environment mesh so that's the next learning step for me )
In the spirit of sharing with the community, please also have a look at Brandon Fogerty's (Unity) solution over at the Unity HL forums.
http://forum.unity3d.com/threads/shadow-catcher-or-matte-shadow-shader.414418/#post-2703373
Brandon made a shader that may be helpful as well.
Cheers,
b