How to do billboard shader with Shadergraph
Asked Answered
P

5

0

Hi, I’m having trouble with creating a billboard shader with shadergraph. It is for a simple quad with a texture and I want all axis to align with view, so it should look exactly like a particle with view render alignment.

This is what I got so far. In general it seems to work, but the object is rotating a little bit (and sometimes scaling, depending on the view direction), if I rotate the camera when near the object.
Anybody know what’s going on here? What am I doing wrong and how can I fix it?
Thank you.

Pocketbook answered 15/11, 2023 at 19:16 Comment(0)
T
0

Here is a subgraph solution I made based on the

Toothlike answered 6/6, 2023 at 4:30 Comment(1)

I've tried a lot of approaches and really want to get it to work. One question regarding this one: I always get "'cross': implicit truncation of vector type" when I try to use this as the vertex position, the typical workarounds don't work for me. Do you have any ideas on how to solve this?

Bhayani
M
0

Hi, to fix rotation you need to do to this.[143768-безымянныи.png|143768]
That’s because you’re using Quad. It doesn’t use the same axis as cube does, for example. You need to change axis to fix this. And rotate it if it needs.

Metrify answered 30/7, 2019 at 23:13 Comment(0)
T
0

Here is a subgraph solution I made based on the

Toothlike answered 6/6, 2023 at 4:30 Comment(1)

I've tried a lot of approaches and really want to get it to work. One question regarding this one: I always get "'cross': implicit truncation of vector type" when I try to use this as the vertex position, the typical workarounds don't work for me. Do you have any ideas on how to solve this?

Bhayani
I
0

to fix rotation you need to do to this

Intercostal answered 6/6, 2023 at 4:43 Comment(1)

This will "billboard" any mesh with rotation (0,0,0) and uniform scale: ![alt text][1] It calculates "look at camera" rotation and applies it to vertex, normal and tangent. [1]: https://i.imgur.com/LpECGOq.jpg

Palatal
P
0

This graph will “billboard” any mesh with rotation (0,0,0) and uniform scale:
mesh look at camera shader graph

It calculates “look at camera” rotation and applies it to vertex, normal and tangent.

Palatal answered 3/3 at 20:49 Comment(0)
A
0

Thank you guys for pasting those, very elegant.
Maybe you can you help me in the right direction based on the mentioned billboard shader?

posted a flollowup on this here:

Alimony answered 31/1, 2022 at 19:22 Comment(1)

I suggest posting this as a separate question

Palatal

© 2022 - 2024 — McMap. All rights reserved.