|
|
@ -1,9 +1,7 @@ |
|
|
|
<?php |
|
|
|
|
|
|
|
namespace Blobt\Luxcore\scene\materials; |
|
|
|
|
|
|
|
use __PHP_Incomplete_Class; |
|
|
|
use Blobt\Luxcore\core\Base; |
|
|
|
use Blobt\Luxcore\core; |
|
|
|
use Blobt\Luxcore\scene\Scene; |
|
|
|
|
|
|
|
|
|
|
@ -13,7 +11,7 @@ class Disney extends MaterialsBase |
|
|
|
const TYPE_DISNEY = 'disney'; |
|
|
|
|
|
|
|
/** |
|
|
|
* @var string 漫反射颜色,一个小数形式的RGB色值,或是一个textures(贴图数组)中的某个键名 |
|
|
|
* @var string 漫反射颜色,一个小数形式的RGB色值,或是一个textures(贴图数组)中的某个键名sd |
|
|
|
*/ |
|
|
|
public $basecolor = "0.7 0.7 0.7"; |
|
|
|
|
|
|
@ -105,7 +103,7 @@ class Disney extends MaterialsBase |
|
|
|
{ |
|
|
|
$this->type = self::TYPE_DISNEY; |
|
|
|
$this->id = Scene::createID(); |
|
|
|
Base::__construct($config); |
|
|
|
core\Base::__construct($config); |
|
|
|
} |
|
|
|
|
|
|
|
public function setBaseColor($color) |
|
|
@ -115,9 +113,10 @@ class Disney extends MaterialsBase |
|
|
|
if( $color->cards != null ) $this->basecolor = $color->cards; |
|
|
|
else |
|
|
|
{ |
|
|
|
$backtrace = debug_backtrace(); |
|
|
|
$backtrace = $backtrace[0]['file'].':'.$backtrace[0]['line']."\n"; |
|
|
|
$this->printException($backtrace,$color); |
|
|
|
$message = debug_backtrace(); |
|
|
|
$message = $message[0]['file'].':'.$message[0]['line']."\n"; |
|
|
|
$message .= array_reverse(explode('\\', get_class($color)))[0]; |
|
|
|
throw new core\SceneException($message,1); |
|
|
|
} |
|
|
|
} |
|
|
|
else $this->basecolor = $color; |
|
|
@ -130,9 +129,10 @@ class Disney extends MaterialsBase |
|
|
|
if( $color->cards != null ) $this->subsurface = $color->cards; |
|
|
|
else |
|
|
|
{ |
|
|
|
$backtrace = debug_backtrace(); |
|
|
|
$backtrace = $backtrace[0]['file'].':'.$backtrace[0]['line']."\n"; |
|
|
|
$this->printException($backtrace,$color); |
|
|
|
$message = debug_backtrace(); |
|
|
|
$message = $message[0]['file'].':'.$message[0]['line']."\n"; |
|
|
|
$message .= array_reverse(explode('\\', get_class($color)))[0]; |
|
|
|
throw new core\SceneException($message,1); |
|
|
|
} |
|
|
|
} |
|
|
|
else $this->subsurface = $color; |
|
|
@ -145,9 +145,10 @@ class Disney extends MaterialsBase |
|
|
|
if( $color->cards != null ) $this->metallic = $color->cards; |
|
|
|
else |
|
|
|
{ |
|
|
|
$backtrace = debug_backtrace(); |
|
|
|
$backtrace = $backtrace[0]['file'].':'.$backtrace[0]['line']."\n"; |
|
|
|
$this->printException($backtrace,$color); |
|
|
|
$message = debug_backtrace(); |
|
|
|
$message = $message[0]['file'].':'.$message[0]['line']."\n"; |
|
|
|
$message .= array_reverse(explode('\\', get_class($color)))[0]; |
|
|
|
throw new core\SceneException($message,1); |
|
|
|
} |
|
|
|
} |
|
|
|
else $this->metallic = $color; |
|
|
@ -160,9 +161,10 @@ class Disney extends MaterialsBase |
|
|
|
if( $color->cards != null ) $this->specular = $color->cards; |
|
|
|
else |
|
|
|
{ |
|
|
|
$backtrace = debug_backtrace(); |
|
|
|
$backtrace = $backtrace[0]['file'].':'.$backtrace[0]['line']."\n"; |
|
|
|
$this->printException($backtrace,$color); |
|
|
|
$message = debug_backtrace(); |
|
|
|
$message = $message[0]['file'].':'.$message[0]['line']."\n"; |
|
|
|
$message .= array_reverse(explode('\\', get_class($color)))[0]; |
|
|
|
throw new core\SceneException($message,1); |
|
|
|
} |
|
|
|
} |
|
|
|
else $this->specular = $color; |
|
|
@ -175,9 +177,10 @@ class Disney extends MaterialsBase |
|
|
|
if( $color->cards != null ) $this->speculartint = $color->cards; |
|
|
|
else |
|
|
|
{ |
|
|
|
$backtrace = debug_backtrace(); |
|
|
|
$backtrace = $backtrace[0]['file'].':'.$backtrace[0]['line']."\n"; |
|
|
|
$this->printException($backtrace,$color); |
|
|
|
$message = debug_backtrace(); |
|
|
|
$message = $message[0]['file'].':'.$message[0]['line']."\n"; |
|
|
|
$message .= array_reverse(explode('\\', get_class($color)))[0]; |
|
|
|
throw new core\SceneException($message,1); |
|
|
|
} |
|
|
|
} |
|
|
|
else $this->speculartint = $color; |
|
|
@ -190,9 +193,10 @@ class Disney extends MaterialsBase |
|
|
|
if( $color->cards != null ) $this->roughness = $color->cards; |
|
|
|
else |
|
|
|
{ |
|
|
|
$backtrace = debug_backtrace(); |
|
|
|
$backtrace = $backtrace[0]['file'].':'.$backtrace[0]['line']."\n"; |
|
|
|
$this->printException($backtrace,$color); |
|
|
|
$message = debug_backtrace(); |
|
|
|
$message = $message[0]['file'].':'.$message[0]['line']."\n"; |
|
|
|
$message .= array_reverse(explode('\\', get_class($color)))[0]; |
|
|
|
throw new core\SceneException($message,1); |
|
|
|
} |
|
|
|
} |
|
|
|
else $this->roughness = $color; |
|
|
@ -205,9 +209,10 @@ class Disney extends MaterialsBase |
|
|
|
if( $color->cards != null ) $this->anisotropic = $color->cards; |
|
|
|
else |
|
|
|
{ |
|
|
|
$backtrace = debug_backtrace(); |
|
|
|
$backtrace = $backtrace[0]['file'].':'.$backtrace[0]['line']."\n"; |
|
|
|
$this->printException($backtrace,$color); |
|
|
|
$message = debug_backtrace(); |
|
|
|
$message = $message[0]['file'].':'.$message[0]['line']."\n"; |
|
|
|
$message .= array_reverse(explode('\\', get_class($color)))[0]; |
|
|
|
throw new core\SceneException($message,1); |
|
|
|
} |
|
|
|
} |
|
|
|
else $this->anisotropic = $color; |
|
|
@ -220,9 +225,10 @@ class Disney extends MaterialsBase |
|
|
|
if( $color->cards != null ) $this->sheen = $color->cards; |
|
|
|
else |
|
|
|
{ |
|
|
|
$backtrace = debug_backtrace(); |
|
|
|
$backtrace = $backtrace[0]['file'].':'.$backtrace[0]['line']."\n"; |
|
|
|
$this->printException($backtrace,$color); |
|
|
|
$message = debug_backtrace(); |
|
|
|
$message = $message[0]['file'].':'.$message[0]['line']."\n"; |
|
|
|
$message .= array_reverse(explode('\\', get_class($color)))[0]; |
|
|
|
throw new core\SceneException($message,1); |
|
|
|
} |
|
|
|
} |
|
|
|
else $this->sheen = $color; |
|
|
@ -235,9 +241,10 @@ class Disney extends MaterialsBase |
|
|
|
if( $color->cards != null ) $this->sheentint = $color->cards; |
|
|
|
else |
|
|
|
{ |
|
|
|
$backtrace = debug_backtrace(); |
|
|
|
$backtrace = $backtrace[0]['file'].':'.$backtrace[0]['line']."\n"; |
|
|
|
$this->printException($backtrace,$color); |
|
|
|
$message = debug_backtrace(); |
|
|
|
$message = $message[0]['file'].':'.$message[0]['line']."\n"; |
|
|
|
$message .= array_reverse(explode('\\', get_class($color)))[0]; |
|
|
|
throw new core\SceneException($message,1); |
|
|
|
} |
|
|
|
} |
|
|
|
else $this->sheentint = $color; |
|
|
@ -250,9 +257,10 @@ class Disney extends MaterialsBase |
|
|
|
if( $color->cards != null ) $this->clearcoat = $color->cards; |
|
|
|
else |
|
|
|
{ |
|
|
|
$backtrace = debug_backtrace(); |
|
|
|
$backtrace = $backtrace[0]['file'].':'.$backtrace[0]['line']."\n"; |
|
|
|
$this->printException($backtrace,$color); |
|
|
|
$message = debug_backtrace(); |
|
|
|
$message = $message[0]['file'].':'.$message[0]['line']."\n"; |
|
|
|
$message .= array_reverse(explode('\\', get_class($color)))[0]; |
|
|
|
throw new core\SceneException($message,1); |
|
|
|
} |
|
|
|
} |
|
|
|
else $this->clearcoat = $color; |
|
|
@ -265,9 +273,10 @@ class Disney extends MaterialsBase |
|
|
|
if( $color->cards != null ) $this->clearcoatgloss = $color->cards; |
|
|
|
else |
|
|
|
{ |
|
|
|
$backtrace = debug_backtrace(); |
|
|
|
$backtrace = $backtrace[0]['file'].':'.$backtrace[0]['line']."\n"; |
|
|
|
$this->printException($backtrace,$color); |
|
|
|
$message = debug_backtrace(); |
|
|
|
$message = $message[0]['file'].':'.$message[0]['line']."\n"; |
|
|
|
$message .= array_reverse(explode('\\', get_class($color)))[0]; |
|
|
|
throw new core\SceneException($message,1); |
|
|
|
} |
|
|
|
} |
|
|
|
else $this->clearcoatgloss = $color; |
|
|
@ -280,9 +289,10 @@ class Disney extends MaterialsBase |
|
|
|
if( $color->cards != null ) $this->transparencyFront = $color->cards; |
|
|
|
else |
|
|
|
{ |
|
|
|
$backtrace = debug_backtrace(); |
|
|
|
$backtrace = $backtrace[0]['file'].':'.$backtrace[0]['line']."\n"; |
|
|
|
$this->printException($backtrace,$color); |
|
|
|
$message = debug_backtrace(); |
|
|
|
$message = $message[0]['file'].':'.$message[0]['line']."\n"; |
|
|
|
$message .= array_reverse(explode('\\', get_class($color)))[0]; |
|
|
|
throw new core\SceneException($message,1); |
|
|
|
} |
|
|
|
} |
|
|
|
else $this->transparencyFront = $color; |
|
|
@ -295,9 +305,10 @@ class Disney extends MaterialsBase |
|
|
|
if( $color->cards != null ) $this->transparencyBack = $color->cards; |
|
|
|
else |
|
|
|
{ |
|
|
|
$backtrace = debug_backtrace(); |
|
|
|
$backtrace = $backtrace[0]['file'].':'.$backtrace[0]['line']."\n"; |
|
|
|
$this->printException($backtrace,$color); |
|
|
|
$message = debug_backtrace(); |
|
|
|
$message = $message[0]['file'].':'.$message[0]['line']."\n"; |
|
|
|
$message .= array_reverse(explode('\\', get_class($color)))[0]; |
|
|
|
throw new core\SceneException($message,1); |
|
|
|
} |
|
|
|
} |
|
|
|
else $this->transparencyBack = $color; |
|
|
@ -310,9 +321,10 @@ class Disney extends MaterialsBase |
|
|
|
if( $color->cards != null ) $this->filmamount = $color->cards; |
|
|
|
else |
|
|
|
{ |
|
|
|
$backtrace = debug_backtrace(); |
|
|
|
$backtrace = $backtrace[0]['file'].':'.$backtrace[0]['line']."\n"; |
|
|
|
$this->printException($backtrace,$color); |
|
|
|
$message = debug_backtrace(); |
|
|
|
$message = $message[0]['file'].':'.$message[0]['line']."\n"; |
|
|
|
$message .= array_reverse(explode('\\', get_class($color)))[0]; |
|
|
|
throw new core\SceneException($message,1); |
|
|
|
} |
|
|
|
} |
|
|
|
else $this->filmamount = $color; |
|
|
@ -324,9 +336,10 @@ class Disney extends MaterialsBase |
|
|
|
if( $color->cards != null ) $this->filmthickness = $color->cards; |
|
|
|
else |
|
|
|
{ |
|
|
|
$backtrace = debug_backtrace(); |
|
|
|
$backtrace = $backtrace[0]['file'].':'.$backtrace[0]['line']."\n"; |
|
|
|
$this->printException($backtrace,$color); |
|
|
|
$message = debug_backtrace(); |
|
|
|
$message = $message[0]['file'].':'.$message[0]['line']."\n"; |
|
|
|
$message .= array_reverse(explode('\\', get_class($color)))[0]; |
|
|
|
throw new core\SceneException($message,1); |
|
|
|
} |
|
|
|
} |
|
|
|
else $this->filmthickness = $color; |
|
|
@ -339,9 +352,10 @@ class Disney extends MaterialsBase |
|
|
|
if( $color->cards != null ) $this->filmior = $color->cards; |
|
|
|
else |
|
|
|
{ |
|
|
|
$backtrace = debug_backtrace(); |
|
|
|
$backtrace = $backtrace[0]['file'].':'.$backtrace[0]['line']."\n"; |
|
|
|
$this->printException($backtrace,$color); |
|
|
|
$message = debug_backtrace(); |
|
|
|
$message = $message[0]['file'].':'.$message[0]['line']."\n"; |
|
|
|
$message .= array_reverse(explode('\\', get_class($color)))[0]; |
|
|
|
throw new core\SceneException($message,1); |
|
|
|
} |
|
|
|
} |
|
|
|
else $this->filmior = $color; |
|
|
@ -354,9 +368,10 @@ class Disney extends MaterialsBase |
|
|
|
if( $color->cards != null ) $this->bumptex = $color->cards; |
|
|
|
else |
|
|
|
{ |
|
|
|
$backtrace = debug_backtrace(); |
|
|
|
$backtrace = $backtrace[0]['file'].':'.$backtrace[0]['line']."\n"; |
|
|
|
$this->printException($backtrace,$color); |
|
|
|
$message = debug_backtrace(); |
|
|
|
$message = $message[0]['file'].':'.$message[0]['line']."\n"; |
|
|
|
$message .= array_reverse(explode('\\', get_class($color)))[0]; |
|
|
|
throw new core\SceneException($message,1); |
|
|
|
} |
|
|
|
} |
|
|
|
else $this->bumptex = $color; |
|
|
|