@ -29,6 +29,13 @@ class NormalMap extends TextureBase
Base::__construct($config);
}
/**
* @param object $texture 接收一个纹理对象,设置 texture 属性
*/
public function setTexture($texture)
{
$this->texture = $this->judgeAttribute($texture);
?>
@ -115,7 +115,7 @@ class MatHelper{
$scene->registerTexture($bumpTexture);
$normalTexture = new NormalMap();
$normalTexture->texture = $bumpTexture;
$normalTexture->setTexture($bumpTexture);
$normalTexture->scale = $matOriginal->matParams->bumpLevel;
$scene->registerTexture($normalTexture);
$material->setBumptex($normalTexture);