Search Unity

How to make a shader that always turns into the direction of the camera?

Discussion in 'Shaders' started by craig4android, Jun 14, 2019.

  1. craig4android

    craig4android

    Joined:
    May 8, 2019
    Posts:
    124
    Code (CSharp):
    1. v2f vert (appdata v)
    2.             {
    3.                 v2f o;
    4.                 o.vertex = UnityObjectToClipPos(v.vertex); //guess here should happen something
    5.                 o.uv = TRANSFORM_TEX(v.uv, _MainTex);
    6.                 return o;
    7.             }
    this should help also: https://docs.unity3d.com/Manual/SL-UnityShaderVariables.html

    but I have no idea how to make it happen. :(
     
  2. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,348
    Search for billboard shader.