Skip to main content

Posts

Rendering Lights and Shadows in AR - The Projector Method

I talked about the problems of rendering light and shadows in AR with Unity3D and Vuforia in my previous post - Rendering Light and Shadow with Unity in AR . In the post, I also developed a method using Post-Effect to do the light and shadow rendering. However, the Post-Effect method is doable. But since Unity can't separate an object and its shadow into a different layer. So you have to make a copy to an object if you want to render its shadow in AR. That is very problematic. The performance is bad (though I didn't test it, but it should be), and the most annoying is it mess up the Hierarchy. So I tried to develop another method. And after several tests, I found a solution using the Projector in Unity's Standard Assets Package. And this projector method is the solution I implemented in all my A Week A Project AR series. (the Post-Effect method only use in the Paper House Demo ) This Projector method is simple. You need to build the 3D model of the environment, and cr
Recent posts

Rendering Light and Shadow with Unity in AR

    Lights and shadows are very important. The lack of shadow will make a scene looks not real. The picture below shows the difference, you can't really tell is the man standing on the plane or floating in the air, if there is no shadow. With and without shadow makes a big difference     You can see the difference in 3D, so it definitely affect a lot in AR. This article will guide you how to render lights and shadows with Unity and Vuforia SDK. And I think the idea should also work on other SDK or game engines. Problem     In Unity, if you want to render lights or shadows, there has to be a mesh. But we add a mesh on, we can't see the camera's view. With the plane, I can't see the desk's surface     I also tried with transparent material, but the shadow can't cast on it. (at least not with Unity's standard shader, maybe some custom shader can do it) With transparent material, we see the desk's surface, but there's no shadow