コミットを比較
| 作成者 | SHA1 | 日付 | |
|---|---|---|---|
|
|
afec598e0c
|
||
|
|
4ebdc4afd1
|
||
|
|
ec745b15d9
|
||
|
|
515216a4d8
|
||
|
|
eee1c63f86
|
||
|
|
88f2836983
|
||
|
|
f162f2c34b
|
||
|
|
58ad6efae0
|
||
|
|
071f9f4574
|
||
|
|
fd84f4d970
|
||
|
|
19c1693b26
|
||
|
|
29d13ef366
|
||
|
|
893343b857
|
||
|
|
b5e8aa7086
|
||
|
|
75c089e82e
|
||
|
|
27550edb7b
|
検索条件に一致するファイルはありません
@@ -0,0 +1,273 @@
|
||||
name: リリース
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- 'v*'
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
tag:
|
||||
description: リリースするタグ
|
||||
required: true
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
build-and-release:
|
||||
runs-on: windows-latest
|
||||
|
||||
steps:
|
||||
- name: ソースコードのチェックアウト
|
||||
uses: actions/checkout@v4
|
||||
env:
|
||||
GIT_CONFIG_COUNT: "2"
|
||||
GIT_CONFIG_KEY_0: url.https://git.routersys.com/routersys/.insteadOf
|
||||
GIT_CONFIG_VALUE_0: https://github.com/routersys/
|
||||
GIT_CONFIG_KEY_1: url.https://git.routersys.com/manju-summoner/YukkuriMovieMaker.Generator.insteadOf
|
||||
GIT_CONFIG_VALUE_1: https://github.com/manju-summoner/YukkuriMovieMaker.Generator
|
||||
with:
|
||||
ref: ${{ inputs.tag || github.ref_name }}
|
||||
submodules: recursive
|
||||
|
||||
- name: fxc.exeの検索
|
||||
id: fxc
|
||||
shell: pwsh
|
||||
run: |
|
||||
$fxc = Get-ChildItem "C:\Program Files (x86)\Windows Kits\10\bin" -Recurse -Filter "fxc.exe" |
|
||||
Where-Object { $_.FullName -like "*x64*" } |
|
||||
Sort-Object FullName -Descending |
|
||||
Select-Object -First 1
|
||||
if (-not $fxc) {
|
||||
Write-Error "fxc.exeが見つかりませんでした。"
|
||||
exit 1
|
||||
}
|
||||
Write-Host "fxc.exeの場所: $($fxc.FullName)"
|
||||
echo "FXC_PATH=$($fxc.FullName)" >> $env:GITHUB_OUTPUT
|
||||
|
||||
- name: YMM4最新リリースの取得と解凍
|
||||
id: ymm4
|
||||
shell: pwsh
|
||||
run: |
|
||||
$list = 'C:\runner\cache\ymm4\releases.json'
|
||||
New-Item -ItemType Directory -Force -Path (Split-Path $list) | Out-Null
|
||||
if (-not (Test-Path $list) -or (Get-Item $list).Length -lt 1000 -or ((Get-Date) - (Get-Item $list).LastWriteTime).TotalHours -gt 6) {
|
||||
$fetched = $null
|
||||
for ($attempt = 1; $attempt -le 6 -and -not $fetched; $attempt++) {
|
||||
try {
|
||||
$fetched = Invoke-RestMethod -Uri "https://api.github.com/repos/manju-summoner/YukkuriMovieMaker4/releases?per_page=100" `
|
||||
-Headers @{ "User-Agent" = "DecorativeMosaic-CI" } -ErrorAction Stop
|
||||
}
|
||||
catch {
|
||||
$message = $_.Exception.Message
|
||||
Write-Host "リリース一覧の取得に失敗しました($attempt 回目): $($message.Substring(0, [Math]::Min(80, $message.Length)))"
|
||||
Start-Sleep -Seconds (5 * $attempt)
|
||||
}
|
||||
}
|
||||
if (@($fetched).Count -gt 0) {
|
||||
$fetched | Select-Object tag_name, published_at, prerelease, draft, assets |
|
||||
ConvertTo-Json -Depth 6 | Set-Content -Path $list -Encoding UTF8
|
||||
}
|
||||
elseif (-not (Test-Path $list)) { throw 'the list of releases could not be fetched' }
|
||||
else { Write-Host '保存済みのリリース一覧を使います' }
|
||||
}
|
||||
$when = [DateTimeOffset](git log -1 --format=%cI)
|
||||
$releases = @(Get-Content -Raw -Path $list | ConvertFrom-Json | Where-Object { -not $_.draft -and -not $_.prerelease })
|
||||
$release = $releases | Where-Object { [DateTimeOffset]$_.published_at -le $when } | Select-Object -First 1
|
||||
if (-not $release) { $release = $releases | Select-Object -Last 1 }
|
||||
Write-Host "最後のコミット $when に合わせた YMM4: $($release.tag_name)"
|
||||
$asset = $release.assets | Where-Object { $_.name -like "*_Lite.zip" } | Select-Object -First 1
|
||||
if (-not $asset) {
|
||||
$asset = $release.assets | Where-Object { $_.name -like "*.zip" } | Select-Object -First 1
|
||||
}
|
||||
if (-not $asset) {
|
||||
Write-Error "YMM4のリリースにZIPファイルが見つかりませんでした。"
|
||||
exit 1
|
||||
}
|
||||
Write-Host "ダウンロード対象: $($asset.name)"
|
||||
$cache = Join-Path 'C:\runner\cache\ymm4' $asset.name
|
||||
$extracted = "$cache.extracted"
|
||||
$lock = New-Object System.Threading.Mutex($false, 'Global\ci-ymm4-cache')
|
||||
[void]$lock.WaitOne()
|
||||
try {
|
||||
if (-not (Test-Path "$extracted\.complete")) {
|
||||
New-Item -ItemType Directory -Force -Path (Split-Path $cache) | Out-Null
|
||||
Invoke-WebRequest -Uri $asset.browser_download_url -OutFile $cache
|
||||
Remove-Item -Recurse -Force $extracted -ErrorAction SilentlyContinue
|
||||
Expand-Archive -Path $cache -DestinationPath $extracted -Force
|
||||
New-Item -ItemType File -Path "$extracted\.complete" | Out-Null
|
||||
}
|
||||
else {
|
||||
Write-Host "保存済みの YMM4 を使います: $extracted"
|
||||
}
|
||||
}
|
||||
finally {
|
||||
$lock.ReleaseMutex()
|
||||
}
|
||||
$ymm4Dir = (Get-ChildItem -Path $extracted -Recurse -Filter "YukkuriMovieMaker.dll" |
|
||||
Select-Object -First 1).DirectoryName
|
||||
if (-not $ymm4Dir) {
|
||||
Write-Error "YukkuriMovieMaker.dllが見つかりませんでした。"
|
||||
exit 1
|
||||
}
|
||||
Write-Host "YMM4 DLLディレクトリ: $ymm4Dir"
|
||||
echo "YMM4_DIR=$ymm4Dir\" >> $env:GITHUB_OUTPUT
|
||||
|
||||
- name: タグ名からバージョンを取得
|
||||
id: version
|
||||
shell: pwsh
|
||||
run: |
|
||||
$tag = "${{ inputs.tag || github.ref_name }}"
|
||||
echo "TAG=$tag" >> $env:GITHUB_OUTPUT
|
||||
|
||||
- name: resxファイルの生成
|
||||
shell: pwsh
|
||||
run: |
|
||||
$proj = "DecorativeMosaic/DecorativeMosaic.csproj"
|
||||
dotnet build "$proj" `
|
||||
-c Release `
|
||||
-p:YMM4DirPath="${{ steps.ymm4.outputs.YMM4_DIR }}" `
|
||||
-p:FxcPath="${{ steps.fxc.outputs.FXC_PATH }}" `
|
||||
-p:Platform=x64 `
|
||||
-p:SkipPluginDeploy=true
|
||||
|
||||
- name: プロジェクトのビルド
|
||||
shell: pwsh
|
||||
run: |
|
||||
$proj = "DecorativeMosaic/DecorativeMosaic.csproj"
|
||||
dotnet build "$proj" `
|
||||
-c Release `
|
||||
-p:YMM4DirPath="${{ steps.ymm4.outputs.YMM4_DIR }}" `
|
||||
-p:FxcPath="${{ steps.fxc.outputs.FXC_PATH }}" `
|
||||
-p:Platform=x64 `
|
||||
-p:SkipPluginDeploy=true
|
||||
|
||||
- name: テストプロジェクトのビルド
|
||||
shell: pwsh
|
||||
run: |
|
||||
dotnet build DecorativeMosaic.Tests/DecorativeMosaic.Tests.csproj `
|
||||
-c Release `
|
||||
-p:YMM4DirPath="${{ steps.ymm4.outputs.YMM4_DIR }}" `
|
||||
-p:FxcPath="${{ steps.fxc.outputs.FXC_PATH }}" `
|
||||
-p:Platform=x64 `
|
||||
-p:SkipPluginDeploy=true `
|
||||
-maxcpucount:1
|
||||
|
||||
- name: テストの実行
|
||||
shell: pwsh
|
||||
run: |
|
||||
dotnet test DecorativeMosaic.Tests/DecorativeMosaic.Tests.csproj `
|
||||
--no-build `
|
||||
--no-restore `
|
||||
-c Release `
|
||||
-p:Platform=x64 `
|
||||
-p:SkipPluginDeploy=true
|
||||
|
||||
- name: パッケージの作成
|
||||
id: package
|
||||
shell: pwsh
|
||||
run: |
|
||||
$version = "${{ steps.version.outputs.TAG }}"
|
||||
$outDir = "DecorativeMosaic/bin/x64/Release/net10.0-windows10.0.19041.0"
|
||||
$stageRoot = "stage/DecorativeMosaic"
|
||||
$pkgName = "DecorativeMosaic_$version.ymme"
|
||||
|
||||
New-Item -ItemType Directory -Path $stageRoot -Force | Out-Null
|
||||
New-Item -ItemType Directory -Path "$stageRoot/LICENSE" -Force | Out-Null
|
||||
|
||||
Copy-Item "$outDir/DecorativeMosaic.dll" "$stageRoot/"
|
||||
Copy-Item "$outDir/DecorativeMosaic.ComputeSharp.dll" "$stageRoot/"
|
||||
Copy-Item "$outDir/DecorativeMosaic.ComputeSharp.Core.dll" "$stageRoot/"
|
||||
|
||||
foreach ($lang in @("ar-sa", "en-us", "es-es", "id-id", "ko-kr", "zh-cn", "zh-tw")) {
|
||||
$src = "$outDir/$lang"
|
||||
if (Test-Path $src) {
|
||||
New-Item -ItemType Directory -Path "$stageRoot/$lang" -Force | Out-Null
|
||||
Copy-Item "$src/*.dll" "$stageRoot/$lang/"
|
||||
}
|
||||
}
|
||||
|
||||
Copy-Item ".github/LICENSE/*.txt" "$stageRoot/LICENSE/"
|
||||
Copy-Item ".github/Plugin_Readme.txt" "$stageRoot/Readme.txt"
|
||||
|
||||
Compress-Archive -Path "stage/*" -DestinationPath $pkgName -CompressionLevel Optimal
|
||||
echo "PKG_NAME=$pkgName" >> $env:GITHUB_OUTPUT
|
||||
|
||||
- name: Gitea リリースの作成
|
||||
shell: pwsh
|
||||
env:
|
||||
GITEA_TOKEN: ${{ github.token }}
|
||||
REPOSITORY: ${{ github.repository }}
|
||||
SERVER_URL: ${{ github.server_url }}
|
||||
EVENT_NAME: ${{ github.event_name }}
|
||||
WORKFLOW_NAME: ${{ github.workflow }}
|
||||
JOB_NAME: ${{ github.job }}
|
||||
RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_number }}
|
||||
RELEASE_TAG: ${{ inputs.tag || github.ref_name }}
|
||||
RELEASE_NAME: ${{ steps.version.outputs.TAG }}
|
||||
RELEASE_BODY: ''
|
||||
RELEASE_BODY_PATH: .github/CHANGELOG.md
|
||||
RELEASE_DRAFT: false
|
||||
RELEASE_PRERELEASE: false
|
||||
RELEASE_FILES: |
|
||||
${{ steps.package.outputs.PKG_NAME }}
|
||||
run: |
|
||||
$headers = @{ Authorization = "token $env:GITEA_TOKEN" }
|
||||
$api = "$env:SERVER_URL/api/v1/repos/$env:REPOSITORY"
|
||||
$tag = $env:RELEASE_TAG
|
||||
|
||||
$body = $env:RELEASE_BODY
|
||||
if ($env:RELEASE_BODY_PATH -and (Test-Path $env:RELEASE_BODY_PATH)) {
|
||||
$body = Get-Content $env:RELEASE_BODY_PATH -Raw -Encoding utf8
|
||||
}
|
||||
|
||||
$files = @()
|
||||
foreach ($pattern in ($env:RELEASE_FILES -split "[`r`n,]+" | Where-Object { $_.Trim() })) {
|
||||
$found = @(Get-ChildItem -Path $pattern.Trim() -File -ErrorAction SilentlyContinue)
|
||||
if ($found.Count -eq 0) { throw "リリースに付けるファイルが見つかりません: $pattern" }
|
||||
$files += $found
|
||||
}
|
||||
|
||||
$payload = @{
|
||||
tag_name = $tag
|
||||
name = $env:RELEASE_NAME
|
||||
body = [string]$body
|
||||
draft = ($env:RELEASE_DRAFT -eq 'true')
|
||||
prerelease = ($env:RELEASE_PRERELEASE -eq 'true')
|
||||
} | ConvertTo-Json
|
||||
$bytes = [System.Text.Encoding]::UTF8.GetBytes($payload)
|
||||
|
||||
$existing = $null
|
||||
try { $existing = Invoke-RestMethod -Uri "$api/releases/tags/$([System.Uri]::EscapeDataString($tag))" -Headers $headers } catch { }
|
||||
if ($existing) {
|
||||
$release = Invoke-RestMethod -Method Patch -Uri "$api/releases/$($existing.id)" -Headers $headers -ContentType "application/json; charset=utf-8" -Body $bytes
|
||||
foreach ($asset in @($existing.assets)) {
|
||||
Invoke-RestMethod -Method Delete -Uri "$api/releases/$($existing.id)/assets/$($asset.id)" -Headers $headers | Out-Null
|
||||
}
|
||||
} else {
|
||||
$release = Invoke-RestMethod -Method Post -Uri "$api/releases" -Headers $headers -ContentType "application/json; charset=utf-8" -Body $bytes
|
||||
}
|
||||
foreach ($file in $files) {
|
||||
$name = [System.Uri]::EscapeDataString($file.Name)
|
||||
Invoke-RestMethod -Method Post -Uri "$api/releases/$($release.id)/assets?name=$name" -Headers $headers -Form @{ attachment = Get-Item $file.FullName } | Out-Null
|
||||
Write-Host "添付しました: $($file.Name)"
|
||||
}
|
||||
Write-Host "リリースを作成しました: $($release.html_url)"
|
||||
|
||||
if ($env:EVENT_NAME -eq 'workflow_dispatch') {
|
||||
try {
|
||||
$sha = (git rev-parse HEAD).Trim()
|
||||
$status = @{
|
||||
state = 'success'
|
||||
context = "$env:WORKFLOW_NAME / $env:JOB_NAME (workflow_dispatch)"
|
||||
description = "Actions がタグ $tag のコミットから作成しました"
|
||||
target_url = $env:RUN_URL
|
||||
} | ConvertTo-Json
|
||||
Invoke-RestMethod -Method Post -Uri "$api/statuses/$sha" -Headers $headers -ContentType "application/json; charset=utf-8" -Body ([System.Text.Encoding]::UTF8.GetBytes($status)) | Out-Null
|
||||
Write-Host "タグのコミット $sha に成功の状態を付けました"
|
||||
}
|
||||
catch {
|
||||
Write-Warning "タグのコミットに状態を付けられませんでした: $($_.Exception.Message)"
|
||||
}
|
||||
}
|
||||
|
||||
+25
-175
@@ -1,191 +1,41 @@
|
||||
# v1.0.0 - 装飾モザイク for YMM4
|
||||
# v1.0.1 - 装飾モザイク for YMM4
|
||||
|
||||
YukkuriMovieMaker4向けの装飾モザイクエフェクトプラグインの初回リリースです。
|
||||
素材のエッジに沿う方向場を求め、Hausnerの装飾モザイク手法で四角タイルを敷き詰め、ローマ風モザイクとして描画します。
|
||||
タイルの配置はシードから決定論的に決まり、敷設のパラメータでタイルが順に敷かれていく遷移を表現できます。
|
||||
計算はComputeSharpの計算シェーダーがDirect3D 12で実行し、YMM4のDirect3D 11側とは共有テクスチャおよび共有フェンスで接続します。
|
||||
8言語のリソース構成のUIを備えます。
|
||||
装飾モザイクエフェクトプラグインの改善リリースです。
|
||||
Lloyd緩和と描画のメモリアクセスとディスパッチを削減し、タイルの配置と描画結果を一切変えずに、構造の再計算とフレームの描画を高速化しました。
|
||||
出力は前バージョンと全画素で一致します。
|
||||
|
||||
---
|
||||
|
||||
## 新機能
|
||||
## 改善
|
||||
|
||||
### 1. 装飾モザイクの計算パイプライン
|
||||
### 1. サイト状態のFloat4への集約
|
||||
|
||||
`DecorativeMosaicPipeline`は、解析、配置、描画の3段階の計算シェーダーを`ComputeContext`へ記録して実行します。計算格子のバッファーは計算領域の大きさと品質とタイルの間隔に応じて確保し、サイズが変わらないフレームでは再利用します。処理の流れは次のとおりです。
|
||||
タイルの位置、方向場の角度、細部による縮小率を、4本の独立したバッファーではなく1本の`Float4`バッファーへまとめました。ボロノイのジャンプフラッドと描画の候補評価は、候補1つあたり4回のバッファー読み取りが1回のベクトル読み取りになります。角度から余弦と正弦を求める式は変更していないため、距離の値は前バージョンと同一です。
|
||||
|
||||
1. `AnalyzeShader`が、各格子セルに対応する画素のアルファ値と輝度を調べ、しきい値`0.05`を超えるセルを素材の範囲として記録します。
|
||||
2. `EdgeSeedShader`が、素材の範囲の境界セルと、輝度の勾配がしきい値を超える内部のセルをエッジとして置き、`EdgeJumpFloodPassShader`が格子解像度のジャンプフラッドで各セルから最も近いエッジを求めます。
|
||||
3. `DirectionShader`が、最近傍のエッジへの変位に直交する接線方向から方向場を作り、エッジからの距離とあわせて記録します。
|
||||
4. `SpawnShader`が、セル位置とシードのハッシュによる棄却サンプリングでタイルの初期位置を置きます。
|
||||
5. `SiteSeedShader`と`SiteJumpFloodPassShader`と`CentroidAccumulateShader`と`SiteMoveShader`が、Lloyd緩和の1反復を実行し、品質が定める回数だけ記録を繰り返します。
|
||||
6. `RenderShader`が、画素ごとに所属するボロノイ領域のタイルを求め、タイル、目地、陰影、色むらを計算して出力します。
|
||||
- 候補評価はセルあたり最大9候補、パスあたり全格子、反復あたり約10パスで実行されるため、削減される読み取り回数は構造再計算1回あたり数億回に達します。
|
||||
- 併せて重心の参照点を移動の時点で1回だけ計算して`Float2`バッファーへ保持し、重心集計の全セルで行っていた参照点の再計算を取り除きました。参照点の式は変更していません。
|
||||
|
||||
| シェーダー | 役割 |
|
||||
|---|---|
|
||||
| `AnalyzeShader` | 画素のアルファ値と輝度から素材の範囲を求める |
|
||||
| `MaskHashShader` | 素材の範囲と輝度のハッシュを集計する |
|
||||
| `EdgeSeedShader` | 輪郭と輝度エッジのセルを置く |
|
||||
| `EdgeJumpFloodPassShader` | 最近傍のエッジを求める |
|
||||
| `DirectionShader` | 方向場とエッジからの距離を求める |
|
||||
| `SpawnShader` | タイルの初期位置を置く |
|
||||
| `SiteSeedShader` / `SiteJumpFloodPassShader` | 方向つきマンハッタン計量のボロノイ図を求める |
|
||||
| `CentroidAccumulateShader` | ボロノイ領域の重心を集計する |
|
||||
| `SiteMoveShader` | タイルを重心へ移動する |
|
||||
| `RenderShader` | タイルと目地を描画する |
|
||||
### 2. 同一候補の重複評価の省略
|
||||
|
||||
### 2. Hausner手法によるタイル配置
|
||||
ジャンプフラッドと描画の候補走査で、現在の最良候補と同じサイトを再評価せず読み飛ばすようにしました。同じサイトの距離は同じ値になり、狭義の比較では最良を置き換えないため、読み飛ばしても選択結果は変わりません。ボロノイ領域の内部では9候補の大半が同一サイトになるため、後半のパスほど距離計算が減ります。
|
||||
|
||||
配置の計算は、Hausnerの論文「Simulating Decorative Mosaics」(SIGGRAPH 2001)に基づきます。方向場は、エッジからのユークリッド距離場の勾配に直交する接線方向です。タイルの位置は、主軸を方向場へ局所回転させたマンハッタン計量`|u|/γ + |v|·γ`の重心ボロノイ図をLloyd反復で解いて求めます。マンハッタン計量の重心ボロノイ図は局所的に正方格子を作るため、曲がる格子に四角タイルが密に並びます。
|
||||
### 3. ディスパッチとバリアの削減
|
||||
|
||||
1反復の更新は次の順で行います。
|
||||
- 重心バッファーの零初期化を、毎反復3回の全格子ディスパッチから、発生と移動のシェーダーが自分の添字を読み取り後に零へ戻す形へ畳み込みました。集計の開始時に全ての和と件数が0である不変条件は変わりません。
|
||||
- ボロノイの最終パスがサイトマップへ直接書き込むようにし、毎反復のコピーのディスパッチを取り除きました。書き込まれる値は同一です。
|
||||
|
||||
- ボロノイ: 各タイルの位置を種としてジャンプフラッドを実行し、各セルが最も近いタイルを求めます。距離は方向つきマンハッタン計量で評価し、細部による縮小率で割ります。論文のz-bufferによるボロノイ計算は、同一機能のジャンプフラッド法へ置き換えています。
|
||||
- 重心: 素材の範囲のセルを、所属するタイルごとに固定小数点の整数`InterlockedAdd`で集計します。反復の大部分では、エッジからの距離が`0.35×間隔`未満のセルを集計から除外し、タイルをエッジから遠ざけます。最後の3反復では除外を解いて隙間を詰めます。これは論文6節のエッジ回避と同じ手順です。
|
||||
- 移動: 各タイルを自身の領域の重心へ移動し、移動先の方向場と縮小率を反映します。領域を持たないタイルは削除します。
|
||||
### 4. 性能
|
||||
|
||||
整列のパラメータは、方向場の角度を4倍角の空間で無回転と合成する度合いです。細長さのパラメータは計量の異方性`γ`を1〜2.5へ割り当て、細部のパラメータはエッジ近傍のタイルを最小0.5倍まで縮小します。乱数は使用せず、すべての値が入力から決定論的に決まります。
|
||||
1280×720の素材、タイル間隔14画素での実測値です。タイルの配置と描画画素数はすべての条件で前バージョンと一致します。
|
||||
|
||||
### 3. 可視範囲への出力矩形の最小化
|
||||
| 項目 | v1.0.0 | v1.0.1 |
|
||||
|---|---:|---:|
|
||||
| 標準の構造再計算を含むフレーム | 72ms | 28ms |
|
||||
| 高品質の構造再計算を含むフレーム | 192ms | 85ms |
|
||||
| 最高品質の構造再計算を含むフレーム | 473ms | 195ms |
|
||||
| 高品質の構造再計算の単発 | 177ms | 66ms |
|
||||
| キャッシュ後のフレーム | 11.9ms | 5.5ms |
|
||||
|
||||
配置の完了後、タイルの位置と敷設順位の記録をCPUへ読み戻します。読み戻す量は格子3面の値だけで、画素は読み戻しません。敷設順位ごとの境界を累積した配列を1回の走査で構築するため、敷設が定める可視タイルのバウンディングボックスはフレームごとに一定時間で求まります。
|
||||
### 5. 等価性の検証
|
||||
|
||||
- 矩形にはタイルの半径分の余白を加え、4画素境界へそろえます。
|
||||
- 出力テクスチャは矩形の大きさで確保し、Direct2Dの`Crop`と`AffineTransform2D`で元の位置へ合成します。
|
||||
- モザイクは素材の不透明な範囲の内側だけに描画されるため、計算領域は素材の範囲そのままで余白を持ちません。
|
||||
|
||||
### 4. 構造キャッシュ
|
||||
|
||||
タイルの配置を決める入力が変わらないフレームでは、配置の計算を再利用します。
|
||||
|
||||
- 素材の範囲と輝度は、解析の計算後にセル位置と量子化した輝度のハッシュの総和とXORの2値へ集約し、8個の整数の読み戻しで前フレームと比較します。
|
||||
- ハッシュ、計算領域の大きさ、品質、シード、大きさ、細長さ、整列、エッジ検出、細部が一致する場合は、配置段階と記録の読み戻しを実行しません。
|
||||
- 構造が同じで、敷設、目地幅、乱れ、立体感、色むら、目地色、目地濃度、出力矩形も変わらないフレームでは、描画段階も実行せず、前フレームの出力テクスチャを使用します。
|
||||
|
||||
### 5. Direct3D 11・Direct3D 12相互運用
|
||||
|
||||
`DecorativeMosaicGpuInterop`は、YMM4のDirect3D 11・Direct2D側と、ComputeSharpのDirect3D 12側を接続します。ComputeSharpの`GraphicsDevice`は、YMM4が使うDXGIアダプターのLUIDと一致するものを選びます。
|
||||
|
||||
入力と出力は、ComputeSharpで確保した共有テクスチャをDirect3D 11のテクスチャとして開き、Direct2Dのビットマップとして扱います。入力のテクスチャは素材の大きさで確保し、出力のテクスチャは可視範囲の矩形を収める容量で確保して拡大時だけ作り直します。両デバイスの同期は、Direct3D 12のフェンスを共有フェンスとしてDirect3D 11側で開いて行います。
|
||||
|
||||
`BeginCompute`は、Direct3D 11のコマンドを送出したうえでDirect3D 12側を待機させ、`EndCompute`は、Direct3D 12側の完了をDirect3D 11側で待ちます。
|
||||
|
||||
Direct3D 12デバイスの取得や共有リソースの作成に失敗した場合は、`TryCreate`が`null`を返し、エフェクトを適用せず入力映像を表示します。
|
||||
|
||||
### 6. カスタムシェーダーによる合成
|
||||
|
||||
`DecorativeMosaicCustomEffect`は、`[CustomEffect(2)]`の2入力エフェクトです。入力0は元映像、入力1は描画したモザイクです。ピクセルシェーダー`DecorativeMosaic.hlsl`の`main`は、`amount`が0以下のとき元映像をそのまま返し、そうでないときはモザイクのRGBをアルファでクランプし、`mosaic + source * (1 - mosaic.a)`のアルファ合成でモザイクを元映像の上へ重ねます。タイルの色は描画段階でモザイクの画素へ焼き込むため、合成は単純な重ね合わせです。
|
||||
|
||||
定数バッファーは`Amount`と3つの詰め物で16バイトです。`MapInputRectsToOutputRect`は2つの入力矩形の和集合を出力矩形とします。モザイクは素材の内側だけに描画されるため、出力範囲は素材より広がりません。
|
||||
|
||||
シェーダーリソース: `pack://application:,,,/DecorativeMosaic;component/Shaders/DecorativeMosaic.cso`(ps_5_0、`ShaderResourceUri.Get`が生成)
|
||||
|
||||
### 7. エフェクト定義とパラメータ
|
||||
|
||||
`DecorativeMosaicEffect`は、YMM4の映像エフェクトとして宣言されます。
|
||||
|
||||
`[VideoEffect]`属性は以下のパラメーターで宣言されます。
|
||||
|
||||
- 表示名: `Texts.DecorativeMosaic`(ローカライズキー、日本語では「装飾モザイク」)
|
||||
- カテゴリー: `VideoEffectCategories.Decoration`・`VideoEffectCategories.Animation`
|
||||
- 検索タグ: `TagMosaic`・`TagTile`・`TagRoman`
|
||||
- `IsAviUtlSupported = false`によりAviUtl向けEXO出力は非対応
|
||||
- `ResourceType = typeof(Texts)`でローカライズリソースを指定
|
||||
|
||||
公開プロパティは以下のとおりです。基本項目は「基本」グループ、タイル項目は「タイル」グループ、方向項目は「方向」グループ、描画項目は「描画」グループに属します。
|
||||
|
||||
| プロパティ | 型 | デフォルト | 内部範囲 | アニメーション |
|
||||
|---|---|---|---|---|
|
||||
| `Amount` | `Animation` | 100 | 0〜100 | あり |
|
||||
| `Laying` | `Animation` | 100 | 0〜100 | あり |
|
||||
| `Quality` | `DecorativeMosaicQuality` | `High` | — | なし |
|
||||
| `TileSize` | `Animation` | 14 | 2〜200 | あり |
|
||||
| `Grout` | `Animation` | 30 | 0〜100 | あり |
|
||||
| `Aspect` | `Animation` | 0 | 0〜100 | あり |
|
||||
| `Irregularity` | `Animation` | 25 | 0〜100 | あり |
|
||||
| `Detail` | `Animation` | 0 | 0〜100 | あり |
|
||||
| `Seed` | `int` | 0 | 0〜int.MaxValue | なし |
|
||||
| `Align` | `Animation` | 100 | 0〜100 | あり |
|
||||
| `EdgeDetect` | `Animation` | 50 | 0〜100 | あり |
|
||||
| `Bevel` | `Animation` | 35 | 0〜100 | あり |
|
||||
| `ColorVariation` | `Animation` | 20 | 0〜100 | あり |
|
||||
| `GroutColor` | `Color` | #FFD1C8BA | — | なし |
|
||||
| `GroutOpacity` | `Animation` | 100 | 0〜100 | あり |
|
||||
|
||||
`GetAnimatables`は`Amount`・`Laying`・`TileSize`・`Grout`・`Aspect`・`Irregularity`・`Detail`・`Align`・`EdgeDetect`・`Bevel`・`ColorVariation`・`GroutOpacity`を返します。`Seed`は負値を代入すると0へ丸めます。
|
||||
|
||||
`CreateExoVideoFilters`は空のシーケンスを返します(EXO非対応)。`CreateVideoEffect`は映像処理用のインスタンスを生成します。エフェクトを最初に生成したときに、更新確認を一度だけ開始します。
|
||||
|
||||
### 8. フレームごとの更新
|
||||
|
||||
各フレームでYMM4の`EffectDescription`からフレーム位置、アイテム長、FPSを取得し、アニメーション値を評価します。値をパイプラインが前提とする範囲へ制限してから転送します。
|
||||
|
||||
| パラメータ | 変換 |
|
||||
|---|---|
|
||||
| `Amount` | `value / 100` をカスタムシェーダーの`Amount`へ |
|
||||
| `Laying` | `value / 100` を0〜1へクランプ |
|
||||
| `TileSize` | 値をそのまま2〜200画素へクランプ |
|
||||
| `Grout` | `value / 100` を0〜1へクランプ |
|
||||
| `Aspect` | `value / 100` を0〜1へクランプし、計量の異方性1〜2.5へ |
|
||||
| `Irregularity` | `value / 100` を0〜1へクランプ |
|
||||
| `Detail` | `value / 100` を0〜1へクランプ |
|
||||
| `Align` | `value / 100` を0〜1へクランプ |
|
||||
| `EdgeDetect` | `value / 100` を0〜1へクランプし、輝度勾配のしきい値へ |
|
||||
| `Bevel` | `value / 100` を0〜1へクランプ |
|
||||
| `ColorVariation` | `value / 100` を0〜1へクランプ |
|
||||
| `GroutColor` | RGB各成分を0〜1へ |
|
||||
| `GroutOpacity` | `value / 100` を0〜1へクランプ |
|
||||
| `Seed` | 0以上へクランプ |
|
||||
|
||||
強さが0以下のとき、または敷設が0以下のときは、モザイクを描画せず入力映像をそのまま出力します。入力の範囲が有限でない場合や、長辺が8192画素を超える場合も、入力映像を表示します。
|
||||
|
||||
### 9. 品質設定
|
||||
|
||||
品質は、計算格子の解像度とLloyd反復の回数をまとめて切り替えます。
|
||||
|
||||
| 品質 | 1タイルあたりのセル数 | Lloyd反復 | 格子解像度の上限 |
|
||||
|---|---:|---:|---:|
|
||||
| 標準 | 5 | 10回 | 512 |
|
||||
| 高品質 | 6 | 18回 | 768 |
|
||||
| 最高品質 | 8 | 26回 | 1024 |
|
||||
|
||||
格子解像度の上限は計算領域の長辺のセル数です。セルの大きさはタイルの間隔と上限の両方から決まり、短辺のセル数は計算領域の縦横比に合わせ、最小4セルとします。
|
||||
|
||||
### 10. ローカライズ
|
||||
|
||||
`Texts`クラスは`[AutoGenLocalizer]`属性を持つ`partial`クラスとして宣言されます。
|
||||
`YukkuriMovieMaker.Generator`のソースジェネレーターが`Texts.csv`を処理し、各ロケールのリソースファイルを自動生成します。
|
||||
|
||||
対応リソース: 日本語(`ja-jp`)・英語(`en-us`)・中国語簡体字(`zh-cn`)・中国語繁体字(`zh-tw`)・韓国語(`ko-kr`)・スペイン語(`es-es`)・アラビア語(`ar-sa`)・インドネシア語(`id-id`)
|
||||
|
||||
主なローカライズキーは以下のとおりです。
|
||||
|
||||
| キー | ja-jp |
|
||||
|---|---|
|
||||
| `DecorativeMosaic` | 装飾モザイク |
|
||||
| `BasicGroup` | 基本 |
|
||||
| `TileGroup` | タイル |
|
||||
| `FlowGroup` | 方向 |
|
||||
| `AppearanceGroup` | 描画 |
|
||||
| `Amount` | 強さ |
|
||||
| `Laying` | 敷設 |
|
||||
| `Quality` | 品質 |
|
||||
| `TileSize` | 大きさ |
|
||||
| `Grout` | 目地幅 |
|
||||
| `Aspect` | 細長さ |
|
||||
| `Irregularity` | 乱れ |
|
||||
| `Detail` | 細部 |
|
||||
| `Seed` | シード |
|
||||
| `Align` | 整列 |
|
||||
| `EdgeDetect` | エッジ検出 |
|
||||
| `Bevel` | 立体感 |
|
||||
| `ColorVariation` | 色むら |
|
||||
| `GroutColor` | 目地色 |
|
||||
| `GroutOpacity` | 目地濃度 |
|
||||
| `QualityBalanced` | 標準 |
|
||||
| `QualityHigh` | 高品質 |
|
||||
| `QualityUltra` | 最高品質 |
|
||||
| `TagMosaic` | モザイク |
|
||||
| `TagTile` | タイル |
|
||||
| `TagRoman` | ローマ風 |
|
||||
| `UpdateAvailableMessage` | 新しいバージョン {0} が公開されています。 |
|
||||
検証ハーネスの`--golden`引数で、品質2条件、シード、細長さ最大、整列0、目地最大、細部最大、部分敷設の8条件について、前バージョンのソースから同一環境でビルドした出力と、全画素のSHA-256が一致することを確認しました。テストは41件すべて成功し、ビルドは警告0です。ハーネスが出力する全画像も前バージョンと全画素で一致します。
|
||||
@@ -1,5 +1,5 @@
|
||||
========================================
|
||||
装飾モザイク for YMM4 v1.0.0
|
||||
装飾モザイク for YMM4 v1.0.1
|
||||
========================================
|
||||
YukkuriMovieMaker4上で動作する、素材のエッジに沿う方向場を求め、
|
||||
Hausnerの装飾モザイク手法で四角タイルを敷き詰めてローマ風モザイクとして
|
||||
|
||||
+2
-2
@@ -1,9 +1,9 @@
|
||||
[submodule "YukkuriMovieMaker.Generator"]
|
||||
path = YukkuriMovieMaker.Generator
|
||||
url = https://github.com/manju-summoner/YukkuriMovieMaker.Generator.git
|
||||
url = https://git.routersys.com/manju-summoner/YukkuriMovieMaker.Generator.git
|
||||
[submodule "YMM4-GitHubUpdateNotifier"]
|
||||
path = YMM4-GitHubUpdateNotifier
|
||||
url = https://github.com/routersys/YMM4-GitHubUpdateNotifier.git
|
||||
url = https://git.routersys.com/routersys/YMM4-GitHubUpdateNotifier.git
|
||||
[submodule "ComputeSharp"]
|
||||
path = ComputeSharp
|
||||
url = https://github.com/routersys/ComputeSharp.git
|
||||
@@ -5,7 +5,7 @@
|
||||
<UseWPF>true</UseWPF>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<Version>1.0.0</Version>
|
||||
<Version>1.0.1</Version>
|
||||
<Platforms>AnyCPU;x64</Platforms>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
|
||||
|
||||
@@ -22,26 +22,6 @@ internal readonly partial struct FillIntShader(
|
||||
}
|
||||
}
|
||||
|
||||
[ThreadGroupSize(DefaultThreadGroupSizes.X)]
|
||||
[GeneratedComputeShaderDescriptor]
|
||||
internal readonly partial struct CopyIntShader(
|
||||
ReadWriteBuffer<int> input,
|
||||
ReadWriteBuffer<int> output,
|
||||
int length) : IComputeShader
|
||||
{
|
||||
private readonly ReadWriteBuffer<int> input = input;
|
||||
private readonly ReadWriteBuffer<int> output = output;
|
||||
private readonly int length = length;
|
||||
|
||||
public void Execute()
|
||||
{
|
||||
var index = ThreadIds.X;
|
||||
if (index >= length)
|
||||
return;
|
||||
output[index] = input[index];
|
||||
}
|
||||
}
|
||||
|
||||
[ThreadGroupSize(DefaultThreadGroupSizes.X)]
|
||||
[GeneratedComputeShaderDescriptor]
|
||||
internal readonly partial struct InitScratchShader(
|
||||
@@ -346,11 +326,12 @@ internal readonly partial struct SpawnShader(
|
||||
ReadWriteBuffer<int> mask,
|
||||
ReadWriteBuffer<float> theta,
|
||||
ReadWriteBuffer<float> edgeDistance,
|
||||
ReadWriteBuffer<float> sitePosX,
|
||||
ReadWriteBuffer<float> sitePosY,
|
||||
ReadWriteBuffer<float> siteTheta,
|
||||
ReadWriteBuffer<float> siteSize,
|
||||
ReadWriteBuffer<Float4> site,
|
||||
ReadWriteBuffer<Float2> siteReference,
|
||||
ReadWriteBuffer<int> siteRank,
|
||||
ReadWriteBuffer<int> sumX,
|
||||
ReadWriteBuffer<int> sumY,
|
||||
ReadWriteBuffer<int> count,
|
||||
ReadWriteBuffer<int> scratch,
|
||||
int gridWidth,
|
||||
int gridHeight,
|
||||
@@ -362,11 +343,12 @@ internal readonly partial struct SpawnShader(
|
||||
private readonly ReadWriteBuffer<int> mask = mask;
|
||||
private readonly ReadWriteBuffer<float> theta = theta;
|
||||
private readonly ReadWriteBuffer<float> edgeDistance = edgeDistance;
|
||||
private readonly ReadWriteBuffer<float> sitePosX = sitePosX;
|
||||
private readonly ReadWriteBuffer<float> sitePosY = sitePosY;
|
||||
private readonly ReadWriteBuffer<float> siteTheta = siteTheta;
|
||||
private readonly ReadWriteBuffer<float> siteSize = siteSize;
|
||||
private readonly ReadWriteBuffer<Float4> site = site;
|
||||
private readonly ReadWriteBuffer<Float2> siteReference = siteReference;
|
||||
private readonly ReadWriteBuffer<int> siteRank = siteRank;
|
||||
private readonly ReadWriteBuffer<int> sumX = sumX;
|
||||
private readonly ReadWriteBuffer<int> sumY = sumY;
|
||||
private readonly ReadWriteBuffer<int> count = count;
|
||||
private readonly ReadWriteBuffer<int> scratch = scratch;
|
||||
private readonly int gridWidth = gridWidth;
|
||||
private readonly int gridHeight = gridHeight;
|
||||
@@ -383,6 +365,9 @@ internal readonly partial struct SpawnShader(
|
||||
return;
|
||||
|
||||
var index = gy * gridWidth + gx;
|
||||
sumX[index] = 0;
|
||||
sumY[index] = 0;
|
||||
count[index] = 0;
|
||||
if (mask[index] != 1)
|
||||
{
|
||||
siteRank[index] = -1;
|
||||
@@ -400,10 +385,10 @@ internal readonly partial struct SpawnShader(
|
||||
}
|
||||
|
||||
var center = DecorativeMosaicShaderMath.CellCenter(gx, gy, cellSize);
|
||||
sitePosX[index] = center.X + (DecorativeMosaicShaderMath.Hash01(basis ^ 0xC2B2AE35u) - 0.5f) * cellSize;
|
||||
sitePosY[index] = center.Y + (DecorativeMosaicShaderMath.Hash01(basis * 0x85EBCA6Bu + 0x9E3779B9u) - 0.5f) * cellSize;
|
||||
siteTheta[index] = theta[index];
|
||||
siteSize[index] = sizeFactor;
|
||||
var positionX = center.X + (DecorativeMosaicShaderMath.Hash01(basis ^ 0xC2B2AE35u) - 0.5f) * cellSize;
|
||||
var positionY = center.Y + (DecorativeMosaicShaderMath.Hash01(basis * 0x85EBCA6Bu + 0x9E3779B9u) - 0.5f) * cellSize;
|
||||
site[index] = new Float4(positionX, positionY, theta[index], sizeFactor);
|
||||
siteReference[index] = DecorativeMosaicShaderMath.OwnerReference(positionX, positionY, cellSize, gridWidth, gridHeight);
|
||||
siteRank[index] = Hlsl.Min(
|
||||
(int)(DecorativeMosaicShaderMath.Hash01(basis + 0x27D4EB2Fu) * DecorativeMosaicSettings.LayingSteps),
|
||||
DecorativeMosaicSettings.LayingSteps - 1);
|
||||
@@ -415,16 +400,14 @@ internal readonly partial struct SpawnShader(
|
||||
[GeneratedComputeShaderDescriptor]
|
||||
internal readonly partial struct SiteSeedShader(
|
||||
ReadWriteBuffer<int> siteRank,
|
||||
ReadWriteBuffer<float> sitePosX,
|
||||
ReadWriteBuffer<float> sitePosY,
|
||||
ReadWriteBuffer<Float4> site,
|
||||
ReadWriteBuffer<int> jumpFlood,
|
||||
int gridWidth,
|
||||
int gridHeight,
|
||||
float cellSize) : IComputeShader
|
||||
{
|
||||
private readonly ReadWriteBuffer<int> siteRank = siteRank;
|
||||
private readonly ReadWriteBuffer<float> sitePosX = sitePosX;
|
||||
private readonly ReadWriteBuffer<float> sitePosY = sitePosY;
|
||||
private readonly ReadWriteBuffer<Float4> site = site;
|
||||
private readonly ReadWriteBuffer<int> jumpFlood = jumpFlood;
|
||||
private readonly int gridWidth = gridWidth;
|
||||
private readonly int gridHeight = gridHeight;
|
||||
@@ -441,8 +424,9 @@ internal readonly partial struct SiteSeedShader(
|
||||
if (siteRank[index] < 0)
|
||||
return;
|
||||
|
||||
var cx = Hlsl.Clamp((int)(sitePosX[index] / cellSize), 0, gridWidth - 1);
|
||||
var cy = Hlsl.Clamp((int)(sitePosY[index] / cellSize), 0, gridHeight - 1);
|
||||
var packed = site[index];
|
||||
var cx = Hlsl.Clamp((int)(packed.X / cellSize), 0, gridWidth - 1);
|
||||
var cy = Hlsl.Clamp((int)(packed.Y / cellSize), 0, gridHeight - 1);
|
||||
Hlsl.InterlockedMin(ref jumpFlood[cy * gridWidth + cx], index);
|
||||
}
|
||||
}
|
||||
@@ -452,10 +436,7 @@ internal readonly partial struct SiteSeedShader(
|
||||
internal readonly partial struct SiteJumpFloodPassShader(
|
||||
ReadWriteBuffer<int> input,
|
||||
ReadWriteBuffer<int> output,
|
||||
ReadWriteBuffer<float> sitePosX,
|
||||
ReadWriteBuffer<float> sitePosY,
|
||||
ReadWriteBuffer<float> siteTheta,
|
||||
ReadWriteBuffer<float> siteSize,
|
||||
ReadWriteBuffer<Float4> site,
|
||||
int gridWidth,
|
||||
int gridHeight,
|
||||
int stepSize,
|
||||
@@ -464,26 +445,24 @@ internal readonly partial struct SiteJumpFloodPassShader(
|
||||
{
|
||||
private readonly ReadWriteBuffer<int> input = input;
|
||||
private readonly ReadWriteBuffer<int> output = output;
|
||||
private readonly ReadWriteBuffer<float> sitePosX = sitePosX;
|
||||
private readonly ReadWriteBuffer<float> sitePosY = sitePosY;
|
||||
private readonly ReadWriteBuffer<float> siteTheta = siteTheta;
|
||||
private readonly ReadWriteBuffer<float> siteSize = siteSize;
|
||||
private readonly ReadWriteBuffer<Float4> site = site;
|
||||
private readonly int gridWidth = gridWidth;
|
||||
private readonly int gridHeight = gridHeight;
|
||||
private readonly int stepSize = stepSize;
|
||||
private readonly float cellSize = cellSize;
|
||||
private readonly float gamma = gamma;
|
||||
|
||||
private float Distance(Float2 position, int site)
|
||||
private float Distance(Float2 position, int candidate)
|
||||
{
|
||||
var dx = position.X - sitePosX[site];
|
||||
var dy = position.Y - sitePosY[site];
|
||||
var angle = siteTheta[site];
|
||||
var packed = site[candidate];
|
||||
var dx = position.X - packed.X;
|
||||
var dy = position.Y - packed.Y;
|
||||
var angle = packed.Z;
|
||||
var c = Hlsl.Cos(angle);
|
||||
var s = Hlsl.Sin(angle);
|
||||
var u = c * dx + s * dy;
|
||||
var v = -s * dx + c * dy;
|
||||
return (Hlsl.Abs(u) / gamma + Hlsl.Abs(v) * gamma) / Hlsl.Max(siteSize[site], 0.1f);
|
||||
return (Hlsl.Abs(u) / gamma + Hlsl.Abs(v) * gamma) / Hlsl.Max(packed.W, 0.1f);
|
||||
}
|
||||
|
||||
public void Execute()
|
||||
@@ -505,7 +484,7 @@ internal readonly partial struct SiteJumpFloodPassShader(
|
||||
if (sx < 0 || sx >= gridWidth || sy < 0 || sy >= gridHeight)
|
||||
continue;
|
||||
var candidate = input[sy * gridWidth + sx];
|
||||
if (candidate == DecorativeMosaicSettings.SiteSentinel)
|
||||
if (candidate == DecorativeMosaicSettings.SiteSentinel || candidate == best)
|
||||
continue;
|
||||
var distance = Distance(position, candidate);
|
||||
if (distance < bestDistance)
|
||||
@@ -525,8 +504,7 @@ internal readonly partial struct CentroidAccumulateShader(
|
||||
ReadWriteBuffer<int> siteMap,
|
||||
ReadWriteBuffer<int> mask,
|
||||
ReadWriteBuffer<float> edgeDistance,
|
||||
ReadWriteBuffer<float> sitePosX,
|
||||
ReadWriteBuffer<float> sitePosY,
|
||||
ReadWriteBuffer<Float2> siteReference,
|
||||
ReadWriteBuffer<int> sumX,
|
||||
ReadWriteBuffer<int> sumY,
|
||||
ReadWriteBuffer<int> count,
|
||||
@@ -539,8 +517,7 @@ internal readonly partial struct CentroidAccumulateShader(
|
||||
private readonly ReadWriteBuffer<int> siteMap = siteMap;
|
||||
private readonly ReadWriteBuffer<int> mask = mask;
|
||||
private readonly ReadWriteBuffer<float> edgeDistance = edgeDistance;
|
||||
private readonly ReadWriteBuffer<float> sitePosX = sitePosX;
|
||||
private readonly ReadWriteBuffer<float> sitePosY = sitePosY;
|
||||
private readonly ReadWriteBuffer<Float2> siteReference = siteReference;
|
||||
private readonly ReadWriteBuffer<int> sumX = sumX;
|
||||
private readonly ReadWriteBuffer<int> sumY = sumY;
|
||||
private readonly ReadWriteBuffer<int> count = count;
|
||||
@@ -566,11 +543,10 @@ internal readonly partial struct CentroidAccumulateShader(
|
||||
if (owner == DecorativeMosaicSettings.SiteSentinel)
|
||||
return;
|
||||
|
||||
var ownerCellX = Hlsl.Clamp((int)(sitePosX[owner] / cellSize), 0, gridWidth - 1);
|
||||
var ownerCellY = Hlsl.Clamp((int)(sitePosY[owner] / cellSize), 0, gridHeight - 1);
|
||||
var reference = siteReference[owner];
|
||||
var center = DecorativeMosaicShaderMath.CellCenter(gx, gy, cellSize);
|
||||
var offsetX = center.X - (ownerCellX + 0.5f) * cellSize;
|
||||
var offsetY = center.Y - (ownerCellY + 0.5f) * cellSize;
|
||||
var offsetX = center.X - reference.X;
|
||||
var offsetY = center.Y - reference.Y;
|
||||
if (Hlsl.Abs(offsetX) > cutoff || Hlsl.Abs(offsetY) > cutoff)
|
||||
return;
|
||||
|
||||
@@ -584,10 +560,8 @@ internal readonly partial struct CentroidAccumulateShader(
|
||||
[GeneratedComputeShaderDescriptor]
|
||||
internal readonly partial struct SiteMoveShader(
|
||||
ReadWriteBuffer<int> siteRank,
|
||||
ReadWriteBuffer<float> sitePosX,
|
||||
ReadWriteBuffer<float> sitePosY,
|
||||
ReadWriteBuffer<float> siteTheta,
|
||||
ReadWriteBuffer<float> siteSize,
|
||||
ReadWriteBuffer<Float4> site,
|
||||
ReadWriteBuffer<Float2> siteReference,
|
||||
ReadWriteBuffer<int> sumX,
|
||||
ReadWriteBuffer<int> sumY,
|
||||
ReadWriteBuffer<int> count,
|
||||
@@ -601,10 +575,8 @@ internal readonly partial struct SiteMoveShader(
|
||||
float detail) : IComputeShader
|
||||
{
|
||||
private readonly ReadWriteBuffer<int> siteRank = siteRank;
|
||||
private readonly ReadWriteBuffer<float> sitePosX = sitePosX;
|
||||
private readonly ReadWriteBuffer<float> sitePosY = sitePosY;
|
||||
private readonly ReadWriteBuffer<float> siteTheta = siteTheta;
|
||||
private readonly ReadWriteBuffer<float> siteSize = siteSize;
|
||||
private readonly ReadWriteBuffer<Float4> site = site;
|
||||
private readonly ReadWriteBuffer<Float2> siteReference = siteReference;
|
||||
private readonly ReadWriteBuffer<int> sumX = sumX;
|
||||
private readonly ReadWriteBuffer<int> sumY = sumY;
|
||||
private readonly ReadWriteBuffer<int> count = count;
|
||||
@@ -625,10 +597,15 @@ internal readonly partial struct SiteMoveShader(
|
||||
return;
|
||||
|
||||
var index = gy * gridWidth + gx;
|
||||
var cells = count[index];
|
||||
var accumulatedX = sumX[index];
|
||||
var accumulatedY = sumY[index];
|
||||
sumX[index] = 0;
|
||||
sumY[index] = 0;
|
||||
count[index] = 0;
|
||||
if (siteRank[index] < 0)
|
||||
return;
|
||||
|
||||
var cells = count[index];
|
||||
if (cells == 0)
|
||||
{
|
||||
siteRank[index] = -1;
|
||||
@@ -636,19 +613,16 @@ internal readonly partial struct SiteMoveShader(
|
||||
return;
|
||||
}
|
||||
|
||||
var ownerCellX = Hlsl.Clamp((int)(sitePosX[index] / cellSize), 0, gridWidth - 1);
|
||||
var ownerCellY = Hlsl.Clamp((int)(sitePosY[index] / cellSize), 0, gridHeight - 1);
|
||||
var reference = siteReference[index];
|
||||
var scale = 1f / (DecorativeMosaicSettings.FixedPointScale * cells);
|
||||
var newX = Hlsl.Clamp((ownerCellX + 0.5f) * cellSize + sumX[index] * scale, 0f, gridWidth * cellSize - 0.001f);
|
||||
var newY = Hlsl.Clamp((ownerCellY + 0.5f) * cellSize + sumY[index] * scale, 0f, gridHeight * cellSize - 0.001f);
|
||||
sitePosX[index] = newX;
|
||||
sitePosY[index] = newY;
|
||||
var newX = Hlsl.Clamp(reference.X + accumulatedX * scale, 0f, gridWidth * cellSize - 0.001f);
|
||||
var newY = Hlsl.Clamp(reference.Y + accumulatedY * scale, 0f, gridHeight * cellSize - 0.001f);
|
||||
|
||||
var cellX = Hlsl.Clamp((int)(newX / cellSize), 0, gridWidth - 1);
|
||||
var cellY = Hlsl.Clamp((int)(newY / cellSize), 0, gridHeight - 1);
|
||||
var cell = cellY * gridWidth + cellX;
|
||||
siteTheta[index] = theta[cell];
|
||||
siteSize[index] = DecorativeMosaicShaderMath.SizeFactor(edgeDistance[cell], spacing, detail);
|
||||
site[index] = new Float4(newX, newY, theta[cell], DecorativeMosaicShaderMath.SizeFactor(edgeDistance[cell], spacing, detail));
|
||||
siteReference[index] = DecorativeMosaicShaderMath.OwnerReference(newX, newY, cellSize, gridWidth, gridHeight);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -656,10 +630,7 @@ internal readonly partial struct SiteMoveShader(
|
||||
[GeneratedComputeShaderDescriptor]
|
||||
internal readonly partial struct RenderShader(
|
||||
ReadWriteBuffer<int> siteMap,
|
||||
ReadWriteBuffer<float> sitePosX,
|
||||
ReadWriteBuffer<float> sitePosY,
|
||||
ReadWriteBuffer<float> siteTheta,
|
||||
ReadWriteBuffer<float> siteSize,
|
||||
ReadWriteBuffer<Float4> site,
|
||||
ReadWriteBuffer<int> siteRank,
|
||||
ReadWriteTexture2D<Bgra32, Float4> source,
|
||||
ReadWriteTexture2D<Bgra32, Float4> output,
|
||||
@@ -685,10 +656,7 @@ internal readonly partial struct RenderShader(
|
||||
float groutOpacity) : IComputeShader
|
||||
{
|
||||
private readonly ReadWriteBuffer<int> siteMap = siteMap;
|
||||
private readonly ReadWriteBuffer<float> sitePosX = sitePosX;
|
||||
private readonly ReadWriteBuffer<float> sitePosY = sitePosY;
|
||||
private readonly ReadWriteBuffer<float> siteTheta = siteTheta;
|
||||
private readonly ReadWriteBuffer<float> siteSize = siteSize;
|
||||
private readonly ReadWriteBuffer<Float4> site = site;
|
||||
private readonly ReadWriteBuffer<int> siteRank = siteRank;
|
||||
private readonly ReadWriteTexture2D<Bgra32, Float4> source = source;
|
||||
private readonly ReadWriteTexture2D<Bgra32, Float4> output = output;
|
||||
@@ -744,16 +712,17 @@ internal readonly partial struct RenderShader(
|
||||
if (sx < 0 || sx >= gridWidth || sy < 0 || sy >= gridHeight)
|
||||
continue;
|
||||
var candidate = siteMap[sy * gridWidth + sx];
|
||||
if (candidate == DecorativeMosaicSettings.SiteSentinel)
|
||||
if (candidate == DecorativeMosaicSettings.SiteSentinel || candidate == best)
|
||||
continue;
|
||||
var cdx = pxc - sitePosX[candidate];
|
||||
var cdy = pyc - sitePosY[candidate];
|
||||
var angle = siteTheta[candidate];
|
||||
var packed = site[candidate];
|
||||
var cdx = pxc - packed.X;
|
||||
var cdy = pyc - packed.Y;
|
||||
var angle = packed.Z;
|
||||
var cc = Hlsl.Cos(angle);
|
||||
var cs = Hlsl.Sin(angle);
|
||||
var cu = cc * cdx + cs * cdy;
|
||||
var cv = -cs * cdx + cc * cdy;
|
||||
var distance = (Hlsl.Abs(cu) / gamma + Hlsl.Abs(cv) * gamma) / Hlsl.Max(siteSize[candidate], 0.1f);
|
||||
var distance = (Hlsl.Abs(cu) / gamma + Hlsl.Abs(cv) * gamma) / Hlsl.Max(packed.W, 0.1f);
|
||||
if (distance < bestDistance)
|
||||
{
|
||||
bestDistance = distance;
|
||||
@@ -773,23 +742,24 @@ internal readonly partial struct RenderShader(
|
||||
var rc = Hlsl.Cos(rotation);
|
||||
var rs = Hlsl.Abs(Hlsl.Sin(rotation));
|
||||
var shrink = 1f / (rc + rs);
|
||||
var bestSite = site[best];
|
||||
var sizeJitter = 1f - DecorativeMosaicSettings.SizeJitterFactor * irregularity * DecorativeMosaicShaderMath.Hash01(basis ^ 0x85EBCA6Bu);
|
||||
var factor = siteSize[best] * shrink * sizeJitter;
|
||||
var factor = bestSite.W * shrink * sizeJitter;
|
||||
var halfU = gamma * halfBase * factor;
|
||||
var halfV = halfBase / gamma * factor;
|
||||
|
||||
var tileAngle = siteTheta[best] + rotation;
|
||||
var tileAngle = bestSite.Z + rotation;
|
||||
var tc2 = Hlsl.Cos(tileAngle);
|
||||
var ts2 = Hlsl.Sin(tileAngle);
|
||||
var dx2 = pxc - sitePosX[best];
|
||||
var dy2 = pyc - sitePosY[best];
|
||||
var dx2 = pxc - bestSite.X;
|
||||
var dy2 = pyc - bestSite.Y;
|
||||
var u = tc2 * dx2 + ts2 * dy2;
|
||||
var v = -ts2 * dx2 + tc2 * dy2;
|
||||
|
||||
if (Hlsl.Abs(u) <= halfU && Hlsl.Abs(v) <= halfV)
|
||||
{
|
||||
var tileX = Hlsl.Clamp((int)sitePosX[best], 0, sourceWidth - 1);
|
||||
var tileY = Hlsl.Clamp((int)sitePosY[best], 0, sourceHeight - 1);
|
||||
var tileX = Hlsl.Clamp((int)bestSite.X, 0, sourceWidth - 1);
|
||||
var tileY = Hlsl.Clamp((int)bestSite.Y, 0, sourceHeight - 1);
|
||||
var tileSample = source[new Int2(tileX, tileY)];
|
||||
var tileAlpha = Hlsl.Max(tileSample.W, 1e-4f);
|
||||
var r = tileSample.X / tileAlpha;
|
||||
@@ -825,6 +795,12 @@ internal static class DecorativeMosaicShaderMath
|
||||
public static Float2 CellCenter(int i, int j, float cellSize)
|
||||
=> new((i + 0.5f) * cellSize, (j + 0.5f) * cellSize);
|
||||
|
||||
public static Float2 OwnerReference(float x, float y, float cellSize, int gridWidth, int gridHeight)
|
||||
=> CellCenter(
|
||||
Hlsl.Clamp((int)(x / cellSize), 0, gridWidth - 1),
|
||||
Hlsl.Clamp((int)(y / cellSize), 0, gridHeight - 1),
|
||||
cellSize);
|
||||
|
||||
public static float SizeFactor(float edgeDistance, float spacing, float detail)
|
||||
=> 1f - detail * (1f - DecorativeMosaicSettings.MinimumSizeFactor)
|
||||
* Hlsl.Saturate(1f - edgeDistance / (DecorativeMosaicSettings.DetailRangeFactor * spacing));
|
||||
|
||||
@@ -19,19 +19,15 @@ internal sealed class DecorativeMosaicPipeline : IDisposable
|
||||
private ReadWriteBuffer<int>? _jumpFloodA;
|
||||
private ReadWriteBuffer<int>? _jumpFloodB;
|
||||
private ReadWriteBuffer<int>? _siteMap;
|
||||
private ReadWriteBuffer<float>? _sitePosX;
|
||||
private ReadWriteBuffer<float>? _sitePosY;
|
||||
private ReadWriteBuffer<float>? _siteTheta;
|
||||
private ReadWriteBuffer<float>? _siteSize;
|
||||
private ReadWriteBuffer<Float4>? _site;
|
||||
private ReadWriteBuffer<Float2>? _siteReference;
|
||||
private ReadWriteBuffer<int>? _siteRank;
|
||||
private ReadWriteBuffer<int>? _sumX;
|
||||
private ReadWriteBuffer<int>? _sumY;
|
||||
private ReadWriteBuffer<int>? _count;
|
||||
private ReadBackBuffer<float>? _posXReadBack;
|
||||
private ReadBackBuffer<float>? _posYReadBack;
|
||||
private ReadBackBuffer<Float4>? _siteReadBack;
|
||||
private ReadBackBuffer<int>? _rankReadBack;
|
||||
private float[]? _cachedPosX;
|
||||
private float[]? _cachedPosY;
|
||||
private Float4[]? _cachedSites;
|
||||
private int[]? _cachedRank;
|
||||
private int _cachedSiteCount;
|
||||
private StructureKey? _structureKey;
|
||||
@@ -153,15 +149,12 @@ internal sealed class DecorativeMosaicPipeline : IDisposable
|
||||
using (ComputeContext context = _device.CreateComputeContext())
|
||||
RecordGrowthStage(in context, in derived, in parameters);
|
||||
_scratchReadBack.CopyFrom(_scratch);
|
||||
var posXReadBack = _posXReadBack!;
|
||||
var posYReadBack = _posYReadBack!;
|
||||
var siteReadBack = _siteReadBack!;
|
||||
var rankReadBack = _rankReadBack!;
|
||||
posXReadBack.CopyFrom(_sitePosX!);
|
||||
posYReadBack.CopyFrom(_sitePosY!);
|
||||
siteReadBack.CopyFrom(_site!);
|
||||
rankReadBack.CopyFrom(_siteRank!);
|
||||
_cachedSiteCount = _scratchReadBack.Span[0];
|
||||
posXReadBack.Span.CopyTo(_cachedPosX!);
|
||||
posYReadBack.Span.CopyTo(_cachedPosY!);
|
||||
siteReadBack.Span.CopyTo(_cachedSites!);
|
||||
rankReadBack.Span.CopyTo(_cachedRank!);
|
||||
BuildBoundsPrefix();
|
||||
_structureKey = key;
|
||||
@@ -277,48 +270,43 @@ internal sealed class DecorativeMosaicPipeline : IDisposable
|
||||
context.Barrier(_edgeDistance!);
|
||||
|
||||
context.For(gridWidth, gridHeight, new SpawnShader(
|
||||
_mask!, _theta!, _edgeDistance!, _sitePosX!, _sitePosY!, _siteTheta!, _siteSize!, _siteRank!, _scratch,
|
||||
_mask!, _theta!, _edgeDistance!, _site!, _siteReference!, _siteRank!,
|
||||
_sumX!, _sumY!, _count!, _scratch,
|
||||
gridWidth, gridHeight, cellSize, derived.Spacing, parameters.Detail, parameters.Seed));
|
||||
context.Barrier(_sitePosX!);
|
||||
context.Barrier(_sitePosY!);
|
||||
context.Barrier(_siteTheta!);
|
||||
context.Barrier(_siteSize!);
|
||||
context.Barrier(_site!);
|
||||
context.Barrier(_siteReference!);
|
||||
context.Barrier(_siteRank!);
|
||||
context.Barrier(_sumX!);
|
||||
context.Barrier(_sumY!);
|
||||
context.Barrier(_count!);
|
||||
context.Barrier(_scratch);
|
||||
|
||||
for (var iteration = 0; iteration < derived.Iterations; iteration++)
|
||||
{
|
||||
RecordSiteVoronoi(in context, in derived, out reading);
|
||||
context.For(gridLength, new FillIntShader(_sumX!, gridLength, 0));
|
||||
context.For(gridLength, new FillIntShader(_sumY!, gridLength, 0));
|
||||
context.For(gridLength, new FillIntShader(_count!, gridLength, 0));
|
||||
context.Barrier(_sumX!);
|
||||
context.Barrier(_sumY!);
|
||||
context.Barrier(_count!);
|
||||
RecordSiteVoronoi(in context, in derived);
|
||||
var avoidWidth = iteration < derived.Iterations - DecorativeMosaicSettings.OpenIterations ? derived.AvoidWidth : 0f;
|
||||
context.For(gridWidth, gridHeight, new CentroidAccumulateShader(
|
||||
reading, _mask!, _edgeDistance!, _sitePosX!, _sitePosY!, _sumX!, _sumY!, _count!,
|
||||
_siteMap!, _mask!, _edgeDistance!, _siteReference!, _sumX!, _sumY!, _count!,
|
||||
gridWidth, gridHeight, cellSize, avoidWidth, derived.Cutoff));
|
||||
context.Barrier(_sumX!);
|
||||
context.Barrier(_sumY!);
|
||||
context.Barrier(_count!);
|
||||
context.For(gridWidth, gridHeight, new SiteMoveShader(
|
||||
_siteRank!, _sitePosX!, _sitePosY!, _siteTheta!, _siteSize!, _sumX!, _sumY!, _count!,
|
||||
_siteRank!, _site!, _siteReference!, _sumX!, _sumY!, _count!,
|
||||
_theta!, _edgeDistance!, _scratch, gridWidth, gridHeight, cellSize, derived.Spacing, parameters.Detail));
|
||||
context.Barrier(_sitePosX!);
|
||||
context.Barrier(_sitePosY!);
|
||||
context.Barrier(_siteTheta!);
|
||||
context.Barrier(_siteSize!);
|
||||
context.Barrier(_site!);
|
||||
context.Barrier(_siteReference!);
|
||||
context.Barrier(_siteRank!);
|
||||
context.Barrier(_sumX!);
|
||||
context.Barrier(_sumY!);
|
||||
context.Barrier(_count!);
|
||||
}
|
||||
|
||||
RecordSiteVoronoi(in context, in derived, out reading);
|
||||
context.For(gridLength, new CopyIntShader(reading, _siteMap!, gridLength));
|
||||
context.Barrier(_siteMap!);
|
||||
RecordSiteVoronoi(in context, in derived);
|
||||
context.Barrier(_scratch);
|
||||
}
|
||||
|
||||
private void RecordSiteVoronoi(in ComputeContext context, in DerivedValues derived, out ReadWriteBuffer<int> result)
|
||||
private void RecordSiteVoronoi(in ComputeContext context, in DerivedValues derived)
|
||||
{
|
||||
var gridWidth = _gridWidth;
|
||||
var gridHeight = _gridHeight;
|
||||
@@ -326,21 +314,21 @@ internal sealed class DecorativeMosaicPipeline : IDisposable
|
||||
context.For(gridLength, new FillIntShader(_jumpFloodA!, gridLength, DecorativeMosaicSettings.SiteSentinel));
|
||||
context.Barrier(_jumpFloodA!);
|
||||
context.For(gridWidth, gridHeight, new SiteSeedShader(
|
||||
_siteRank!, _sitePosX!, _sitePosY!, _jumpFloodA!, gridWidth, gridHeight, derived.CellSize));
|
||||
_siteRank!, _site!, _jumpFloodA!, gridWidth, gridHeight, derived.CellSize));
|
||||
context.Barrier(_jumpFloodA!);
|
||||
var reading = _jumpFloodA!;
|
||||
var writing = _jumpFloodB!;
|
||||
var stepSize = InitialJumpFloodStep(gridWidth, gridHeight);
|
||||
while (stepSize >= 1)
|
||||
{
|
||||
var target = stepSize == 1 ? _siteMap! : writing;
|
||||
context.For(gridWidth, gridHeight, new SiteJumpFloodPassShader(
|
||||
reading, writing, _sitePosX!, _sitePosY!, _siteTheta!, _siteSize!,
|
||||
reading, target, _site!,
|
||||
gridWidth, gridHeight, stepSize, derived.CellSize, derived.Gamma));
|
||||
context.Barrier(writing);
|
||||
(reading, writing) = (writing, reading);
|
||||
context.Barrier(target);
|
||||
(reading, writing) = (target, reading);
|
||||
stepSize >>= 1;
|
||||
}
|
||||
result = reading;
|
||||
}
|
||||
|
||||
private void RecordRenderStage(
|
||||
@@ -354,7 +342,7 @@ internal sealed class DecorativeMosaicPipeline : IDisposable
|
||||
in Parameters parameters)
|
||||
{
|
||||
context.For(rect.Width, rect.Height, new RenderShader(
|
||||
_siteMap!, _sitePosX!, _sitePosY!, _siteTheta!, _siteSize!, _siteRank!, source, output,
|
||||
_siteMap!, _site!, _siteRank!, source, output,
|
||||
rect.X, rect.Y, rect.Width, rect.Height, _gridWidth, _gridHeight,
|
||||
canvasWidth, canvasHeight, derived.CellSize, derived.Gamma, derived.HalfBase,
|
||||
DecorativeMosaicSettings.GetVisibleCount(parameters.Laying), parameters.Seed,
|
||||
@@ -385,15 +373,14 @@ internal sealed class DecorativeMosaicPipeline : IDisposable
|
||||
}
|
||||
|
||||
var ranks = _cachedRank!;
|
||||
var posX = _cachedPosX!;
|
||||
var posY = _cachedPosY!;
|
||||
var sites = _cachedSites!;
|
||||
for (var index = 0; index < ranks.Length; index++)
|
||||
{
|
||||
var rank = ranks[index];
|
||||
if (rank < 0 || rank >= DecorativeMosaicSettings.LayingSteps)
|
||||
continue;
|
||||
var x = posX[index];
|
||||
var y = posY[index];
|
||||
var x = sites[index].X;
|
||||
var y = sites[index].Y;
|
||||
if (x < _boundsMinX[rank])
|
||||
_boundsMinX[rank] = x;
|
||||
if (x > _boundsMaxX[rank])
|
||||
@@ -451,19 +438,15 @@ internal sealed class DecorativeMosaicPipeline : IDisposable
|
||||
_jumpFloodA = _device.AllocateReadWriteBuffer<int>(gridLength);
|
||||
_jumpFloodB = _device.AllocateReadWriteBuffer<int>(gridLength);
|
||||
_siteMap = _device.AllocateReadWriteBuffer<int>(gridLength);
|
||||
_sitePosX = _device.AllocateReadWriteBuffer<float>(gridLength);
|
||||
_sitePosY = _device.AllocateReadWriteBuffer<float>(gridLength);
|
||||
_siteTheta = _device.AllocateReadWriteBuffer<float>(gridLength);
|
||||
_siteSize = _device.AllocateReadWriteBuffer<float>(gridLength);
|
||||
_site = _device.AllocateReadWriteBuffer<Float4>(gridLength);
|
||||
_siteReference = _device.AllocateReadWriteBuffer<Float2>(gridLength);
|
||||
_siteRank = _device.AllocateReadWriteBuffer<int>(gridLength);
|
||||
_sumX = _device.AllocateReadWriteBuffer<int>(gridLength);
|
||||
_sumY = _device.AllocateReadWriteBuffer<int>(gridLength);
|
||||
_count = _device.AllocateReadWriteBuffer<int>(gridLength);
|
||||
_posXReadBack = _device.AllocateReadBackBuffer<float>(gridLength);
|
||||
_posYReadBack = _device.AllocateReadBackBuffer<float>(gridLength);
|
||||
_siteReadBack = _device.AllocateReadBackBuffer<Float4>(gridLength);
|
||||
_rankReadBack = _device.AllocateReadBackBuffer<int>(gridLength);
|
||||
_cachedPosX = new float[gridLength];
|
||||
_cachedPosY = new float[gridLength];
|
||||
_cachedSites = new Float4[gridLength];
|
||||
_cachedRank = new int[gridLength];
|
||||
_cachedSiteCount = 0;
|
||||
_gridWidth = gridWidth;
|
||||
@@ -492,16 +475,13 @@ internal sealed class DecorativeMosaicPipeline : IDisposable
|
||||
_jumpFloodA?.Dispose();
|
||||
_jumpFloodB?.Dispose();
|
||||
_siteMap?.Dispose();
|
||||
_sitePosX?.Dispose();
|
||||
_sitePosY?.Dispose();
|
||||
_siteTheta?.Dispose();
|
||||
_siteSize?.Dispose();
|
||||
_site?.Dispose();
|
||||
_siteReference?.Dispose();
|
||||
_siteRank?.Dispose();
|
||||
_sumX?.Dispose();
|
||||
_sumY?.Dispose();
|
||||
_count?.Dispose();
|
||||
_posXReadBack?.Dispose();
|
||||
_posYReadBack?.Dispose();
|
||||
_siteReadBack?.Dispose();
|
||||
_rankReadBack?.Dispose();
|
||||
_mask = null;
|
||||
_luminance = null;
|
||||
@@ -510,19 +490,15 @@ internal sealed class DecorativeMosaicPipeline : IDisposable
|
||||
_jumpFloodA = null;
|
||||
_jumpFloodB = null;
|
||||
_siteMap = null;
|
||||
_sitePosX = null;
|
||||
_sitePosY = null;
|
||||
_siteTheta = null;
|
||||
_siteSize = null;
|
||||
_site = null;
|
||||
_siteReference = null;
|
||||
_siteRank = null;
|
||||
_sumX = null;
|
||||
_sumY = null;
|
||||
_count = null;
|
||||
_posXReadBack = null;
|
||||
_posYReadBack = null;
|
||||
_siteReadBack = null;
|
||||
_rankReadBack = null;
|
||||
_cachedPosX = null;
|
||||
_cachedPosY = null;
|
||||
_cachedSites = null;
|
||||
_cachedRank = null;
|
||||
_cachedSiteCount = 0;
|
||||
_structureKey = null;
|
||||
|
||||
@@ -11,7 +11,7 @@ YukkuriMovieMaker4(YMM4)上で動作する、素材のエッジに沿う方
|
||||
タイルの配置はシードから決定論的に決まり、同じ設定では常に同じ配置になります。
|
||||
強さ、敷設、大きさ、目地幅、細長さ、乱れ、細部、整列、エッジ検出、立体感、色むら、目地濃度の12項目はアニメーションに対応しています。
|
||||
|
||||

|
||||

|
||||
|
||||
---
|
||||
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする