No Shadows in Unity 5.50
Hello,
It looks like I can't get shadows to work properly with the lab renderer and unity 5.5. This is true even with the example scenes provided by valve.
Most of the time there is no shadow but there are certain limited situations where I can get some small area of shadow with weird artifacts:
- For point lights, if the meshes are very close to the light (under 2 meters) and at a certain angle I always get a big "square" shadow right under the light source and objects near the light might cast shadows. Making any changes to the radius / other parameters doesn't change anything. None of the point light demo scenes provided by Valve cast shadows.
- For directional lights, no shadows 99% of the time but in the valve directional demo scene (with moving directional lights), there is shadow (with same strange behavior as the point light) when the light is at certain angles. Making any changes to directional light parameters in the valve screen doesn't fix the problem.
Sorry but have no idea how rendering/shading/graphic programming works (I mostly understand logic programming/application) so it's hard for me to look at the source code and see where the problem is but I can provide any information that you might need.
I noticed this as well. I haven't pinpointed exactly what's causing this issue yet. I recommend reverting back to version 5.4.0f3 to avoid this a few other bugs.
Okay, it seems something got shifted internally. Luckily it's a simple fix.
In the vr_lighting shader change this: float objDepth = ( vPositionTextureSpace.z );
Into this:
float objDepth = 1 - vPositionTextureSpace.z ;
Works fine. Also, make sure you fix the flickering adaptive rendering bug. https://github.com/ValveSoftware/the_lab_renderer/issues/13
Hi Kevin,
Thanks for taking the time to look into this, you my man are a superstar! I'll give it a try either tonight and tomorrow. If I can get the Lab Render to work without reverting back to 5.4.0f3 version of Unity it would be a huge deal for me since Unity seems to have added a lot of VR features/support since 5.4.0f3.
I just tried the fix you mentioned in this issue and also fix #17 and it all works beautifully!!! Thanks again. I still can't believe how much better it looks with Lab Renderer implemented.
Wonderful! Soo easy fix, maybe not that easy to find though? Maybe worth a new PR that combines fixes for Unity 5.5 and the flickering issues?
Unity 5.6.2 has the same problem even after changing the script. Nothing cast shadows. Is there something else we can check to see why shadows don't appear at all?