|
|
@ -80,6 +80,7 @@ class MatHelper{ |
|
|
|
$metalnessTextureSavaPath = $cacheFileDir.'/'.$fileName.'_metalness'.$extension; |
|
|
|
$metalnessTexture = new Imagick($metallicTextureSavaPath); |
|
|
|
$metalnessTexture->separateImageChannel(Imagick::CHANNEL_BLUE); |
|
|
|
$metalnessTexture->setImageCompressionQuality(100); |
|
|
|
$metalnessTexture->writeImage($metalnessTextureSavaPath); |
|
|
|
$metalnessTexture = new ImageMap( |
|
|
|
['file' => $metalnessTextureSavaPath] |
|
|
@ -92,6 +93,7 @@ class MatHelper{ |
|
|
|
$roughnessTextureSavaPath = $cacheFileDir.'/'.$fileName.'_roughness'.$extension; |
|
|
|
$roughnessTexture = new Imagick($metallicTextureSavaPath); |
|
|
|
$roughnessTexture->separateImageChannel(Imagick::CHANNEL_GREEN); |
|
|
|
$roughnessTexture->setImageCompressionQuality(100); |
|
|
|
$roughnessTexture->writeImage($roughnessTextureSavaPath); |
|
|
|
$roughnessTexture = new ImageMap( |
|
|
|
['file' => $roughnessTextureSavaPath] |
|
|
@ -112,7 +114,7 @@ class MatHelper{ |
|
|
|
$fileName = preg_replace('/(\.[^\.]+)$/','',basename($textureSavaPath)); |
|
|
|
$extension = preg_replace('/^('.$fileName.')+/','',basename($textureSavaPath)); |
|
|
|
$textureInvertGPath = $cacheFileDir.'/'.$fileName.'_InvertG'.$extension; |
|
|
|
$imagick = new \Imagick($textureSavaPath); |
|
|
|
$imagick = new Imagick($textureSavaPath); |
|
|
|
$imageIterator = $imagick->getPixelIterator(); |
|
|
|
foreach ($imageIterator as $row => $pixels) { |
|
|
|
foreach ($pixels as $column => $pixel) { |
|
|
@ -127,6 +129,7 @@ class MatHelper{ |
|
|
|
} |
|
|
|
$imageIterator->syncIterator(); |
|
|
|
} |
|
|
|
$imagick->setImageCompressionQuality(100); |
|
|
|
$imagick->writeImage($textureInvertGPath); |
|
|
|
|
|
|
|
|
|
|
|