コミットを比較
| 作成者 | SHA1 | 日付 | |
|---|---|---|---|
|
|
bf52831f67
|
||
|
|
9553df43c4
|
||
|
|
afc4e27604
|
||
|
|
f13d4fccba
|
||
|
|
77c711b9e6
|
||
|
|
e470646a82
|
||
|
|
4f3768cd4d
|
||
|
|
dbcc8368e3
|
||
|
|
748e77f7bf
|
||
|
|
2fac42dd39
|
||
|
|
553c00406e
|
||
|
|
3eb92beb00
|
||
|
|
7e6253f141
|
||
|
|
4df2b0bbea
|
||
|
|
5b59e5d21f
|
||
|
|
2b601c51ca
|
||
|
|
ed51bd90cc
|
||
|
|
c490194600
|
||
|
|
50aa34fa03
|
||
|
|
be0e51c600
|
||
|
|
ee6ee04f5b
|
||
|
|
ec4854f029
|
||
|
|
aec9eb73cc
|
||
|
|
bb341dc4bd
|
||
|
|
4c2fb33b3c
|
||
|
|
bc64831464
|
||
|
|
3c480fd289
|
||
|
|
b9c3e3ac97
|
||
|
|
dd70dc5245
|
||
|
|
44ee168572
|
||
|
|
fb1b7178bc
|
||
|
|
1aad2c3ff7
|
||
|
|
755172b324
|
||
|
|
0946630a61
|
||
|
|
d80f20a9c4
|
||
|
|
9f10f7f88c
|
||
|
|
ff989e0488
|
||
|
|
5fd0ecbcd5
|
||
|
|
59bf986f99
|
検索条件に一致するファイルはありません
@@ -0,0 +1,517 @@
|
||||
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@v7
|
||||
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
|
||||
fetch-depth: 0
|
||||
|
||||
- name: MSBuild のセットアップ
|
||||
uses: microsoft/setup-msbuild@v3
|
||||
|
||||
- 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" = "Halo-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
|
||||
}
|
||||
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
|
||||
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
|
||||
echo "VERSION=$($tag.TrimStart('v'))" >> $env:GITHUB_OUTPUT
|
||||
|
||||
- name: バージョン記載の照合
|
||||
shell: pwsh
|
||||
run: |
|
||||
$tag = "${{ steps.version.outputs.TAG }}"
|
||||
$version = "${{ steps.version.outputs.VERSION }}"
|
||||
$problems = @()
|
||||
|
||||
$csprojPath = "Halo/Halo.csproj"
|
||||
$csproj = Get-Content $csprojPath -Raw
|
||||
if (-not $csproj.Contains("<Version>$version</Version>")) {
|
||||
$current = if ($csproj -match '<Version>([^<]*)</Version>') { $Matches[1] } else { "記載なし" }
|
||||
$problems += "$csprojPath の <Version> が $current です。$version にしてください。"
|
||||
}
|
||||
|
||||
$readmePath = ".github/Plugin_Readme.txt"
|
||||
$readme = Get-Content $readmePath -Raw
|
||||
if (-not $readme.Contains(" ハロ for YMM4 $tag")) {
|
||||
$current = if ($readme -match '(?m)^ ハロ for YMM4 (\S+)') { $Matches[1] } else { "記載なし" }
|
||||
$problems += "$readmePath の見出しが $current です。$tag にしてください。"
|
||||
}
|
||||
|
||||
if ($problems.Count -eq 0) {
|
||||
Write-Host "バージョン記載は $tag と一致しています"
|
||||
exit 0
|
||||
}
|
||||
|
||||
foreach ($problem in $problems) {
|
||||
Write-Host "::error::$problem"
|
||||
}
|
||||
Write-Host "::error::リリースの対象は $tag が指すコミットです。タグを付けた後で main へ訂正を積んでも、その訂正はリリースに入りません。タグを削除し、記載を直したコミットを積んでから付け直してください。"
|
||||
exit 1
|
||||
|
||||
- name: シェーダーのビルド
|
||||
shell: pwsh
|
||||
run: |
|
||||
msbuild Halo.Shader/Halo.Shader.vcxproj `
|
||||
/p:Configuration=Release `
|
||||
/p:Platform=Win32 `
|
||||
/nologo
|
||||
|
||||
- name: プロジェクトのビルド
|
||||
shell: pwsh
|
||||
run: |
|
||||
$proj = "Halo/Halo.csproj"
|
||||
dotnet build "$proj" `
|
||||
-c Release `
|
||||
-p:YMM4DirPath="${{ steps.ymm4.outputs.YMM4_DIR }}" `
|
||||
-p:SkipPluginDeploy=true
|
||||
|
||||
- name: パッケージの作成
|
||||
id: package
|
||||
shell: pwsh
|
||||
run: |
|
||||
$version = "${{ steps.version.outputs.TAG }}"
|
||||
$outDir = "Halo/bin/Release/net10.0-windows10.0.19041.0"
|
||||
$stageRoot = "stage/Halo"
|
||||
$pkgName = "Halo_$version.ymme"
|
||||
|
||||
New-Item -ItemType Directory -Path $stageRoot -Force | Out-Null
|
||||
New-Item -ItemType Directory -Path "$stageRoot/LICENSE" -Force | Out-Null
|
||||
|
||||
$dll = "$outDir/Halo.dll"
|
||||
if (-not (Test-Path $dll)) {
|
||||
Write-Error "ビルド結果に Halo.dll が見つかりませんでした: $dll"
|
||||
exit 1
|
||||
}
|
||||
Copy-Item $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"
|
||||
|
||||
$readme = Get-Content "$stageRoot/Readme.txt" -Raw
|
||||
if (-not $readme.Contains(" ハロ for YMM4 $version")) {
|
||||
Write-Error "同梱する Readme.txt の見出しが $version と一致しません"
|
||||
exit 1
|
||||
}
|
||||
|
||||
Compress-Archive -Path "stage/*" -DestinationPath $pkgName -CompressionLevel Optimal
|
||||
echo "PKG_NAME=$pkgName" >> $env:GITHUB_OUTPUT
|
||||
|
||||
- name: 変更履歴の作成
|
||||
id: changelog
|
||||
shell: pwsh
|
||||
env:
|
||||
GITEA_TOKEN: ${{ github.token }}
|
||||
TAG: ${{ steps.version.outputs.TAG }}
|
||||
REPOSITORY: ${{ github.repository }}
|
||||
SERVER_URL: ${{ github.server_url }}
|
||||
PACKAGE: ${{ steps.package.outputs.PKG_NAME }}
|
||||
run: |
|
||||
$tag = $env:TAG
|
||||
$repository = $env:REPOSITORY
|
||||
$server = $env:SERVER_URL
|
||||
$code = [char]0x60
|
||||
$fence = [string]::new($code, 3)
|
||||
$unit = [char]0x1f
|
||||
$record = [char]0x1e
|
||||
|
||||
$previous = ""
|
||||
$candidates = @(git tag --list "v*" --merged $tag --sort=-creatordate | Where-Object { $_ -ne $tag })
|
||||
if ($candidates.Count -gt 0) {
|
||||
$previous = $candidates[0]
|
||||
}
|
||||
Write-Host "直前のタグ: $previous"
|
||||
|
||||
$range = if ($previous) { "$previous..$tag" } else { $tag }
|
||||
$log = (@(git log "--format=%H%x1f%s%x1f%an%x1f%ad%x1f%b%x1e" --date=short $range) -join "`n") -split $record
|
||||
|
||||
$commits = @()
|
||||
foreach ($entry in $log) {
|
||||
if (-not $entry.Trim()) { continue }
|
||||
$fields = $entry.TrimStart("`n") -split $unit
|
||||
if ($fields.Count -lt 5) { continue }
|
||||
$commits += [pscustomobject]@{
|
||||
Sha = $fields[0]
|
||||
Subject = $fields[1]
|
||||
Name = $fields[2]
|
||||
Date = $fields[3]
|
||||
Body = $fields[4]
|
||||
Login = ""
|
||||
Avatar = ""
|
||||
}
|
||||
}
|
||||
Write-Host "コミット数: $($commits.Count)"
|
||||
|
||||
$categories = [ordered]@{
|
||||
A = @{ Title = "追加"; Symbol = "+"; Items = [System.Collections.Generic.List[pscustomobject]]::new() }
|
||||
M = @{ Title = "変更"; Symbol = "~"; Items = [System.Collections.Generic.List[pscustomobject]]::new() }
|
||||
D = @{ Title = "削除"; Symbol = "-"; Items = [System.Collections.Generic.List[pscustomobject]]::new() }
|
||||
F = @{ Title = "修正"; Symbol = "!"; Items = [System.Collections.Generic.List[pscustomobject]]::new() }
|
||||
}
|
||||
foreach ($commit in $commits) {
|
||||
if (-not $commit.Body) { continue }
|
||||
foreach ($bodyLine in ($commit.Body -split "`n")) {
|
||||
$trimmed = $bodyLine.Trim()
|
||||
if ($trimmed -notmatch '^・(.+)-([AMDF])$') { continue }
|
||||
$categories[$Matches[2]].Items.Add([pscustomobject]@{ Text = $Matches[1]; Sha = $commit.Sha })
|
||||
}
|
||||
}
|
||||
|
||||
$pending = [System.Collections.Generic.HashSet[string]]::new()
|
||||
foreach ($commit in $commits) {
|
||||
[void]$pending.Add($commit.Sha)
|
||||
}
|
||||
|
||||
$headers = @{ Authorization = "token $env:GITEA_TOKEN" }
|
||||
|
||||
$accounts = @{}
|
||||
$page = 1
|
||||
while ($pending.Count -gt 0 -and $page -le 20) {
|
||||
$rows = @()
|
||||
try {
|
||||
$rows = @(Invoke-RestMethod -Uri "$server/api/v1/repos/$repository/commits?sha=$tag&limit=50&page=$page&stat=false&verification=false&files=false" -Headers $headers)
|
||||
}
|
||||
catch {
|
||||
Write-Host "コミットの作者を取得できませんでした: $($_.Exception.Message)"
|
||||
break
|
||||
}
|
||||
if ($rows.Count -eq 0) { break }
|
||||
|
||||
foreach ($row in $rows) {
|
||||
if ($pending.Remove($row.sha)) {
|
||||
$login = ""
|
||||
$avatar = ""
|
||||
if ($row.author) {
|
||||
$login = [string]$row.author.login
|
||||
$avatar = [string]$row.author.avatar_url
|
||||
}
|
||||
$accounts[$row.sha] = @{ Login = $login; Avatar = $avatar }
|
||||
}
|
||||
}
|
||||
|
||||
if ($rows.Count -lt 50) { break }
|
||||
$page++
|
||||
}
|
||||
|
||||
foreach ($commit in $commits) {
|
||||
if ($accounts.ContainsKey($commit.Sha)) {
|
||||
$commit.Login = $accounts[$commit.Sha].Login
|
||||
$commit.Avatar = $accounts[$commit.Sha].Avatar
|
||||
}
|
||||
}
|
||||
|
||||
$emptyTree = "4b825dc642cb6eb9a060e54bf8d69288fbee4904"
|
||||
$base = if ($previous) { $previous } else { $emptyTree }
|
||||
$shortstat = (@(git diff --shortstat $base $tag) -join " ")
|
||||
$changedFiles = 0
|
||||
$insertions = 0
|
||||
$deletions = 0
|
||||
if ($shortstat -match "(\d+) file") { $changedFiles = [int]$Matches[1] }
|
||||
if ($shortstat -match "(\d+) insertion") { $insertions = [int]$Matches[1] }
|
||||
if ($shortstat -match "(\d+) deletion") { $deletions = [int]$Matches[1] }
|
||||
$diffStat = @(git diff --stat $base $tag)
|
||||
$tagDate = (git log -1 "--format=%ad" --date=short $tag)
|
||||
|
||||
$contributors = @($commits |
|
||||
Group-Object -Property { if ($_.Login) { $_.Login } else { $_.Name } } |
|
||||
Sort-Object -Property Count -Descending)
|
||||
|
||||
function Get-Icon($avatar, $login, $size) {
|
||||
if (-not $avatar) { return "" }
|
||||
$sized = if ($avatar.Contains("?")) { "$avatar&s=$($size * 2)" } else { "$avatar" + "?s=$($size * 2)" }
|
||||
return "<img src=""$sized"" width=""$size"" height=""$size"" alt=""$login""> "
|
||||
}
|
||||
|
||||
$package = Get-Item $env:PACKAGE
|
||||
$size = [math]::Round($package.Length / 1MB, 2)
|
||||
|
||||
$body = [System.Collections.Generic.List[string]]::new()
|
||||
$body.Add("## 概要")
|
||||
$body.Add("")
|
||||
$body.Add("| 項目 | 内容 |")
|
||||
$body.Add("|---|---|")
|
||||
$body.Add("| タグ | [$tag]($server/$repository/tree/$tag) |")
|
||||
$body.Add("| 公開日 | $tagDate |")
|
||||
if ($previous) {
|
||||
$body.Add("| 直前のリリース | [$previous]($server/$repository/releases/tag/$previous) |")
|
||||
}
|
||||
$body.Add("| コミット数 | $($commits.Count) |")
|
||||
$body.Add("| 貢献者 | $($contributors.Count) 名 |")
|
||||
$body.Add("| 変更されたファイル | $changedFiles |")
|
||||
$body.Add("| 追加された行 | $insertions |")
|
||||
$body.Add("| 削除された行 | $deletions |")
|
||||
|
||||
$hasHighlights = ($categories.Values | ForEach-Object { $_.Items.Count } | Measure-Object -Sum).Sum -gt 0
|
||||
if ($hasHighlights) {
|
||||
$body.Add("")
|
||||
$body.Add("## 主な変更")
|
||||
foreach ($key in $categories.Keys) {
|
||||
$category = $categories[$key]
|
||||
if ($category.Items.Count -eq 0) { continue }
|
||||
$body.Add("")
|
||||
$body.Add("### [$($category.Symbol)] $($category.Title)")
|
||||
$body.Add("")
|
||||
foreach ($item in $category.Items) {
|
||||
$short = $item.Sha.Substring(0, 7)
|
||||
$body.Add("- $($item.Text) ([$code$short$code]($server/$repository/commit/$($item.Sha)))")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$body.Add("")
|
||||
$body.Add("## ダウンロード")
|
||||
$body.Add("")
|
||||
$body.Add("| ファイル | サイズ |")
|
||||
$body.Add("|---|---|")
|
||||
$body.Add("| $($package.Name) | $size MB |")
|
||||
|
||||
$body.Add("")
|
||||
$body.Add("## 貢献者")
|
||||
$body.Add("")
|
||||
$body.Add("| 貢献者 | コミット数 |")
|
||||
$body.Add("|---|---|")
|
||||
foreach ($contributor in $contributors) {
|
||||
$first = $contributor.Group[0]
|
||||
if ($first.Login) {
|
||||
$name = (Get-Icon $first.Avatar $first.Login 40) + "[@$($first.Login)]($server/$($first.Login))"
|
||||
}
|
||||
else {
|
||||
$name = $first.Name
|
||||
}
|
||||
$body.Add("| $name | $($contributor.Count) |")
|
||||
}
|
||||
|
||||
$body.Add("")
|
||||
$body.Add("## 変更履歴")
|
||||
$body.Add("")
|
||||
$body.Add("| コミット | 内容 | 貢献者 | 日付 |")
|
||||
$body.Add("|---|---|---|---|")
|
||||
$maximumCommits = 300
|
||||
$listed = 0
|
||||
foreach ($commit in $commits) {
|
||||
if ($listed -ge $maximumCommits) { break }
|
||||
$short = $commit.Sha.Substring(0, 7)
|
||||
$subject = $commit.Subject -replace '\|', '\|'
|
||||
if ($commit.Login) {
|
||||
$author = (Get-Icon $commit.Avatar $commit.Login 20) + "[@$($commit.Login)]($server/$($commit.Login))"
|
||||
}
|
||||
else {
|
||||
$author = $commit.Name
|
||||
}
|
||||
$body.Add("| [$code$short$code]($server/$repository/commit/$($commit.Sha)) | $subject | $author | $($commit.Date) |")
|
||||
$listed++
|
||||
}
|
||||
if ($commits.Count -gt $maximumCommits) {
|
||||
$body.Add("")
|
||||
$body.Add("残り $($commits.Count - $maximumCommits) 件のコミットは省略しました。")
|
||||
}
|
||||
|
||||
if ($diffStat.Count -gt 0) {
|
||||
$body.Add("")
|
||||
$body.Add("## 変更されたファイル")
|
||||
$body.Add("")
|
||||
$body.Add("<details>")
|
||||
$body.Add("<summary>差分の統計</summary>")
|
||||
$body.Add("")
|
||||
$body.Add($fence)
|
||||
$maximumStatLines = 200
|
||||
$shown = 0
|
||||
foreach ($line in $diffStat) {
|
||||
if ($shown -ge $maximumStatLines) { break }
|
||||
$body.Add($line)
|
||||
$shown++
|
||||
}
|
||||
if ($diffStat.Count -gt $maximumStatLines) {
|
||||
$body.Add("... 残り $($diffStat.Count - $maximumStatLines) 行は省略しました。")
|
||||
}
|
||||
$body.Add($fence)
|
||||
$body.Add("")
|
||||
$body.Add("</details>")
|
||||
}
|
||||
|
||||
if ($previous) {
|
||||
$body.Add("")
|
||||
$body.Add("## 全ての変更")
|
||||
$body.Add("")
|
||||
$body.Add("$server/$repository/compare/$previous...$tag")
|
||||
}
|
||||
|
||||
$path = "release-body.md"
|
||||
Set-Content -Path $path -Value ($body -join "`n") -Encoding utf8NoBOM
|
||||
if (-not (Test-Path $path)) {
|
||||
throw "変更履歴を作成できませんでした。"
|
||||
}
|
||||
Write-Host "変更履歴の行数: $($body.Count)"
|
||||
$global:LASTEXITCODE = 0
|
||||
|
||||
- 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: release-body.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)"
|
||||
}
|
||||
}
|
||||
|
||||
+15
-7
@@ -1,5 +1,5 @@
|
||||
========================================
|
||||
ハロ for YMM4 v1.0.0
|
||||
ハロ for YMM4 v1.0.2
|
||||
========================================
|
||||
YukkuriMovieMaker4上で動作する、
|
||||
太陽の高度とカメラの向きから、空に浮かぶ六角柱の氷晶を光が通る経路を求め、
|
||||
@@ -38,9 +38,10 @@ Graphics Techniques、2013年)に基づきます。
|
||||
|
||||
- 処理対象: ハロの位置と色は映像の内容から決めません。
|
||||
映像の色はハロを足す下地として使うだけです。空と地面は区別されず、
|
||||
不透明な画素のすべてに、同じ規則でハロを足します。空だけに重ねたいときは、
|
||||
空以外を透明にした映像にこのエフェクトを適用してください。履歴フレーム、
|
||||
外部画像、深度情報、学習済みモデルは使用しません。
|
||||
不透明度が0でない画素のすべてに、同じ規則でハロを足します。
|
||||
空だけに重ねたいときは、空以外を透明にした映像にこのエフェクトを
|
||||
適用してください。履歴フレーム、外部画像、深度情報、学習済みモデルは
|
||||
使用しません。
|
||||
|
||||
- 明るさ: ハロの明るさは映像の明るさに合わせません。
|
||||
足した結果は0から1に収めるため、すでに白い部分ではハロが見えません。
|
||||
@@ -110,7 +111,7 @@ Graphics Techniques、2013年)に基づきます。
|
||||
- 強さ0%: 強さが0%のときは、表の計算も合成も行わず、映像をそのまま通します。
|
||||
|
||||
- 再現性: 結果は入力の映像と設定と画素の位置だけから決まります。
|
||||
時間値と乱数は使いません。表の計算は並列に行いますが、整数で足し合わせるか、
|
||||
時刻と乱数は使いません。表の計算は並列に行いますが、整数で足し合わせるか、
|
||||
足し合わせの順序を固定するため、同じフレームは何度描いても同じ結果になります。
|
||||
|
||||
- 透明部分: 不透明度が0の画素は変更しません。出力の不透明度は入力と同じです。
|
||||
@@ -126,15 +127,22 @@ Graphics Techniques、2013年)に基づきます。
|
||||
■ 不具合の報告
|
||||
--------------------------------------------------------------------------------
|
||||
本プラグインは、想定していない例外が起きたときに、その内容を開発者へ自動で
|
||||
送信します。同意は求めず、常に送信します。
|
||||
送信します。同意は求めません。止める設定もありません。
|
||||
|
||||
送信する数には上限があります。YMM4の1回の起動で送る報告は、
|
||||
YMM4-Telemetryで報告する別のプラグインと合わせて20件までです。
|
||||
例外の型と発生位置が同じ報告は3件までです。上限を超えた報告と、
|
||||
送信先から待つよう求められている間に起きた報告は、送信も退避もしません。
|
||||
|
||||
送信する情報は次のとおりです。
|
||||
例外 : 型の完全名、メッセージ、スタックトレース
|
||||
発生位置 : モジュール名、関数名、ファイル名、行番号
|
||||
発生位置 : モジュール名、関数名、ファイル名、行番号、
|
||||
プラグイン自身のコードかどうか
|
||||
プラグイン : アセンブリ名、バージョン
|
||||
実行環境 : OSの名前とバージョン、.NETのバージョン、
|
||||
CPUのアーキテクチャ、論理プロセッサ数
|
||||
識別子 : YMM4の起動ごとに決まるセッション識別子、報告ごとの識別子
|
||||
時刻 : 報告を作った時刻(UTC)
|
||||
|
||||
映像の中身とプロジェクトの内容は送信しません。継続して個人を追跡する
|
||||
識別子も持ちません。セッション識別子はYMM4を起動し直すと別の値に
|
||||
|
||||
+3
-3
@@ -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 "YMM4-Telemetry"]
|
||||
path = YMM4-Telemetry
|
||||
url = https://github.com/routersys/YMM4-Telemetry.git
|
||||
url = https://git.routersys.com/routersys/YMM4-Telemetry.git
|
||||
@@ -31,6 +31,10 @@ internal static class HarnessCases
|
||||
yield return ("column-arcs-0", Create(effect => effect.ColumnArcs.Values[0].Value = 0), [0]);
|
||||
yield return ("plate-halos-only", Create(effect => { effect.RandomHalos.Values[0].Value = 0; effect.ColumnArcs.Values[0].Value = 0; effect.PlateHalos.Values[0].Value = 100; }), [0]);
|
||||
yield return ("column-arcs-only", Create(effect => { effect.RandomHalos.Values[0].Value = 0; effect.PlateHalos.Values[0].Value = 0; effect.ColumnArcs.Values[0].Value = 100; }), [0]);
|
||||
yield return ("plate-halos-only-zenith", Create(effect => { effect.RandomHalos.Values[0].Value = 0; effect.ColumnArcs.Values[0].Value = 0; effect.PlateHalos.Values[0].Value = 100; effect.SunElevation.Values[0].Value = 90; effect.CameraPitch.Values[0].Value = 90; }), [0]);
|
||||
yield return ("column-arcs-only-zenith", Create(effect => { effect.RandomHalos.Values[0].Value = 0; effect.PlateHalos.Values[0].Value = 0; effect.ColumnArcs.Values[0].Value = 100; effect.SunElevation.Values[0].Value = 90; effect.CameraPitch.Values[0].Value = 90; }), [0]);
|
||||
yield return ("plate-halos-only-horizon", Create(effect => { effect.RandomHalos.Values[0].Value = 0; effect.ColumnArcs.Values[0].Value = 0; effect.PlateHalos.Values[0].Value = 100; effect.SunElevation.Values[0].Value = 0; effect.CameraPitch.Values[0].Value = 0; }), [0]);
|
||||
yield return ("column-arcs-only-horizon", Create(effect => { effect.RandomHalos.Values[0].Value = 0; effect.PlateHalos.Values[0].Value = 0; effect.ColumnArcs.Values[0].Value = 100; effect.SunElevation.Values[0].Value = 0; effect.CameraPitch.Values[0].Value = 0; }), [0]);
|
||||
yield return ("plate-thickness-0.05", Create(effect => effect.PlateThickness.Values[0].Value = 0.05), [0]);
|
||||
yield return ("plate-thickness-1", Create(effect => effect.PlateThickness.Values[0].Value = 1), [0]);
|
||||
yield return ("column-length-1", Create(effect => effect.ColumnLength.Values[0].Value = 1), [0]);
|
||||
|
||||
@@ -174,6 +174,34 @@
|
||||
],
|
||||
"hash": "AC82CBF713F74760931D8D0771B4DF89E735B5DF12167993D17E95B016B01B8B"
|
||||
},
|
||||
{
|
||||
"name": "plate-halos-only-zenith",
|
||||
"frames": [
|
||||
0
|
||||
],
|
||||
"hash": "708C73B53F9DB54D5A588CAFA16285943B7C7F05914019F9D46998D590BE161A"
|
||||
},
|
||||
{
|
||||
"name": "column-arcs-only-zenith",
|
||||
"frames": [
|
||||
0
|
||||
],
|
||||
"hash": "0C93191EFEDF8E72370DBA648A62884FD42B1350F45D31EECC78B67ADEAF5FD7"
|
||||
},
|
||||
{
|
||||
"name": "plate-halos-only-horizon",
|
||||
"frames": [
|
||||
0
|
||||
],
|
||||
"hash": "A0BBDAEFA9D6E034E24FC609328D3FEF35AF16181EBE72DC5111FC4FF044D1A7"
|
||||
},
|
||||
{
|
||||
"name": "column-arcs-only-horizon",
|
||||
"frames": [
|
||||
0
|
||||
],
|
||||
"hash": "A18FCC2F7E56A361AA5DE1BE51CAD961968792DAF6518D18FDDE26CD048E89B7"
|
||||
},
|
||||
{
|
||||
"name": "plate-thickness-0.05",
|
||||
"frames": [
|
||||
|
||||
@@ -344,6 +344,20 @@ public sealed class HaloTableTests
|
||||
Assert.Equal(middle, Value(texels, 100 * ScatterGrid.Width + 300, 1), middle * 0.01f);
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(0.0)]
|
||||
[InlineData(2.0)]
|
||||
public void EveryRowOfTheScatterTableIsComposed(double diameter)
|
||||
{
|
||||
const int margin = 30;
|
||||
var texels = HaloTable.ComposeScatter(Filled(0.01), Empty(), 1.0, 0.0, 20.0, diameter, 1.0);
|
||||
var middle = Value(texels, 133 * ScatterGrid.Width + 300, 1);
|
||||
|
||||
Assert.True(middle > 0f);
|
||||
Assert.All(Enumerable.Range(margin * ScatterGrid.Width, (ScatterGrid.Height - 2 * margin) * ScatterGrid.Width), texel =>
|
||||
Assert.Equal(middle, Value(texels, texel, 1), middle * 0.01f));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ALightOnTheAzimuthEdgeIsReflectedIntoTheNeighbouringTexel()
|
||||
{
|
||||
|
||||
@@ -61,6 +61,29 @@ public sealed class ScatterGridTests
|
||||
Assert.Equal(0.0, Total(grid));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void TheSumOfGridsAddsEveryCellOfEveryGrid()
|
||||
{
|
||||
var first = new ScatterGrid();
|
||||
var second = new ScatterGrid();
|
||||
for (var row = 0; row < ScatterGrid.Height; row++)
|
||||
{
|
||||
for (var column = 0; column < ScatterGrid.Width; column++)
|
||||
{
|
||||
var azimuth = (column + 0.5) * HaloSettings.ScatterTexelDegrees;
|
||||
var elevation = -HaloSettings.ScatterElevationHalfSpanDegrees + (row + 0.5) * HaloSettings.ScatterTexelDegrees;
|
||||
first.Splat(azimuth, elevation, Unit);
|
||||
second.Splat(azimuth + 0.1, elevation + 0.1, new Tristimulus(2.0, 0.5, 3.0));
|
||||
}
|
||||
}
|
||||
|
||||
var total = ScatterGrid.Sum([first, second, new ScatterGrid()]);
|
||||
|
||||
var expected = first.Cells.Zip(second.Cells, (left, right) => left + right).ToArray();
|
||||
Assert.Contains(expected, cell => cell != 0);
|
||||
Assert.True(total.Cells.AsSpan().SequenceEqual(expected));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void AnAzimuthPastHalfATurnFoldsBackIntoTheTable()
|
||||
{
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
namespace Halo;
|
||||
|
||||
internal readonly record struct TiltLayer(double Tilt, double Weight);
|
||||
|
||||
internal readonly record struct StripChunk(TiltLayer Layer, int FirstStrip, int StripCount);
|
||||
|
||||
internal static class CrystalOrientations
|
||||
{
|
||||
public static StripChunk[] BuildChunks(TiltLayer[] layers, int azimuthSteps)
|
||||
{
|
||||
var chunks = new List<StripChunk>();
|
||||
foreach (var layer in layers)
|
||||
{
|
||||
for (var strip = 0; strip < azimuthSteps; strip += HaloSettings.StripsPerTask)
|
||||
chunks.Add(new StripChunk(layer, strip, Math.Min(HaloSettings.StripsPerTask, azimuthSteps - strip)));
|
||||
}
|
||||
|
||||
return [.. chunks];
|
||||
}
|
||||
|
||||
public static TiltLayer[] PlateLayers(double tiltDegrees)
|
||||
{
|
||||
var nodes = HaloSettings.PlateTiltRadialNodes;
|
||||
var tilt = tiltDegrees * HaloSettings.RadiansPerDegree;
|
||||
var layers = new TiltLayer[nodes];
|
||||
for (var node = 0; node < nodes; node++)
|
||||
layers[node] = new TiltLayer(tilt * HaloSettings.GetPlateTiltQuantile(node), 1.0 / nodes);
|
||||
return layers;
|
||||
}
|
||||
|
||||
public static TiltLayer[] ColumnLayers(double tiltDegrees)
|
||||
{
|
||||
var quantiles = HaloSettings.ColumnTiltQuantiles;
|
||||
var tilt = tiltDegrees * HaloSettings.RadiansPerDegree;
|
||||
return [.. quantiles.Select(quantile => new TiltLayer(tilt * quantile, 1.0 / quantiles.Length))];
|
||||
}
|
||||
|
||||
public static Vec3 PlateAxis(double tilt, double azimuth)
|
||||
=> new(Math.Sin(tilt) * Math.Cos(azimuth), Math.Sin(tilt) * Math.Sin(azimuth), Math.Cos(tilt));
|
||||
|
||||
public static Vec3 ColumnAxis(double tilt, double azimuth)
|
||||
=> new(Math.Cos(tilt) * Math.Cos(azimuth), Math.Cos(tilt) * Math.Sin(azimuth), Math.Sin(tilt));
|
||||
}
|
||||
+11
-306
@@ -1,5 +1,3 @@
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace Halo;
|
||||
|
||||
internal enum CrystalFamily
|
||||
@@ -10,68 +8,10 @@ internal enum CrystalFamily
|
||||
|
||||
internal static class CrystalScatter
|
||||
{
|
||||
private const double SpinPeriodRadians = Math.PI / 3.0;
|
||||
private const double HalfTurnDegrees = 180.0;
|
||||
private const double FullTurnDegrees = 360.0;
|
||||
private const double MergeSpreadDegrees = 0.075;
|
||||
|
||||
private readonly record struct Layer(double Tilt, double Weight);
|
||||
|
||||
private readonly record struct Chunk(Layer Layer, int FirstStrip, int StripCount);
|
||||
|
||||
private struct Sample
|
||||
{
|
||||
public double Azimuth;
|
||||
public double Elevation;
|
||||
public double Weight;
|
||||
public bool Valid;
|
||||
}
|
||||
|
||||
private struct Corner
|
||||
{
|
||||
public bool Valid;
|
||||
public double Azimuth;
|
||||
public double Elevation;
|
||||
public double Spread;
|
||||
public Tristimulus Weight;
|
||||
}
|
||||
|
||||
private sealed class SliceData(int nodeCount, SpectralBand[] bands)
|
||||
{
|
||||
public SpectralBand[] Bands { get; } = bands;
|
||||
public int WavelengthCount { get; } = bands.Length;
|
||||
public PrismPath[][] Paths { get; } = Enumerable.Range(0, nodeCount).Select(_ => new PrismPath[PrismGeometry.MaximumPathCount]).ToArray();
|
||||
public int[] PathCounts { get; } = new int[nodeCount];
|
||||
public Vec3[] Incoming { get; } = new Vec3[nodeCount];
|
||||
public Vec3[] FirstAxes { get; } = new Vec3[nodeCount];
|
||||
public Vec3[] SecondAxes { get; } = new Vec3[nodeCount];
|
||||
public Sample[] Samples { get; } = new Sample[PrismGeometry.LabelCount * nodeCount * bands.Length];
|
||||
public bool[] Used { get; } = new bool[PrismGeometry.LabelCount];
|
||||
private int NodeCount { get; } = nodeCount;
|
||||
|
||||
public int Slot(int label, int node, int wavelength)
|
||||
=> (label * NodeCount + node) * WavelengthCount + wavelength;
|
||||
|
||||
public void Reset()
|
||||
{
|
||||
for (var label = 0; label < Used.Length; label++)
|
||||
{
|
||||
if (!Used[label])
|
||||
continue;
|
||||
|
||||
Array.Clear(Samples, label * NodeCount * WavelengthCount, NodeCount * WavelengthCount);
|
||||
Used[label] = false;
|
||||
}
|
||||
}
|
||||
|
||||
public ReadOnlySpan<Sample> Wavelengths(int label, int node)
|
||||
=> Samples.AsSpan((label * NodeCount + node) * WavelengthCount, WavelengthCount);
|
||||
}
|
||||
|
||||
private sealed class Workspace(int nodeCount, SpectralBand[] bands)
|
||||
{
|
||||
public ScatterGrid Grid { get; } = new();
|
||||
public SliceData[] Slices { get; } = [new(nodeCount, bands), new(nodeCount, bands)];
|
||||
public StripSlice[] Slices { get; } = [new(nodeCount, bands), new(nodeCount, bands)];
|
||||
}
|
||||
|
||||
public static float[] Integrate(CrystalFamily family, double sunElevationDegrees, double lengthRatio, double tiltDegrees)
|
||||
@@ -83,10 +23,10 @@ internal static class CrystalScatter
|
||||
var length = 2.0 * lengthRatio;
|
||||
var elevation = sunElevationDegrees * HaloSettings.RadiansPerDegree;
|
||||
var incoming = new Vec3(-Math.Cos(elevation), 0.0, -Math.Sin(elevation));
|
||||
var layers = plate ? PlateLayers(tiltDegrees) : ColumnLayers(tiltDegrees);
|
||||
var chunks = BuildChunks(layers, azimuthSteps);
|
||||
var layers = plate ? CrystalOrientations.PlateLayers(tiltDegrees) : CrystalOrientations.ColumnLayers(tiltDegrees);
|
||||
var chunks = CrystalOrientations.BuildChunks(layers, azimuthSteps);
|
||||
var bands = SolarSpectrum.Bands(plate ? 1 : HaloSettings.ColumnWavelengthStride);
|
||||
var total = new ScatterGrid();
|
||||
var grids = new System.Collections.Concurrent.ConcurrentBag<ScatterGrid>();
|
||||
Parallel.For(
|
||||
0,
|
||||
chunks.Length,
|
||||
@@ -99,258 +39,23 @@ internal static class CrystalScatter
|
||||
{
|
||||
var current = workspace.Slices[strip & 1];
|
||||
var azimuth = (chunk.FirstStrip + strip) * Math.PI / azimuthSteps;
|
||||
var axis = plate ? PlateAxis(chunk.Layer.Tilt, azimuth) : ColumnAxis(chunk.Layer.Tilt, azimuth);
|
||||
FillSlice(current, axis, incoming, length, spinSteps, kinds, sunElevationDegrees);
|
||||
var axis = plate ? CrystalOrientations.PlateAxis(chunk.Layer.Tilt, azimuth) : CrystalOrientations.ColumnAxis(chunk.Layer.Tilt, azimuth);
|
||||
current.Fill(axis, incoming, length, kinds, sunElevationDegrees);
|
||||
if (strip > 0)
|
||||
SplatStrip(workspace.Grid, workspace.Slices[(strip - 1) & 1], current, spinSteps, quadWeight);
|
||||
ScatterSplat.Strip(workspace.Grid, workspace.Slices[(strip - 1) & 1], current, quadWeight);
|
||||
}
|
||||
|
||||
return workspace;
|
||||
},
|
||||
workspace =>
|
||||
{
|
||||
lock (total)
|
||||
total.Add(workspace.Grid);
|
||||
});
|
||||
return ToRadiance(total, sunElevationDegrees);
|
||||
workspace => grids.Add(workspace.Grid));
|
||||
return ToRadiance(ScatterGrid.Sum([.. grids]), sunElevationDegrees);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveOptimization)]
|
||||
private static void FillSlice(SliceData data, Vec3 axis, Vec3 incoming, double length, int spinSteps, PathKinds kinds, double sunElevationDegrees)
|
||||
{
|
||||
var referenceIndex = IceOptics.RefractiveIndex(HaloSettings.ReferenceWavelengthNanometers);
|
||||
var helper = Math.Abs(axis.Z) < 0.9 ? new Vec3(0.0, 0.0, 1.0) : new Vec3(1.0, 0.0, 0.0);
|
||||
var firstBase = helper.Cross(axis).Normalized();
|
||||
var secondBase = axis.Cross(firstBase);
|
||||
for (var node = 0; node <= spinSteps; node++)
|
||||
{
|
||||
var (sine, cosine) = Math.SinCos(node * SpinPeriodRadians / spinSteps);
|
||||
var first = (cosine * firstBase) + (sine * secondBase);
|
||||
var second = (-sine * firstBase) + (cosine * secondBase);
|
||||
data.FirstAxes[node] = first;
|
||||
data.SecondAxes[node] = second;
|
||||
var local = new Vec3(incoming.Dot(first), incoming.Dot(second), incoming.Dot(axis));
|
||||
data.Incoming[node] = local;
|
||||
data.PathCounts[node] = PrismGeometry.Enumerate(local, length, referenceIndex, kinds, data.Paths[node]);
|
||||
}
|
||||
|
||||
data.Reset();
|
||||
for (var wavelength = 0; wavelength < data.WavelengthCount; wavelength++)
|
||||
{
|
||||
var index = IceOptics.RefractiveIndex(data.Bands[wavelength].Wavelength);
|
||||
for (var node = 0; node <= spinSteps; node++)
|
||||
{
|
||||
var paths = data.Paths[node];
|
||||
for (var path = 0; path < data.PathCounts[node]; path++)
|
||||
{
|
||||
var current = paths[path];
|
||||
Vec3 exit;
|
||||
double factor;
|
||||
var found = current.Exit == PrismGeometry.ReflectionExit
|
||||
? PrismGeometry.TryReflect(data.Incoming[node], current, index, out exit, out factor)
|
||||
: PrismGeometry.TryRefract(data.Incoming[node], current, index, out exit, out factor);
|
||||
if (!found)
|
||||
continue;
|
||||
|
||||
var sky = -((exit.X * data.FirstAxes[node]) + (exit.Y * data.SecondAxes[node]) + (exit.Z * axis));
|
||||
data.Samples[data.Slot(current.Label, node, wavelength)] = new Sample
|
||||
{
|
||||
Azimuth = Math.Atan2(sky.Y, sky.X) / HaloSettings.RadiansPerDegree,
|
||||
Elevation = Math.Asin(Math.Clamp(sky.Z, -1.0, 1.0)) / HaloSettings.RadiansPerDegree - sunElevationDegrees,
|
||||
Weight = current.Geometry * factor,
|
||||
Valid = true,
|
||||
};
|
||||
data.Used[current.Label] = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveOptimization)]
|
||||
private static void SplatStrip(ScatterGrid grid, SliceData previous, SliceData current, int spinSteps, double quadWeight)
|
||||
{
|
||||
for (var label = 0; label < PrismGeometry.LabelCount; label++)
|
||||
{
|
||||
if (!previous.Used[label] && !current.Used[label])
|
||||
continue;
|
||||
|
||||
for (var node = 0; node < spinSteps; node++)
|
||||
{
|
||||
SplatQuad(
|
||||
grid,
|
||||
previous.Bands,
|
||||
previous.Wavelengths(label, node),
|
||||
previous.Wavelengths(label, node + 1),
|
||||
current.Wavelengths(label, node),
|
||||
current.Wavelengths(label, node + 1),
|
||||
quadWeight);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveOptimization)]
|
||||
private static void SplatQuad(ScatterGrid grid, SpectralBand[] bands, ReadOnlySpan<Sample> first, ReadOnlySpan<Sample> second, ReadOnlySpan<Sample> third, ReadOnlySpan<Sample> fourth, double quadWeight)
|
||||
{
|
||||
var c00 = Combine(first, bands);
|
||||
var c01 = Combine(second, bands);
|
||||
var c10 = Combine(third, bands);
|
||||
var c11 = Combine(fourth, bands);
|
||||
var anchor = c00.Valid ? c00 : c01.Valid ? c01 : c10.Valid ? c10 : c11;
|
||||
if (!anchor.Valid)
|
||||
return;
|
||||
|
||||
if (c00.Spread <= MergeSpreadDegrees && c01.Spread <= MergeSpreadDegrees && c10.Spread <= MergeSpreadDegrees && c11.Spread <= MergeSpreadDegrees)
|
||||
{
|
||||
SplatPatch(grid, Complete(c00, anchor), Complete(c01, anchor), Complete(c10, anchor), Complete(c11, anchor), quadWeight);
|
||||
return;
|
||||
}
|
||||
|
||||
for (var wavelength = 0; wavelength < bands.Length; wavelength++)
|
||||
{
|
||||
var spectrum = bands[wavelength].Weight;
|
||||
var single00 = Single(first[wavelength], spectrum);
|
||||
var single01 = Single(second[wavelength], spectrum);
|
||||
var single10 = Single(third[wavelength], spectrum);
|
||||
var single11 = Single(fourth[wavelength], spectrum);
|
||||
var single = single00.Valid ? single00 : single01.Valid ? single01 : single10.Valid ? single10 : single11;
|
||||
if (single.Valid)
|
||||
SplatPatch(grid, Complete(single00, single), Complete(single01, single), Complete(single10, single), Complete(single11, single), quadWeight);
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveOptimization)]
|
||||
private static Corner Combine(ReadOnlySpan<Sample> samples, SpectralBand[] bands)
|
||||
{
|
||||
var total = new Tristimulus();
|
||||
var luminance = 0.0;
|
||||
var azimuth = 0.0;
|
||||
var elevation = 0.0;
|
||||
var reference = double.NaN;
|
||||
for (var wavelength = 0; wavelength < samples.Length; wavelength++)
|
||||
{
|
||||
var sample = samples[wavelength];
|
||||
if (!sample.Valid)
|
||||
continue;
|
||||
|
||||
if (double.IsNaN(reference))
|
||||
reference = sample.Azimuth;
|
||||
var weight = sample.Weight * bands[wavelength].Weight.Y;
|
||||
total += sample.Weight * bands[wavelength].Weight;
|
||||
luminance += weight;
|
||||
azimuth += weight * Unwrap(sample.Azimuth, reference);
|
||||
elevation += weight * sample.Elevation;
|
||||
}
|
||||
|
||||
if (double.IsNaN(reference))
|
||||
return default;
|
||||
if (luminance <= 0.0)
|
||||
return new Corner { Valid = true, Azimuth = reference };
|
||||
|
||||
var center = new Corner { Valid = true, Azimuth = azimuth / luminance, Elevation = elevation / luminance, Weight = total };
|
||||
var spread = 0.0;
|
||||
for (var wavelength = 0; wavelength < samples.Length; wavelength++)
|
||||
{
|
||||
if (!samples[wavelength].Valid)
|
||||
continue;
|
||||
|
||||
var offset = Math.Max(Math.Abs(Unwrap(samples[wavelength].Azimuth, reference) - center.Azimuth), Math.Abs(samples[wavelength].Elevation - center.Elevation));
|
||||
spread = Math.Max(spread, offset);
|
||||
}
|
||||
|
||||
center.Spread = spread;
|
||||
return center;
|
||||
}
|
||||
|
||||
private static Corner Single(Sample sample, Tristimulus spectrum)
|
||||
=> sample.Valid ? new Corner { Valid = true, Azimuth = sample.Azimuth, Elevation = sample.Elevation, Weight = sample.Weight * spectrum } : default;
|
||||
|
||||
private static Corner Complete(Corner corner, Corner anchor)
|
||||
{
|
||||
if (!corner.Valid)
|
||||
return new Corner { Valid = true, Azimuth = anchor.Azimuth, Elevation = anchor.Elevation };
|
||||
|
||||
corner.Azimuth = Unwrap(corner.Azimuth, anchor.Azimuth);
|
||||
return corner;
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveOptimization)]
|
||||
private static void SplatPatch(ScatterGrid grid, Corner c00, Corner c01, Corner c10, Corner c11, double quadWeight)
|
||||
{
|
||||
var along = Math.Max(Distance(c00, c10), Distance(c01, c11));
|
||||
var across = Math.Max(Distance(c00, c01), Distance(c10, c11));
|
||||
var stepDegrees = HaloSettings.SubStepTexels * HaloSettings.ScatterTexelDegrees;
|
||||
var alongSteps = Math.Clamp((int)Math.Ceiling(along / stepDegrees), 1, HaloSettings.MaximumSubSteps);
|
||||
var acrossSteps = Math.Clamp((int)Math.Ceiling(across / stepDegrees), 1, HaloSettings.MaximumSubSteps);
|
||||
var unit = quadWeight / (alongSteps * acrossSteps);
|
||||
for (var first = 0; first < alongSteps; first++)
|
||||
{
|
||||
var s = (first + 0.5) / alongSteps;
|
||||
for (var second = 0; second < acrossSteps; second++)
|
||||
{
|
||||
var t = (second + 0.5) / acrossSteps;
|
||||
var w00 = (1.0 - s) * (1.0 - t);
|
||||
var w01 = (1.0 - s) * t;
|
||||
var w10 = s * (1.0 - t);
|
||||
var w11 = s * t;
|
||||
var weight = (w00 * c00.Weight) + (w01 * c01.Weight) + (w10 * c10.Weight) + (w11 * c11.Weight);
|
||||
grid.Splat(
|
||||
w00 * c00.Azimuth + w01 * c01.Azimuth + w10 * c10.Azimuth + w11 * c11.Azimuth,
|
||||
w00 * c00.Elevation + w01 * c01.Elevation + w10 * c10.Elevation + w11 * c11.Elevation,
|
||||
unit * weight);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static double Unwrap(double azimuth, double reference)
|
||||
{
|
||||
if (azimuth - reference > HalfTurnDegrees)
|
||||
return azimuth - FullTurnDegrees;
|
||||
return reference - azimuth > HalfTurnDegrees ? azimuth + FullTurnDegrees : azimuth;
|
||||
}
|
||||
|
||||
private static double Distance(Corner first, Corner second)
|
||||
=> Math.Max(Math.Abs(first.Azimuth - second.Azimuth), Math.Abs(first.Elevation - second.Elevation));
|
||||
|
||||
private static Chunk[] BuildChunks(Layer[] layers, int azimuthSteps)
|
||||
{
|
||||
var chunks = new List<Chunk>();
|
||||
foreach (var layer in layers)
|
||||
{
|
||||
for (var strip = 0; strip < azimuthSteps; strip += HaloSettings.StripsPerTask)
|
||||
chunks.Add(new Chunk(layer, strip, Math.Min(HaloSettings.StripsPerTask, azimuthSteps - strip)));
|
||||
}
|
||||
|
||||
return [.. chunks];
|
||||
}
|
||||
|
||||
private static Layer[] PlateLayers(double tiltDegrees)
|
||||
{
|
||||
var nodes = HaloSettings.PlateTiltRadialNodes;
|
||||
var tilt = tiltDegrees * HaloSettings.RadiansPerDegree;
|
||||
var layers = new Layer[nodes];
|
||||
for (var node = 0; node < nodes; node++)
|
||||
layers[node] = new Layer(tilt * HaloSettings.GetPlateTiltQuantile(node), 1.0 / nodes);
|
||||
return layers;
|
||||
}
|
||||
|
||||
private static Layer[] ColumnLayers(double tiltDegrees)
|
||||
{
|
||||
var quantiles = HaloSettings.ColumnTiltQuantiles;
|
||||
var tilt = tiltDegrees * HaloSettings.RadiansPerDegree;
|
||||
return [.. quantiles.Select(quantile => new Layer(tilt * quantile, 1.0 / quantiles.Length))];
|
||||
}
|
||||
|
||||
private static Vec3 PlateAxis(double tilt, double azimuth)
|
||||
=> new(Math.Sin(tilt) * Math.Cos(azimuth), Math.Sin(tilt) * Math.Sin(azimuth), Math.Cos(tilt));
|
||||
|
||||
private static Vec3 ColumnAxis(double tilt, double azimuth)
|
||||
=> new(Math.Cos(tilt) * Math.Cos(azimuth), Math.Cos(tilt) * Math.Sin(azimuth), Math.Sin(tilt));
|
||||
|
||||
private static float[] ToRadiance(ScatterGrid grid, double sunElevationDegrees)
|
||||
{
|
||||
var texel = HaloSettings.ScatterTexelDegrees * HaloSettings.RadiansPerDegree;
|
||||
var radiance = new float[grid.Cells.Length];
|
||||
for (var row = 0; row < ScatterGrid.Height; row++)
|
||||
Parallel.For(0, ScatterGrid.Height, row =>
|
||||
{
|
||||
var elevation = Math.Min(Math.Abs(HaloSettings.GetScatterElevationDegrees(row, sunElevationDegrees)), 90.0) * HaloSettings.RadiansPerDegree;
|
||||
var solidAngle = Math.Max(Math.Cos(elevation), HaloSettings.ScatterMinimumCosine) * texel * texel;
|
||||
@@ -358,7 +63,7 @@ internal static class CrystalScatter
|
||||
var start = row * ScatterGrid.Width * HaloSettings.ColorChannels;
|
||||
for (var index = start; index < start + ScatterGrid.Width * HaloSettings.ColorChannels; index++)
|
||||
radiance[index] = (float)(grid.Cells[index] * scale);
|
||||
}
|
||||
});
|
||||
|
||||
return radiance;
|
||||
}
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
<UseWPF>true</UseWPF>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<Version>1.0.0</Version>
|
||||
<Version>1.0.2</Version>
|
||||
<Platforms>AnyCPU;x64</Platforms>
|
||||
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
|
||||
<ShaderDirPath>..\Release\</ShaderDirPath>
|
||||
|
||||
@@ -8,6 +8,8 @@ internal static class HaloSettings
|
||||
public const int TexelChannels = 4;
|
||||
public const int TexelBytes = TexelChannels * sizeof(ushort);
|
||||
public const double RadiansPerDegree = Math.PI / 180.0;
|
||||
public const double HalfTurnDegrees = 180.0;
|
||||
public const double FullTurnDegrees = 360.0;
|
||||
|
||||
public const int RingTableWidth = 1024;
|
||||
public const double RingStartDegrees = 10.0;
|
||||
|
||||
+7
-7
@@ -40,7 +40,7 @@ internal static class HaloTable
|
||||
var (whiteRed, whiteGreen, whiteBlue) = SolarSpectrum.ToLinearSrgb(SolarSpectrum.White);
|
||||
var texels = new Half[width * height * HaloSettings.TexelChannels];
|
||||
var scale = Scale.Value;
|
||||
for (var row = 0; row < height; row++)
|
||||
Parallel.For(0, height, row =>
|
||||
{
|
||||
var offset = HaloSettings.GetScatterElevationDegrees(row, sunElevationDegrees) - sunElevationDegrees;
|
||||
var taper = SmoothStep(-HaloSettings.ScatterElevationHalfSpanDegrees, -HaloSettings.ScatterElevationHalfSpanDegrees + HaloSettings.ScatterElevationTaperDegrees, offset)
|
||||
@@ -51,7 +51,7 @@ internal static class HaloTable
|
||||
var (red, green, blue) = SolarSpectrum.ToLinearSrgb(new Tristimulus(blurred[source], blurred[source + 1], blurred[source + 2]));
|
||||
Write(texels, row * width + column0, red / whiteRed * scale * taper, green / whiteGreen * scale * taper, blue / whiteBlue * scale * taper, saturation);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return texels;
|
||||
}
|
||||
@@ -129,7 +129,7 @@ internal static class HaloTable
|
||||
var texel = HaloSettings.ScatterTexelDegrees;
|
||||
var extent = width + 2 * MaximumBlurTexels;
|
||||
var prefix = new double[height * channels * (extent + 1)];
|
||||
for (var row = 0; row < height; row++)
|
||||
Parallel.For(0, height, row =>
|
||||
{
|
||||
for (var channel = 0; channel < channels; channel++)
|
||||
{
|
||||
@@ -140,11 +140,11 @@ internal static class HaloTable
|
||||
prefix[start + index + 1] = prefix[start + index] + values[(row * width + column) * channels + channel];
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
var verticalRadius = (int)Math.Floor(radiusDegrees / texel);
|
||||
var result = new double[values.Length];
|
||||
for (var row = 0; row < height; row++)
|
||||
Parallel.For(0, height, row =>
|
||||
{
|
||||
var elevation = Math.Min(Math.Abs(HaloSettings.GetScatterElevationDegrees(row, sunElevationDegrees)), 90.0) * HaloSettings.RadiansPerDegree;
|
||||
var horizontalScale = 1.0 / (texel * Math.Max(Math.Cos(elevation), HaloSettings.ScatterMinimumCosine));
|
||||
@@ -161,7 +161,7 @@ internal static class HaloTable
|
||||
if (area <= 0.0)
|
||||
{
|
||||
Array.Copy(values, row * width * channels, result, row * width * channels, width * channels);
|
||||
continue;
|
||||
return;
|
||||
}
|
||||
|
||||
for (var column = 0; column < width; column++)
|
||||
@@ -180,7 +180,7 @@ internal static class HaloTable
|
||||
result[(row * width + column) * channels + channel] = sum / area;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
+9
-7
@@ -20,18 +20,20 @@ internal readonly record struct PrismPath(int Entry, int Exit, double Geometry)
|
||||
internal static class PrismGeometry
|
||||
{
|
||||
public const int SideFaceCount = 6;
|
||||
public const int UpperEnd = 6;
|
||||
public const int LowerEnd = 7;
|
||||
public const int ReflectionExit = 8;
|
||||
public const int EntryKindCount = 8;
|
||||
public const int ExitKindCount = 9;
|
||||
public const int UpperEnd = SideFaceCount;
|
||||
public const int LowerEnd = UpperEnd + 1;
|
||||
public const int ReflectionExit = LowerEnd + 1;
|
||||
public const int EntryKindCount = LowerEnd + 1;
|
||||
public const int ExitKindCount = ReflectionExit + 1;
|
||||
public const int LabelCount = EntryKindCount * ExitKindCount;
|
||||
public const int MaximumPathCount = LabelCount;
|
||||
public const double SpinPeriodRadians = 2.0 * Math.PI / SideFaceCount;
|
||||
public const double SpinSectorRadians = Math.PI / SideFaceCount;
|
||||
|
||||
private const double MinimumCosine = 1e-9;
|
||||
private const double MinimumProjection = 1e-12;
|
||||
private const double FirstSideAngleDegrees = 30.0;
|
||||
private const double SideAngleStepDegrees = 60.0;
|
||||
private const double SideAngleStepDegrees = HaloSettings.FullTurnDegrees / SideFaceCount;
|
||||
private const double FirstSideAngleDegrees = SideAngleStepDegrees / 2.0;
|
||||
|
||||
public static readonly double Apothem = Math.Sqrt(3.0) / 2.0;
|
||||
public static readonly double EndFaceArea = 1.5 * Math.Sqrt(3.0);
|
||||
|
||||
+2
-2
@@ -16,7 +16,7 @@ internal static class RingProfile
|
||||
var azimuths = HaloSettings.RandomAzimuthSteps;
|
||||
var length = 2.0 * HaloSettings.RandomCrystalLengthRatio;
|
||||
var inclinationStep = Math.PI / 2.0 / inclinations;
|
||||
var azimuthStep = Math.PI / 6.0 / azimuths;
|
||||
var azimuthStep = PrismGeometry.SpinSectorRadians / azimuths;
|
||||
var step = HaloSettings.GetRingStepDegrees();
|
||||
var weights = SolarSpectrum.Weights;
|
||||
var referenceIndex = IceOptics.RefractiveIndex(HaloSettings.ReferenceWavelengthNanometers);
|
||||
@@ -33,7 +33,7 @@ internal static class RingProfile
|
||||
for (var column = 0; column < azimuths; column++)
|
||||
{
|
||||
var azimuth = (column + 0.5) * azimuthStep;
|
||||
var orientation = Math.Cos(inclination) * inclinationStep * azimuthStep * 6.0 / Math.PI;
|
||||
var orientation = Math.Cos(inclination) * inclinationStep * azimuthStep * PrismGeometry.SideFaceCount / Math.PI;
|
||||
var incoming = new Vec3(-Math.Cos(inclination) * Math.Cos(azimuth), -Math.Cos(inclination) * Math.Sin(azimuth), -Math.Sin(inclination));
|
||||
var count = PrismGeometry.Enumerate(incoming, length, referenceIndex, PathKinds.SideToSide | PathKinds.SideToEnd | PathKinds.EndToSide, paths);
|
||||
for (var path = 0; path < count; path++)
|
||||
|
||||
+18
-4
@@ -10,6 +10,7 @@ internal sealed class ScatterGrid
|
||||
|
||||
private const double TexelsPerDegree = 1.0 / HaloSettings.ScatterTexelDegrees;
|
||||
private const int Channels = HaloSettings.ColorChannels;
|
||||
private const int SumBlock = 8192;
|
||||
|
||||
public ScatterGrid()
|
||||
{
|
||||
@@ -18,7 +19,7 @@ internal sealed class ScatterGrid
|
||||
|
||||
public long[] Cells { get; }
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveOptimization)]
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public unsafe void Splat(double azimuthDegrees, double elevationOffsetDegrees, Tristimulus weight)
|
||||
{
|
||||
var x = Math.Abs(azimuthDegrees) * TexelsPerDegree - 0.5;
|
||||
@@ -44,12 +45,24 @@ internal sealed class ScatterGrid
|
||||
}
|
||||
}
|
||||
|
||||
public void Add(ScatterGrid other)
|
||||
public static ScatterGrid Sum(IReadOnlyList<ScatterGrid> grids)
|
||||
{
|
||||
for (var index = 0; index < Cells.Length; index++)
|
||||
Cells[index] += other.Cells[index];
|
||||
var total = new ScatterGrid();
|
||||
var cells = total.Cells;
|
||||
Parallel.For(0, (cells.Length + SumBlock - 1) / SumBlock, block =>
|
||||
{
|
||||
var end = Math.Min((block + 1) * SumBlock, cells.Length);
|
||||
foreach (var grid in grids)
|
||||
{
|
||||
var other = grid.Cells;
|
||||
for (var index = block * SumBlock; index < end; index++)
|
||||
cells[index] += other[index];
|
||||
}
|
||||
});
|
||||
return total;
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
private static unsafe void Add(long* line, int left, int right, double leftScale, double rightScale, double wx, double wy, double wz)
|
||||
{
|
||||
line[left] += (long)(leftScale * wx + 0.5);
|
||||
@@ -60,6 +73,7 @@ internal sealed class ScatterGrid
|
||||
line[right + 2] += (long)(rightScale * wz + 0.5);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
private static int Reflect(int column)
|
||||
{
|
||||
if (column < 0)
|
||||
|
||||
@@ -0,0 +1,127 @@
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace Halo;
|
||||
|
||||
internal static class ScatterSplat
|
||||
{
|
||||
private const double MergeSpreadDegrees = 0.075;
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveOptimization)]
|
||||
public static void Strip(ScatterGrid grid, StripSlice previous, StripSlice current, double quadWeight)
|
||||
{
|
||||
for (var label = 0; label < PrismGeometry.LabelCount; label++)
|
||||
{
|
||||
if (!previous.Used[label] && !current.Used[label])
|
||||
continue;
|
||||
|
||||
for (var node = 0; node < current.SpinSteps; node++)
|
||||
{
|
||||
Quad(
|
||||
grid,
|
||||
previous.Bands,
|
||||
previous.Wavelengths(label, node),
|
||||
previous.Wavelengths(label, node + 1),
|
||||
current.Wavelengths(label, node),
|
||||
current.Wavelengths(label, node + 1),
|
||||
previous.CornerAt(label, node),
|
||||
previous.CornerAt(label, node + 1),
|
||||
current.CornerAt(label, node),
|
||||
current.CornerAt(label, node + 1),
|
||||
quadWeight);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveOptimization)]
|
||||
private static void Quad(
|
||||
ScatterGrid grid,
|
||||
SpectralBand[] bands,
|
||||
ReadOnlySpan<ExitSample> samples00,
|
||||
ReadOnlySpan<ExitSample> samples01,
|
||||
ReadOnlySpan<ExitSample> samples10,
|
||||
ReadOnlySpan<ExitSample> samples11,
|
||||
in Corner c00,
|
||||
in Corner c01,
|
||||
in Corner c10,
|
||||
in Corner c11,
|
||||
double quadWeight)
|
||||
{
|
||||
var reference = FirstValid(c00, c01, c10, c11);
|
||||
if (!reference.Valid)
|
||||
return;
|
||||
|
||||
if (c00.Spread <= MergeSpreadDegrees && c01.Spread <= MergeSpreadDegrees && c10.Spread <= MergeSpreadDegrees && c11.Spread <= MergeSpreadDegrees)
|
||||
{
|
||||
Patch(grid, AlignTo(c00, reference), AlignTo(c01, reference), AlignTo(c10, reference), AlignTo(c11, reference), quadWeight);
|
||||
return;
|
||||
}
|
||||
|
||||
for (var wavelength = 0; wavelength < bands.Length; wavelength++)
|
||||
{
|
||||
var bandWeight = bands[wavelength].Weight;
|
||||
var band00 = BandCorner(samples00[wavelength], bandWeight);
|
||||
var band01 = BandCorner(samples01[wavelength], bandWeight);
|
||||
var band10 = BandCorner(samples10[wavelength], bandWeight);
|
||||
var band11 = BandCorner(samples11[wavelength], bandWeight);
|
||||
var bandReference = FirstValid(band00, band01, band10, band11);
|
||||
if (bandReference.Valid)
|
||||
Patch(grid, AlignTo(band00, bandReference), AlignTo(band01, bandReference), AlignTo(band10, bandReference), AlignTo(band11, bandReference), quadWeight);
|
||||
}
|
||||
}
|
||||
|
||||
private static Corner FirstValid(in Corner first, in Corner second, in Corner third, in Corner fourth)
|
||||
=> first.Valid ? first : second.Valid ? second : third.Valid ? third : fourth;
|
||||
|
||||
private static Corner BandCorner(ExitSample sample, Tristimulus bandWeight)
|
||||
=> sample.Valid ? new Corner { Valid = true, Azimuth = sample.Azimuth, Elevation = sample.Elevation, Weight = sample.Weight * bandWeight } : default;
|
||||
|
||||
private static Corner AlignTo(Corner corner, Corner reference)
|
||||
{
|
||||
if (!corner.Valid)
|
||||
return new Corner { Valid = true, Azimuth = reference.Azimuth, Elevation = reference.Elevation };
|
||||
|
||||
corner.Azimuth = Corner.Unwrap(corner.Azimuth, reference.Azimuth);
|
||||
return corner;
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveOptimization)]
|
||||
private static unsafe void Patch(ScatterGrid grid, in Corner c00, in Corner c01, in Corner c10, in Corner c11, double quadWeight)
|
||||
{
|
||||
var along = Math.Max(Distance(c00, c10), Distance(c01, c11));
|
||||
var across = Math.Max(Distance(c00, c01), Distance(c10, c11));
|
||||
var stepDegrees = HaloSettings.SubStepTexels * HaloSettings.ScatterTexelDegrees;
|
||||
var alongSteps = Math.Clamp((int)Math.Ceiling(along / stepDegrees), 1, HaloSettings.MaximumSubSteps);
|
||||
var acrossSteps = Math.Clamp((int)Math.Ceiling(across / stepDegrees), 1, HaloSettings.MaximumSubSteps);
|
||||
var unit = quadWeight / (alongSteps * acrossSteps);
|
||||
var ts = stackalloc double[HaloSettings.MaximumSubSteps];
|
||||
var complements = stackalloc double[HaloSettings.MaximumSubSteps];
|
||||
for (var second = 0; second < acrossSteps; second++)
|
||||
{
|
||||
var t = (second + 0.5) / acrossSteps;
|
||||
ts[second] = t;
|
||||
complements[second] = 1.0 - t;
|
||||
}
|
||||
|
||||
for (var first = 0; first < alongSteps; first++)
|
||||
{
|
||||
var s = (first + 0.5) / alongSteps;
|
||||
var complement = 1.0 - s;
|
||||
for (var second = 0; second < acrossSteps; second++)
|
||||
{
|
||||
var t = ts[second];
|
||||
var w00 = complement * complements[second];
|
||||
var w01 = complement * t;
|
||||
var w10 = s * complements[second];
|
||||
var w11 = s * t;
|
||||
var weight = (w00 * c00.Weight) + (w01 * c01.Weight) + (w10 * c10.Weight) + (w11 * c11.Weight);
|
||||
grid.Splat(
|
||||
w00 * c00.Azimuth + w01 * c01.Azimuth + w10 * c10.Azimuth + w11 * c11.Azimuth,
|
||||
w00 * c00.Elevation + w01 * c01.Elevation + w10 * c10.Elevation + w11 * c11.Elevation,
|
||||
unit * weight);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static double Distance(in Corner first, in Corner second)
|
||||
=> Math.Max(Math.Abs(first.Azimuth - second.Azimuth), Math.Abs(first.Elevation - second.Elevation));
|
||||
}
|
||||
@@ -0,0 +1,174 @@
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace Halo;
|
||||
|
||||
internal struct ExitSample
|
||||
{
|
||||
public double Azimuth;
|
||||
public double Elevation;
|
||||
public double Weight;
|
||||
public bool Valid;
|
||||
}
|
||||
|
||||
internal struct Corner
|
||||
{
|
||||
public bool Valid;
|
||||
public double Azimuth;
|
||||
public double Elevation;
|
||||
public double Spread;
|
||||
public Tristimulus Weight;
|
||||
|
||||
public static double Unwrap(double azimuth, double reference)
|
||||
{
|
||||
if (azimuth - reference > HaloSettings.HalfTurnDegrees)
|
||||
return azimuth - HaloSettings.FullTurnDegrees;
|
||||
return reference - azimuth > HaloSettings.HalfTurnDegrees ? azimuth + HaloSettings.FullTurnDegrees : azimuth;
|
||||
}
|
||||
}
|
||||
|
||||
internal sealed class StripSlice(int nodeCount, SpectralBand[] bands)
|
||||
{
|
||||
private PrismPath[][] Paths { get; } = Enumerable.Range(0, nodeCount).Select(_ => new PrismPath[PrismGeometry.MaximumPathCount]).ToArray();
|
||||
private int[] PathCounts { get; } = new int[nodeCount];
|
||||
private Vec3[] Incoming { get; } = new Vec3[nodeCount];
|
||||
private Vec3[] FirstAxes { get; } = new Vec3[nodeCount];
|
||||
private Vec3[] SecondAxes { get; } = new Vec3[nodeCount];
|
||||
private ExitSample[] Samples { get; } = new ExitSample[PrismGeometry.LabelCount * nodeCount * bands.Length];
|
||||
private Corner[] Corners { get; } = new Corner[PrismGeometry.LabelCount * nodeCount];
|
||||
private int NodeCount { get; } = nodeCount;
|
||||
private int WavelengthCount { get; } = bands.Length;
|
||||
|
||||
public SpectralBand[] Bands { get; } = bands;
|
||||
public bool[] Used { get; } = new bool[PrismGeometry.LabelCount];
|
||||
public int SpinSteps => NodeCount - 1;
|
||||
|
||||
public ref readonly Corner CornerAt(int label, int node)
|
||||
=> ref Corners[label * NodeCount + node];
|
||||
|
||||
public ReadOnlySpan<ExitSample> Wavelengths(int label, int node)
|
||||
=> Samples.AsSpan((label * NodeCount + node) * WavelengthCount, WavelengthCount);
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveOptimization)]
|
||||
public void Fill(Vec3 axis, Vec3 incoming, double length, PathKinds kinds, double sunElevationDegrees)
|
||||
{
|
||||
var referenceIndex = IceOptics.RefractiveIndex(HaloSettings.ReferenceWavelengthNanometers);
|
||||
var helper = Math.Abs(axis.Z) < 0.9 ? new Vec3(0.0, 0.0, 1.0) : new Vec3(1.0, 0.0, 0.0);
|
||||
var firstBase = helper.Cross(axis).Normalized();
|
||||
var secondBase = axis.Cross(firstBase);
|
||||
for (var node = 0; node < NodeCount; node++)
|
||||
{
|
||||
var (sine, cosine) = Math.SinCos(node * PrismGeometry.SpinPeriodRadians / SpinSteps);
|
||||
var first = (cosine * firstBase) + (sine * secondBase);
|
||||
var second = (-sine * firstBase) + (cosine * secondBase);
|
||||
FirstAxes[node] = first;
|
||||
SecondAxes[node] = second;
|
||||
var local = new Vec3(incoming.Dot(first), incoming.Dot(second), incoming.Dot(axis));
|
||||
Incoming[node] = local;
|
||||
PathCounts[node] = PrismGeometry.Enumerate(local, length, referenceIndex, kinds, Paths[node]);
|
||||
}
|
||||
|
||||
Reset();
|
||||
for (var wavelength = 0; wavelength < WavelengthCount; wavelength++)
|
||||
{
|
||||
var index = IceOptics.RefractiveIndex(Bands[wavelength].Wavelength);
|
||||
for (var node = 0; node < NodeCount; node++)
|
||||
{
|
||||
var paths = Paths[node];
|
||||
for (var path = 0; path < PathCounts[node]; path++)
|
||||
{
|
||||
var current = paths[path];
|
||||
Vec3 exit;
|
||||
double factor;
|
||||
var found = current.Exit == PrismGeometry.ReflectionExit
|
||||
? PrismGeometry.TryReflect(Incoming[node], current, index, out exit, out factor)
|
||||
: PrismGeometry.TryRefract(Incoming[node], current, index, out exit, out factor);
|
||||
if (!found)
|
||||
continue;
|
||||
|
||||
var sky = -((exit.X * FirstAxes[node]) + (exit.Y * SecondAxes[node]) + (exit.Z * axis));
|
||||
Samples[Slot(current.Label, node, wavelength)] = new ExitSample
|
||||
{
|
||||
Azimuth = Math.Atan2(sky.Y, sky.X) / HaloSettings.RadiansPerDegree,
|
||||
Elevation = Math.Asin(Math.Clamp(sky.Z, -1.0, 1.0)) / HaloSettings.RadiansPerDegree - sunElevationDegrees,
|
||||
Weight = current.Geometry * factor,
|
||||
Valid = true,
|
||||
};
|
||||
Used[current.Label] = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
MergeCorners();
|
||||
}
|
||||
|
||||
private int Slot(int label, int node, int wavelength)
|
||||
=> (label * NodeCount + node) * WavelengthCount + wavelength;
|
||||
|
||||
private void Reset()
|
||||
{
|
||||
for (var label = 0; label < Used.Length; label++)
|
||||
{
|
||||
if (!Used[label])
|
||||
continue;
|
||||
|
||||
Array.Clear(Samples, label * NodeCount * WavelengthCount, NodeCount * WavelengthCount);
|
||||
Array.Clear(Corners, label * NodeCount, NodeCount);
|
||||
Used[label] = false;
|
||||
}
|
||||
}
|
||||
|
||||
private void MergeCorners()
|
||||
{
|
||||
for (var label = 0; label < Used.Length; label++)
|
||||
{
|
||||
if (!Used[label])
|
||||
continue;
|
||||
|
||||
for (var node = 0; node < NodeCount; node++)
|
||||
Corners[label * NodeCount + node] = MergeBands(Wavelengths(label, node), Bands);
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveOptimization)]
|
||||
private static Corner MergeBands(ReadOnlySpan<ExitSample> samples, SpectralBand[] bands)
|
||||
{
|
||||
var total = new Tristimulus();
|
||||
var luminance = 0.0;
|
||||
var azimuth = 0.0;
|
||||
var elevation = 0.0;
|
||||
var reference = double.NaN;
|
||||
for (var wavelength = 0; wavelength < samples.Length; wavelength++)
|
||||
{
|
||||
var sample = samples[wavelength];
|
||||
if (!sample.Valid)
|
||||
continue;
|
||||
|
||||
if (double.IsNaN(reference))
|
||||
reference = sample.Azimuth;
|
||||
var weight = sample.Weight * bands[wavelength].Weight.Y;
|
||||
total += sample.Weight * bands[wavelength].Weight;
|
||||
luminance += weight;
|
||||
azimuth += weight * Corner.Unwrap(sample.Azimuth, reference);
|
||||
elevation += weight * sample.Elevation;
|
||||
}
|
||||
|
||||
if (double.IsNaN(reference))
|
||||
return default;
|
||||
if (luminance <= 0.0)
|
||||
return new Corner { Valid = true, Azimuth = reference };
|
||||
|
||||
var center = new Corner { Valid = true, Azimuth = azimuth / luminance, Elevation = elevation / luminance, Weight = total };
|
||||
var spread = 0.0;
|
||||
for (var wavelength = 0; wavelength < samples.Length; wavelength++)
|
||||
{
|
||||
if (!samples[wavelength].Valid)
|
||||
continue;
|
||||
|
||||
var offset = Math.Max(Math.Abs(Corner.Unwrap(samples[wavelength].Azimuth, reference) - center.Azimuth), Math.Abs(samples[wavelength].Elevation - center.Elevation));
|
||||
spread = Math.Max(spread, offset);
|
||||
}
|
||||
|
||||
center.Spread = spread;
|
||||
return center;
|
||||
}
|
||||
}
|
||||
@@ -12,7 +12,7 @@ YukkuriMovieMaker4(YMM4)上で動作する、太陽の高度とカメラの
|
||||
結果は入力の映像と設定と画素の位置から決定論的に決まり、同じ入力と同じ設定では常に同じ絵になります。
|
||||
強さ、彩度、太陽の高度、太陽の向き、視直径、画角、チルト、内暈と外暈、幻日と幻日環、タンジェントアーク、板の厚さ、柱の長さ、傾きのばらつきの13項目はアニメーションに対応しています。
|
||||
|
||||

|
||||

|
||||
|
||||
---
|
||||
|
||||
@@ -52,7 +52,7 @@ YukkuriMovieMaker4(YMM4)上で動作する、太陽の高度とカメラの
|
||||
|
||||
氷晶の向きの分類はHong and Baranoskiの論文「A Study on Atmospheric Halo Visualization」(University of Waterlooの技術報告CS-2003-26、2003年)を参照しています。この論文は光線を乱数で飛ばすモンテカルロ法で像を作りますが、本プラグインは乱数を使わず、氷晶の向きを格子状に分けて足し合わせます。氷の屈折率には、Warren and Brandtの論文「Optical constants of ice from the ultraviolet to the microwave: A revised compilation」(Journal of Geophysical Research、2008年)が公開している数表の値を使います。等色関数の計算はWyman, Sloan and Shirleyの論文「Simple Analytic Approximations to the CIE XYZ Color Matching Functions」(Journal of Computer Graphics Techniques、2013年)に基づきます。
|
||||
|
||||
結果は入力の映像と設定と画素の位置だけから決まります。時間値と乱数は使いません。同じ入力の映像と設定では同じフレームを何度描いても同じ結果になります。
|
||||
結果は入力の映像と設定と画素の位置だけから決まります。時刻と乱数は使いません。同じ入力の映像と設定では同じフレームを何度描いても同じ結果になります。
|
||||
|
||||
処理はDirect2Dのカスタムピクセルシェーダーが行います。表はCPUで求め、シェーダーへ画像として渡します。CPUへの画素の読み戻しは行いません。
|
||||
|
||||
@@ -87,7 +87,7 @@ YukkuriMovieMaker4(YMM4)上で動作する、太陽の高度とカメラの
|
||||
|
||||
次の画像は、海辺の空が写る写真に、「太陽の高度」と「チルト」を15°にして適用した例です。ほかの項目は既定値で、太陽は画面の中央に来ます。上が入力、下が出力です。空だけにハロを足し、海面と地面は元の写真のままにしています。元の写真は、Wikimedia CommonsにCC0で公開されているGreg Zaal氏とRico Cilliers氏の全周パノラマ「[Furry clouds – Panorama (Greg Zaal and Rico Cilliers via Poly Haven)](https://commons.wikimedia.org/wiki/File:Furry_clouds_%E2%80%93_Panorama_%28Greg_Zaal_and_Rico_Cilliers_via_Poly_Haven%29.jpg)」から、画角100°で切り出したものです。
|
||||
|
||||

|
||||

|
||||
|
||||
画素が見ている方向は「画角」から決めます。処理する範囲は、このエフェクトに入る映像を囲む矩形です。画角は処理する範囲の横幅に対する水平方向の画角で、レンズのゆがみがない透視投影として扱います。処理する範囲の中心がカメラの向く方向です。
|
||||
|
||||
@@ -163,7 +163,7 @@ $$
|
||||
|
||||
波長が短いほど屈折率が大きく、幻日は太陽に近い側が赤、遠い側が青になります。「傾きのばらつき」を大きくすると、幻日は上下に長く伸びます。
|
||||
|
||||
「板の厚さ」が小さい薄い板では、太陽が高いと、側面から入った光が下の六角形の面から出ることが多くなります。そのため、側面から側面へ抜ける光が減って幻日が弱くなります。「板の厚さ」が大きい厚い板では、太陽が高くても幻日が明るく保たれます。
|
||||
「板の厚さ」が小さい薄い板では、太陽が高いと、側面から入った光が下の六角形の面から出ることが多くなります。そのため、側面から側面へ抜ける光が減って幻日が弱くなります。「板の厚さ」が大きい厚い板では、太陽が高くなっても幻日の弱まり方が小さくなります。側面を光の向きから見たときの面積は板の厚さに比例するため、太陽が低いときも、薄い板ほど幻日は弱くなります。
|
||||
|
||||
幻日環は、側面の表面での反射が作ります。軸が鉛直の板では側面が鉛直なので、反射した光の高さは太陽の高さと同じです。そのため、幻日環は太陽と同じ高さの水平な輪になります。反射の割合はフレネルの式で求めます。
|
||||
|
||||
@@ -179,7 +179,7 @@ $$
|
||||
|
||||
太陽が低いと、上部のタンジェントアークはV字形になり、幻日は太陽の近くで明るく見えます。太陽が高くなると、タンジェントアークは内暈を囲む楕円形に広がります。この楕円形は外接ハロと呼ばれます。幻日は太陽から離れて弱くなります。
|
||||
|
||||

|
||||

|
||||
|
||||
### 6. 太陽の光と色
|
||||
|
||||
@@ -240,7 +240,7 @@ $$
|
||||
| 内暈と外暈 | 数値 | 100% | 0〜100% | 対応 | 向きがばらばらの氷晶が作る内暈と外暈の強さです。内暈は太陽から約22°、外暈は約46°の位置に現れます。 |
|
||||
| 幻日と幻日環 | 数値 | 70% | 0〜100% | 対応 | 板状の氷晶が作る幻日と幻日環の強さです。幻日は太陽と同じ高さの左右に、幻日環は太陽と同じ高さに水平な輪として現れます。 |
|
||||
| タンジェントアーク | 数値 | 40% | 0〜100% | 対応 | 柱状の氷晶が作る、上部と下部のタンジェントアークの強さです。上部は内暈の上側に、下部は下側に接して現れます。 |
|
||||
| 板の厚さ | 数値 | 0.4 | 0.05〜1 | 対応 | 板状の氷晶の厚さを、六角形の外接円の直径で割った値です。薄いと、太陽が高いときに幻日が弱くなります。 |
|
||||
| 板の厚さ | 数値 | 0.4 | 0.05〜1 | 対応 | 板状の氷晶の厚さを、六角形の外接円の直径で割った値です。薄いほど幻日が弱くなり、太陽が高いときの弱まり方も大きくなります。 |
|
||||
| 柱の長さ | 数値 | 2 | 1〜6 | 対応 | 柱状の氷晶の長さを、六角形の外接円の直径で割った値です。 |
|
||||
| 傾きのばらつき | 数値 | 1.5° | 0.1〜5° | 対応 | 氷晶の向きが、板では鉛直から、柱では水平からずれる角度の標準偏差です。小さいほど幻日とタンジェントアークが細くなります。 |
|
||||
|
||||
@@ -250,7 +250,7 @@ $$
|
||||
|
||||
- AviUtl向けのEXO出力には対応していません。
|
||||
- Direct2Dのカスタムエフェクトを作成できない場合は、エフェクトを適用せず入力映像を表示します。
|
||||
- ハロの位置と色は映像の内容から決めません。映像の色はハロを足す下地として使うだけです。空と地面は区別されず、不透明な画素のすべてに、同じ規則でハロを足します。空だけに重ねたいときは、空以外を透明にした映像にこのエフェクトを適用してください。
|
||||
- ハロの位置と色は映像の内容から決めません。映像の色はハロを足す下地として使うだけです。空と地面は区別されず、不透明度が0でない画素のすべてに、同じ規則でハロを足します。空だけに重ねたいときは、空以外を透明にした映像にこのエフェクトを適用してください。
|
||||
- ハロの明るさは映像の明るさに合わせません。足した結果は0から1に収めるため、すでに白い部分ではハロが見えません。
|
||||
- 太陽そのものは描きません。「視直径」はハロの縁のぼけにだけ使います。映像に太陽が写っているときは、「太陽の高度」「太陽の向き」「チルト」「画角」で、ハロの中心を太陽に合わせてください。
|
||||
- 氷晶がある空にハロが見える条件は判定しません。氷晶があるものとして、ハロを足します。
|
||||
@@ -271,7 +271,7 @@ $$
|
||||
|
||||
- 処理負荷: 画素ごとの処理は表を2回読んで色を足すだけです。「太陽の高度」「板の厚さ」「柱の長さ」「傾きのばらつき」を変えると、氷晶の中の光の経路から表をCPUで計算し直します。この計算には時間がかかります。これらの項目をアニメーションで動かすと、フレームごとに計算をやり直すため、CPUの負荷が大きくなります。「太陽の高度」は、0.25°刻みに丸めた値が変わったときだけ計算し直します。「視直径」「内暈と外暈」「幻日と幻日環」「タンジェントアーク」「彩度」を変えたときは、計算済みの値から表を組み立て直すだけです。ほかの項目と「強さ」はシェーダーの定数を変えるだけです。「幻日と幻日環」が0%のときは板状の氷晶の計算を、「タンジェントアーク」が0%のときは柱状の氷晶の計算を行いません。
|
||||
- 強さ0%: 強さが0%のときは、表の計算も合成も行わず、映像をそのまま通します。
|
||||
- 再現性: 結果は入力の映像と設定と画素の位置だけから決まります。時間値と乱数は使いません。表の計算は並列に行いますが、整数で足し合わせるか、足し合わせの順序を固定するため、同じフレームは何度描いても同じ結果になります。
|
||||
- 再現性: 結果は入力の映像と設定と画素の位置だけから決まります。時刻と乱数は使いません。表の計算は並列に行いますが、整数で足し合わせるか、足し合わせの順序を固定するため、同じフレームは何度描いても同じ結果になります。
|
||||
- 透明部分: 不透明度が0の画素は変更しません。出力の不透明度は入力と同じです。
|
||||
- 更新通知: エフェクトを最初に生成したときに、YMM4の実行中に一度だけ新しい正式版を確認します。更新情報を取得できない場合は通知せず、そのまま動作します。プレリリースは通知の対象に含めません。
|
||||
- 不具合の自動送信: 想定していない例外が起きたときは、その内容を開発者へ自動で送信します。内容は「不具合の報告」に書いています。
|
||||
@@ -281,17 +281,20 @@ $$
|
||||
|
||||
## 不具合の報告
|
||||
|
||||
本プラグインは、想定していない例外が起きたときに、その内容を開発者へ自動で送信します。同意は求めず、常に送信します。
|
||||
本プラグインは、想定していない例外が起きたときに、その内容を開発者へ自動で送信します。同意は求めません。止める設定もありません。
|
||||
|
||||
送信する数には上限があります。YMM4の1回の起動で送る報告は、YMM4-Telemetryで報告する別のプラグインと合わせて20件までです。例外の型と発生位置が同じ報告は3件までです。上限を超えた報告と、送信先から待つよう求められている間に起きた報告は、送信も退避もしません。
|
||||
|
||||
送信する情報は次のとおりです。
|
||||
|
||||
| 種類 | 内容 |
|
||||
|---|---|
|
||||
| 例外 | 型の完全名、メッセージ、スタックトレース |
|
||||
| 発生位置 | モジュール名、関数名、ファイル名、行番号 |
|
||||
| 発生位置 | モジュール名、関数名、ファイル名、行番号、プラグイン自身のコードかどうか |
|
||||
| プラグイン | アセンブリ名、バージョン |
|
||||
| 実行環境 | OSの名前とバージョン、.NETのバージョン、CPUのアーキテクチャ、論理プロセッサ数 |
|
||||
| 識別子 | YMM4の起動ごとに決まるセッション識別子、報告ごとの識別子 |
|
||||
| 時刻 | 報告を作った時刻(UTC) |
|
||||
|
||||
メッセージとファイル名は、送信の前に置き換えを通します。置き換えるのは、Windowsのユーザー名、ユーザーフォルダー、AppDataのパス、マシン名、ドメイン名、メールアドレス、IPv4アドレスです。送信元のIPアドレスは受信側へ渡す手前で取り除いています。
|
||||
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする