Billboard Shader URP

After googling three different solutions to this problem and wasting hours on it with last-ditch trial and error efforts I’ve decided to give up and request the help of people more patient and intelligent than me in the ways of shader magic.

Below you can take a look at the different attempts. I am beginning to suspect something might be wrong with my mesh. It’s made with ProBuilder and is basically just a circle (the top of a cylinder) with an X made of 4 faces on top of it, rotated -90 degrees on the X-axis to have it stand upright on the edge.

The right-most note of each attached shader graph would then lead to the Vertex Position input of an Unlit Master node.

Unity 2019.3.9f1
URP 7.3.1

1 Like

I actually have the same issue as paulindrome with creating billboard shaders in shader graph. There seem to be so few quality solutions out there for this that ACTUALLY work…

I’ve tried some of the same solutions you’ve tried. Ended up with this variation (attached bellow). It works for a mesh that is just a single quad. But as soon as I have many quads in a single mesh it starts rotating funny (as illustrated in the video).

Has anyone figured this out? I’m pulling my hair out…

5851222–621550–tree_package.unitypackage (168 KB)

I have currently resorted to using a script to rotate the entire object in the direction I need.

public class RotateTowardsCamera : MonoBehaviour {
    Camera main;

    void Awake() {
        main = Camera.main;
    }

    void Update() {
        transform.LookAt(main.transform, Vector3.up);
    }
}

Which just feels cheap and doesn’t scale. Lucky for me, it’s only a few objects in the scene and no big deal. Still, a working billboard shader should be something easily achievable with Shader Graph but for some reason, it eludes me.

This one worked perfectly for me

Edit: Ah, I see that you have this solution in one of your screenshots…

2 Likes