Browse Source

createMatOfDisney 修复解析材质参数错误

master
yuanjiajia 1 year ago
parent
commit
491083aab2
  1. 3
      src/utils/MatHelper.php

3
src/utils/MatHelper.php

@ -84,6 +84,7 @@ class MatHelper{
$metalnessTexture = new ImageMap( $metalnessTexture = new ImageMap(
['file' => $metalnessTextureSavaPath] ['file' => $metalnessTextureSavaPath]
); );
$metalnessTexture->gamma = 1;
$metalnessTexture->mapping = $mapping; $metalnessTexture->mapping = $mapping;
$scene->registerTexture($metalnessTexture); $scene->registerTexture($metalnessTexture);
$material->setMetallic($metalnessTexture); $material->setMetallic($metalnessTexture);
@ -95,6 +96,7 @@ class MatHelper{
$roughnessTexture = new ImageMap( $roughnessTexture = new ImageMap(
['file' => $roughnessTextureSavaPath] ['file' => $roughnessTextureSavaPath]
); );
$roughnessTexture->gamma = 1;
$roughnessTexture->mapping = $mapping; $roughnessTexture->mapping = $mapping;
$scene->registerTexture($roughnessTexture); $scene->registerTexture($roughnessTexture);
$material->setRoughness($roughnessTexture); $material->setRoughness($roughnessTexture);
@ -108,6 +110,7 @@ class MatHelper{
$bumpTexture = new ImageMap( $bumpTexture = new ImageMap(
['file' => $textureSavaPath] ['file' => $textureSavaPath]
); );
$bumpTexture->gamma = 1;
$bumpTexture->mapping = $mapping; $bumpTexture->mapping = $mapping;
$scene->registerTexture($bumpTexture); $scene->registerTexture($bumpTexture);

Loading…
Cancel
Save