![unity 2019 shadow cascades unity 2019 shadow cascades](https://user-images.githubusercontent.com/37893722/41138962-17b45700-6b28-11e8-997b-413d9d3f1e92.png)
Maintain spatial transformation information for all objects with SDF, detect the activation of objects per frame (GameObject.activeSelf) and whether the transformation occurs (Transform.isChange), and, if so, trigger update events GDF is a low-resolution Custom Render Texture size of 64^3 or 128^3 This operation only needs to be performed once. If there are 3 x 64^3 SDFs in the scene, the texture size is 64圆4x192. The equal width (actually the exact same dimension) SDF Texture is injected into a separate Texture3D and passed to the GPU end. The implementation of runtime Global Distance Field (GDF) is in DistanceFieldAtlas.cs:Īt the beginning of execution, detect all objects in the scene that include SDF components, cache their SDF instances, and weight them according to the SDF file name used You could even use it to implement bakers for something else. The class diagram of SDFBaker is shown above, the basic interfaces are already provided, and SDF baker is just one implementation of possible baker on this framework. SDFBaker bakes out SDF data for the collection of all mesh under this object, ant it is offline, and the baking results are written to disk for reuse and instantiation of object. SDFBaker.cs a monobehavior script that can be attached on objects with mesh or children containing mesh
![unity 2019 shadow cascades unity 2019 shadow cascades](https://catlikecoding.com/unity/tutorials/custom-srp/directional-shadows/cascaded-shadow-maps/cascade-first.png)
SDF’s application in 2D space is mainly font rendering, proposed by Valve in 2006.Īpplications of SDF in 3D space include collision detection, model representation and deformation, ambient occlusion, soft shadowing, etc.