-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathImportTex.ps1
More file actions
36 lines (33 loc) · 817 Bytes
/
Copy pathImportTex.ps1
File metadata and controls
36 lines (33 loc) · 817 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
param (
[switch]$srgb,
[switch]$height,
[switch]$singleChannel,
[string]$filePath,
[string]$width
)
# Build texconv arguments
$texconvArgs = @($filePath, '-o', 'Assets', '-y', '-m', '5')
if (-not [string]::IsNullOrEmpty($width))
{
$texconvArgs += @('-w', $width, '-h', $width)
}
if ($height)
{
exiftool.exe -ColorSpace=Uncalibrated -overwrite_original $filePath
texconv $texconvArgs -f R16_UNORM
}
elseif ($singleChannel)
{
exiftool.exe -ColorSpace=Uncalibrated -overwrite_original $filePath
texconv $texconvArgs -f BC4_UNORM
}
elseif($srgb)
{
exiftool.exe -ColorSpace=sRGB -overwrite_original $filePath
texconv $texconvArgs -f BC7_UNORM_SRGB
}
else
{
exiftool.exe -ColorSpace=Uncalibrated -overwrite_original $filePath
texconv $texconvArgs -f BC7_UNORM
}