Shader Graph restricted Billboard to one axis
Asked Answered
T

1

0

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 @Bacteriostat )

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

Tris answered 31/10, 2023 at 11:47 Comment(0)
B
1

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+

Bacteriostat answered 18/3, 2024 at 9:24 Comment(2)

Thanks Andrew! I am investigating today to give you a proper feedback here. FYI: This takes so much longer than expected. For whatever reason unity is doing "nothing" with the shader on screen. I saw it working only one time.. idk why - cannot replicate. No errors besides the implicit truncation warnings from shader graph. So I get the very latest 2020.3 now and set up a new project to have a second look at it.

Tris

Andrew сan you suggest how to change this shader so that it is applied to each polygon instead of the entire mesh? Like grass on Terrain. I'm assuming it should be about Tangent Space, but I still can't get it right. Sorry for my stupidity, I'm new to Unity and really need some advice! Thanks.

Sanalda

© 2022 - 2025 — McMap. All rights reserved.