Billboard Shader with Shadergraph

Hi,

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?
5066930--497939--upload_2019-10-14_17-56-29.png

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...
5103128--503309--upload_2019-10-24_18-39-58.png

This fitts all together and also handles Color and auto scale by distance...
5103128--503312--upload_2019-10-24_18-40-30.png

3 Likes

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.