Shadow map generation
Last updated
Last updated
Easy AR gives you a new scene for shadow map generation of 3d objects in unity editor. We can use default shadows projection by directional light. But sometimes shadow took hard & random patterns. But after research we found a better way to implement a contact shadow map similar to IOS usdz shadow. So you can create your own smooth shadow map for 3d models using Easy AR. You are guided in this section, how to build this contact shadow.
First you move to the ShadowBake scene in the EasyAR->Utilities folder.
Hope you added your 3d model to the EasyAR->Meshes folder. For example we take our chair model to generate contact shadow.
Drag & drop 3d model (chair) to child of DragTheObjectAsChild game object in hierarchy.
Then click the 3D model(chair) & go to the inspector. Check the static block of the 3D model.
Select BackShadows gameobject & go to inspector. Under General Lighting Script there is a button called Generate shadow. Click that button.
You can see the process will generate a smooth contact shadow after a few seconds.
Now you can collect this contact shadow prefab in the EasyAR->Prefabs->ShadowPlanes folder. Here Chair142157_Shadow is our newly created shadow map.
In the Materials folder you can find that contact shadow’s material & Textures folder texture of contact shadow with the same name as prefab saved.
Now you can add this contact shadow to your gameobject prefab. Select the 3d model prefab (chair prefab) & put it as a child of the 3D model prefab. Then adjust the shadow as you wish.
Now you can see the smooth contact shadow....