PixelSort

AI와 함께 읽기
전체 문서 한 파일로 (llms-full.txt)
pixelsort #ProFx #Node
PixelSort

밝기(0.298912R + 0.586611G + 0.114478B)가 Threshold Min~Max 범위에 들어가는 연속된 픽셀 열을 하나의 구간으로 보고, 그 구간 안에서만 밝기순으로 재배열합니다. 재배열은 컴퓨트 셰이더 위의 바이토닉 정렬이며, 행(또는 열)마다 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타입
LayerRenderTexture
MaskRenderTexture
Enablebool
Directionbool
Ascendingbool
ThresholdMinfloat
ThresholdMaxfloat

출력 포트

Port ID타입
OutRenderTexture

스크립트에서 설정할 수 있는 멤버

경로타입
isUsingInputbool
directionInputbool
ascendingInputbool
thresholdMinInputfloat
thresholdMaxInputfloat
currentIsUsingbool
currentDirectionbool
currentAscendingbool
currentThresholdMinfloat
currentThresholdMaxfloat

Synapse Apps (스크립팅)

await synapse.modules.create({ type: "pixelsort" })

같은 페이지를 참조하는 페이지