|
@ -66,7 +66,6 @@ class MatHelper{ |
|
|
$albedoTexture->mapping = $mapping; |
|
|
$albedoTexture->mapping = $mapping; |
|
|
$scene->registerTexture($albedoTexture); |
|
|
$scene->registerTexture($albedoTexture); |
|
|
$material->setBaseColor($albedoTexture); |
|
|
$material->setBaseColor($albedoTexture); |
|
|
fclose($textureHandle); |
|
|
|
|
|
} |
|
|
} |
|
|
if($matOriginal->matParams->metallicTexture){ |
|
|
if($matOriginal->matParams->metallicTexture){ |
|
|
$textureUrl = $matOriginal->matParams->metallicTexture; |
|
|
$textureUrl = $matOriginal->matParams->metallicTexture; |
|
@ -87,7 +86,6 @@ class MatHelper{ |
|
|
$roughnessTexture->mapping = $mapping; |
|
|
$roughnessTexture->mapping = $mapping; |
|
|
$scene->registerTexture($roughnessTexture); |
|
|
$scene->registerTexture($roughnessTexture); |
|
|
$material->setRoughness($roughnessTexture); |
|
|
$material->setRoughness($roughnessTexture); |
|
|
fclose($textureHandle); |
|
|
|
|
|
} |
|
|
} |
|
|
if($matOriginal->matParams->bumpTexture){ |
|
|
if($matOriginal->matParams->bumpTexture){ |
|
|
$textureUrl = $matOriginal->matParams->bumpTexture; |
|
|
$textureUrl = $matOriginal->matParams->bumpTexture; |
|
@ -106,7 +104,6 @@ class MatHelper{ |
|
|
$normalTexture->scale = $matOriginal->matParams->bumpLevel; |
|
|
$normalTexture->scale = $matOriginal->matParams->bumpLevel; |
|
|
$scene->registerTexture($normalTexture); |
|
|
$scene->registerTexture($normalTexture); |
|
|
$material->setBumptex($normalTexture); |
|
|
$material->setBumptex($normalTexture); |
|
|
fclose($textureHandle); |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
//TODO: 更多通道贴图处理,待后续完善
|
|
|
//TODO: 更多通道贴图处理,待后续完善
|
|
@ -149,7 +146,6 @@ class MatHelper{ |
|
|
$g = hexdec(substr($hexColor, 3, 2))/255; |
|
|
$g = hexdec(substr($hexColor, 3, 2))/255; |
|
|
$b = hexdec(substr($hexColor, 5, 2))/255; |
|
|
$b = hexdec(substr($hexColor, 5, 2))/255; |
|
|
$floatColor = "$r $g $b"; |
|
|
$floatColor = "$r $g $b"; |
|
|
echo "\n$floatColor"; |
|
|
|
|
|
return $floatColor; |
|
|
return $floatColor; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|