1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Unity ShaderGraphで任意のXYZ軸を固定したビルボードを作る

Last updated at Posted at 2023-04-25

前回の記事

概要

UnityのShaderGraphで任意のXYZ軸固定のシェーダーを作ります
前回のものより計算量が多め

作り方

前回表示した部分は省略
回転に使用する行列だけガラッと置き換えた

まず中段のノードでどの軸を固定にするか決める(今回はYなのでYを1に)
次にカメラからビルボードへのベクトルと固定軸の外積、更にその結果と固定軸をもう一度外積すれば、
UpとRightとForwardが揃うのでそれをMatixとして組み合わせる

前回と違ってメッシュに使っても問題ない

image.png
image.png

参考

参考になりました。ありがとうございます

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?