PixelSort
明るさ(0.298912R + 0.586611G + 0.114478B)が Threshold Min〜Max の範囲に入る連続した画素列を1つの区間とみなし、その区間内だけを明るさ順に並べ替えます。並べ替えはコンピュートシェーダー上のバイトニックソートで、行(または列)ごとに1回のDispatchで走ります。
- Enable — OFFで素通し。初期値ON(
Enable入力 /isUsingInput/currentIsUsing) - Direction — ONで水平(行方向)、OFFで垂直(列方向)。初期値ON。ノードUIのトグル名は「Horizontal」です(
Direction入力 /directionInput/currentDirection) - Ascending — 並び順。初期値ON(
Ascending入力 /ascendingInput/currentAscending) - Threshold Min — 初期値0.4。UIスライダーは0〜1(
ThresholdMin入力 /thresholdMinInput/currentThresholdMin) - Threshold Max — 初期値0.6。UIスライダーは0〜1(
ThresholdMax入力 /thresholdMaxInput/currentThresholdMax) - Mask — 白い(Rが1の)ところがソート結果、黒いところが元の絵になります(
lerp(元, ソート結果, mask.r))。未接続ならソート結果がそのまま出ます
ソートする軸のサイズが2048以上だと処理されず素通しになります(コンソールにエラーが出ます)。水平ソートなら幅、垂直ソートなら高さが対象なので、4K横(3840)を水平ソートすると効きません。
出力はグローバル解像度で確保され、入力の解像度には追従しません。解像度が違う場合は最後に拡大縮小されます。
出力ポートへの初回publishは起動から15フレーム後です。
入力(Layer)が未接続のときは出力が黒で塗られます。
入力ポート
| Port ID | 型 |
|---|---|
Layer | RenderTexture |
Mask | RenderTexture |
Enable | bool |
Direction | bool |
Ascending | bool |
ThresholdMin | float |
ThresholdMax | float |
出力ポート
| Port ID | 型 |
|---|---|
Out | RenderTexture |
スクリプトから設定可能なメンバー
| パス | 型 |
|---|---|
isUsingInput | bool |
directionInput | bool |
ascendingInput | bool |
thresholdMinInput | float |
thresholdMaxInput | float |
currentIsUsing | bool |
currentDirection | bool |
currentAscending | bool |
currentThresholdMin | float |
currentThresholdMax | float |
Synapse Apps(スクリプティング)
await synapse.modules.create({ type: "pixelsort" }) 




