Conical visual field

Use the shader graph to realize the conical field of view (HDRP)

 


    The project achieves visual cone effect.

    Examples of such effects include desperados and shadow tactics.
    It is implemented using an auxiliary camera depth texture. In actual use, the camera is installed on the soldier, so that the visual cone can accurately reflect the content that the character can actually see. Cone angle has several options, such as cone angle and color.


    The shader uses Decal technology to adjust the height of the cube to make it suitable for different terrain heights.

the solution to turning off shadows and Android can work normally. Attach a script to the main camera and the camera under the cube to work normally as follows: using System. Collections; using System. Collections. Generic; using UnityEngine; public class setupcamdp : MonoBehaviour { // Start is called before the first frame update public Camera zc; public Camera vc; void Start() { zc. depthTextureMode |= DepthTextureMode. Depth; vc. depthTextureMode |= DepthTextureMode. Depth; } // Update is called once per frame }