Shader Graph restricted Billboard to one axis

Hey guys,

Can you help me out with “billboarding” a quad so that it can still be stretched forward with z axis scale.
Goal is to have it face the camera / view but be transformed what would be a local z rotation.

I started of with the mentioned billboard shader resulting in translating everything as if it was rotated on x by 90 degrees.
I cant figure out how to keep if flat like the one next to it seen here on the second screenshot.

Picking up from here: (thanks for pointing out new question @andrew-lukasik )

https://answers.unity.com/questions/1621611/how-to-do-billboard-shader-with-shadergraphhow-to.html?childToView=1884561#comment-1884561

Graph below will rotate a default Plane mesh around it’s Z axis to always face the camera with Y+:

Graph to rotate a default Plane mesh around it's Z axis to always face the camera with Y+

preview:

Z axis billboard preview

→ Mesh scale is (1,1,2) here, hence a rectangle

[192140-billboardzshadergraph.zip|192140] <-<-<- BROKEN LINK


Bonus

Graph below will rotate a default Quad mesh around it’s Y axis to always face the camera with Z+:

graph to rotate a default Quad mesh around it's Y axis to always face the camera with Z+

1 Like

Because I’ve been here multiple times through search I would like to add another method which I reverse engineered from VFX Graph. It should be slightly more performant because it replaces the trigonometric arctan2 with cross products.
The orthographic / perspective switch in the front is rather a orient to camera position or to camera plane.