2019-01-01から1年間の記事一覧

shaderでよくある計算をビジュアライズしたgif

shader forge作者の方のtweetより。 ドット積 (内積) 大きさ1のベクトル同士でドット積を取る時、1 〜 -1の範囲を取る。 同じ方向なら1 直角なら0 反対方向なら-1 dot product - visualized ⚪the dot of two normalized vectors, as shown here, can say how…

よくある計算をグラフで見る

pow shaderでpow計算する事が良くあります。 powする事で値がどう変化するのかを、グラフで見るメモ。 の変化 https://www.desmos.com/calculator/dp5qheqr5n の変化 https://www.desmos.com/calculator/1w0sdd504l の変化 https://www.desmos.com/calculato…

Plant UMLでクラス図を描く セットアップ編

アプリをダウンロード ダウンロードのページ Last version : plantuml.jar をDLしてくる。 /Applicationとかに入れておく。 準備 DLしてきたplantuml.jarを開く。 これから作業するためのフォルダを作る。 画面下のボタン「Change Directory」を押す。 popup…

Depth Fadeで背面にある物体との距離を取得する

Depth Fadeと呼ばれている手法について紹介します。 Unity Products:Amplify Shader Editor/Depth Fade - Amplify Creations Wiki [https://wiki.unrealengine.com/Visual_Effects:Lesson_02:Using_Depth_Fade:title] こちらのチュートリアルに大変お世話に…

PostProcessingStack v2にて、各種設定をランタイムで変更する

[SerializeField] private PostProcessVolume _ppVolume; void Start() { Bloom bloom; _ppVolume.profile.TryGetSettings(out bloom); bloom.threshold.value = 3f; }

数式をグラフ化する。Grapher(macアプリ) と desmos(webサービス)

最近知りましたが、macには標準でグラフを描くアプリが入っていました。 これでガウス関数を作ってみます。 mac標準アプリのGrapher パラメータ化した値を操作して動かす事も出来る。 どんなパラメーターになるのか理解するのに役立ちそう。 しかし ちょっと…

PostProcessing Stackのカスタムエフェクトで解像度を下げる (ダウンサンプリングする) 方法

参考にしたソース https://github.com/Unity-Technologies/PostProcessing/blob/v2/PostProcessing/Runtime/Effects/ScalableAO.cs // AO buffer var rtMask = ShaderIDs.OcclusionTexture1; int scaledWidth = context.width / ts; int scaledHeight = cont…

PostProcessing Stack v2でカスタムエフェクトを作る

公式マニュアルはhttps://docs.unity3d.com/Packages/com.unity.postprocessing@2.2/manual/Writing-Custom-Effects.html 公式 APIドキュメント https://docs.unity3d.com/Packages/com.unity.postprocessing@2.2/api/ どちらもバージョンに注意。 使い方は…

unity C#でのpath取得関連メモ

project viewで選択中のディレクトリ取得 static private string GetSelectedDir() { foreach (Object obj in Selection.GetFiltered(typeof(DefaultAsset), SelectionMode.TopLevel)) { if (obj is DefaultAsset) { string path = AssetDatabase.GetAssetPa…

Unity2019.1 LWRPでのRenderScale、Renderer Featuresの並べ替え

パッケージマネージャーのLightwight RPは5.13.0を使用。 public ScriptableRendererData _data; public LightweightRenderPipelineAsset _asset; をinspecterで設定した後、動的に変更する。 using System.Collections.Generic; using UnityEngine; using U…