Billboard Shader with Shadergraph


I wan't to create a spherical Billboard Shader in Shadergraph.

I tryied severel things and nothing worked :(

Can someone help me please?

This is a good question! I can't get any billboarding to work because when I use the "Position" set to object space, it gives an inconsistent number when I clone the objects. It seems they broadcast a shared position between all of the objects under that drawcall? I have tried separate materials and it works, but then I lose the ability for it to run fast.

Here's what I have. It's a vertical upwards billboard using some basic trigonometry. But it fails when I add clones of objects. This is so frustrating. I must be taking the wrong approach? What do you think?

Actually, it seems to work if I don't use sprites. Just Use 3D Geometry and it works.:hushed:

Thank you for your answer! I've already found a solution some time ago.

How did you do it? I managed to make a spherical one using the “Rotate About Axis” node twice, but I get wrong rotations when the camera is upside down. Also, the object’s transform rotation must be 0,0,0 for it to work.

Here is how I managed the spherical rotation. It works pretty well.
A note by the way: It also scales proportional with the distance to the camera

This is part builds the 4x4 rotation matrix which is multiplied with the position of the vertex.
It's the most importent part...

This fitts all together and also handles Color and auto scale by distance...


There is a problem with the billboard algorithm upstairs

1 Like

There is an error with the graph, in the very beginning, there is no need to multiply the camera direction by -1.
In this case, the Quad mesh will not be rendered from it’s back.