From d852af499309427d118a2586b5f0e53454d97c1b Mon Sep 17 00:00:00 2001 From: yuanjiajia <1139393632@qq.com> Date: Wed, 9 Mar 2022 15:42:04 +0800 Subject: [PATCH] =?UTF-8?q?Scene=E3=80=81=E6=A8=A1=E5=9E=8B=E3=80=81?= =?UTF-8?q?=E6=9D=90=E8=B4=A8=E3=80=81=E8=B4=B4=E5=9B=BE=E7=B1=BB=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E5=A2=9E=E5=8A=A0=E4=BA=86=E6=B3=A8=E9=87=8A=EF=BC=8C?= =?UTF-8?q?texture=E7=9B=AE=E5=BD=95=E4=B8=8B=E7=9A=84map=E7=9B=AE?= =?UTF-8?q?=E5=BD=95=E6=9B=B4=E5=90=8D=E4=B8=BAprocedural=EF=BC=8C?= =?UTF-8?q?=E5=85=B6=E4=B8=8B=E5=9C=A8=E7=B1=BB=E6=96=87=E4=BB=B6=E7=A9=BA?= =?UTF-8?q?=E9=97=B4=E5=90=8D=E4=B9=9F=E4=BD=9C=E4=BA=86=E7=9B=B8=E5=BA=94?= =?UTF-8?q?=E7=9A=84=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/scene/Scene.php | 27 ++++- src/scene/materials/CarPaint.php | 67 ++++++++++--- src/scene/materials/Cloth.php | 19 +++- src/scene/materials/Disney.php | 99 ++++++++++--------- src/scene/materials/Glass.php | 25 ++++- src/scene/materials/GlassArch.php | 22 ++++- src/scene/materials/GlassRough.php | 28 +++++- src/scene/materials/Glossy.php | 40 +++++--- src/scene/materials/GlossyCoating.php | 40 +++++--- src/scene/materials/GlossyTranslucent.php | 84 +++++++++++----- src/scene/materials/MaterialsBase.php | 19 +++- src/scene/materials/Matte.php | 9 ++ src/scene/materials/MatteRough.php | 12 +++ src/scene/materials/MatteTranslucent.php | 12 +++ src/scene/materials/Metal.php | 16 +++ src/scene/materials/Mirror.php | 9 ++ src/scene/materials/Mix.php | 17 +++- src/scene/materials/NullMaterial.php | 6 ++ src/scene/materials/TwoSided.php | 69 +++++++++++++ src/scene/materials/Velvet.php | 22 ++++- src/scene/objects/Objects.php | 6 ++ src/scene/texture/mapping/Triplanar.php | 3 + .../texture/{map => procedural}/Blend.php | 4 +- .../texture/{map => procedural}/Clouds.php | 4 +- .../texture/{map => procedural}/ImageMap.php | 5 +- src/scene/texture/transform/NormalMap.php | 4 +- 26 files changed, 540 insertions(+), 128 deletions(-) create mode 100644 src/scene/materials/TwoSided.php rename src/scene/texture/{map => procedural}/Blend.php (95%) rename src/scene/texture/{map => procedural}/Clouds.php (96%) rename src/scene/texture/{map => procedural}/ImageMap.php (93%) diff --git a/src/scene/Scene.php b/src/scene/Scene.php index 515e9e9..98b0dde 100644 --- a/src/scene/Scene.php +++ b/src/scene/Scene.php @@ -37,6 +37,9 @@ class Scene extends BaseCfg */ private $cameras = []; + /** + * 为每个需要存到Scene的实例化对象生成一个唯一的ID + */ public static function createID() { static $num = 0; @@ -44,7 +47,9 @@ class Scene extends BaseCfg return $num; } - + /** + * @param object $obj 接收一个模型类对象,为其颁发一个注册信息,并将其存到Scene + */ public function registerObjects(&$obj) { $temp = null; @@ -61,6 +66,9 @@ class Scene extends BaseCfg $this->objects[$temp] = $obj; } + /** + * @param object $material 接收一个材质类对象,为其颁发一个注册信息,并将其存到Scene + */ public function registerMaterial(&$material) { $temp = null; @@ -69,7 +77,9 @@ class Scene extends BaseCfg $this->materials[$temp] = $material; } - + /** + * @param object $texture 接收一个纹理类对象,为其颁发一个注册信息,并将其存到Scene + */ public function registerTexture(&$texture) { $temp = null; @@ -78,6 +88,9 @@ class Scene extends BaseCfg $this->textures[$temp] = $texture; } + /** + * @param object $volume 接收一个体积类对象,为其颁发一个注册信息,并将其存到Scene + */ public function registerVolume(&$volume) { $temp = null; @@ -85,7 +98,10 @@ class Scene extends BaseCfg $volume->registerId = $temp; $this->volumes[$temp] = $volume; } - + + /** + * @param object $light 接收一个灯光类对象,为其颁发一个注册信息,并将其存到Scene + */ public function registerLight(&$light) { $temp = null; @@ -93,7 +109,10 @@ class Scene extends BaseCfg $light->registerId = $temp; $this->lights[$temp] = $light; } - + + /** + * @param object $camera 接收一个相机类对象,为其颁发一个注册信息,并将其存到Scene + */ public function registerCamera(&$camera) { $temp = null; diff --git a/src/scene/materials/CarPaint.php b/src/scene/materials/CarPaint.php index a8f66ad..b1e5f11 100644 --- a/src/scene/materials/CarPaint.php +++ b/src/scene/materials/CarPaint.php @@ -8,7 +8,7 @@ class CarPaint extends MaterialsBase { /** - * 使用此类材质不能设置不透明度 + * 车漆材质,高光光泽度流程,使用此类材质不能设置不透明度 */ const TYPE_CARPAINT = 'carpaint'; @@ -18,52 +18,53 @@ class CarPaint extends MaterialsBase public $kd = "0.3 0.3 0.3"; /** - * @var string 高光反射颜色,如果设置使用了 IOR 参数,此出只能固定为"1 1 1",否则是一个小数形式的RGB色值,或是一个textures(贴图数组)中的某个键名; + * @var string 第一层高光反射强度,一个小数形式的RGB色值,或是一个textures(贴图数组)中的某个键名; */ public $ks1 = "1 1 1"; /** - * @var string 高光反射颜色,如果设置使用了 IOR 参数,此出只能固定为"1 1 1",否则是一个小数形式的RGB色值,或是一个textures(贴图数组)中的某个键名; + * @var string 第二层高光反射强度,一个小数形式的RGB色值,或是一个textures(贴图数组)中的某个键名; */ public $ks2 = "1 1 1"; /** - * @var string 高光反射颜色,如果设置使用了 IOR 参数,此出只能固定为"1 1 1",否则是一个小数形式的RGB色值,或是一个textures(贴图数组)中的某个键名; + * @var string 第三层高光反射强度,一个小数形式的RGB色值,或是一个textures(贴图数组)中的某个键名; */ public $ks3 = "1 1 1"; /** - * @var string 高光反射颜色,如果设置使用了 IOR 参数,此出只能固定为"1 1 1",否则是一个小数形式的RGB色值,或是一个textures(贴图数组)中的某个键名; + * @var string 第一层微面光泽度,一个小数形式的RGB色值,或是一个textures(贴图数组)中的某个键名; */ public $m1 = "0.25"; /** - * @var string 高光反射颜色,如果设置使用了 IOR 参数,此出只能固定为"1 1 1",否则是一个小数形式的RGB色值,或是一个textures(贴图数组)中的某个键名; + * @var string 第二层微面光泽度,一个小数形式的RGB色值,或是一个textures(贴图数组)中的某个键名; */ public $m2 = "0.1"; /** - * @var string 高光反射颜色,如果设置使用了 IOR 参数,此出只能固定为"1 1 1",否则是一个小数形式的RGB色值,或是一个textures(贴图数组)中的某个键名; + * @var string 第三层微面光泽度,一个小数形式的RGB色值,或是一个textures(贴图数组)中的某个键名; */ public $m3 = "0.015"; /** - * @var string 高光反射颜色,如果设置使用了 IOR 参数,此出只能固定为"1 1 1",否则是一个小数形式的RGB色值,或是一个textures(贴图数组)中的某个键名; + * @var string 第一层粗糙度,一个小数形式的RGB色值,或是一个textures(贴图数组)中的某个键名; */ public $r1 = "0.95"; /** - * @var string 高光反射颜色,如果设置使用了 IOR 参数,此出只能固定为"1 1 1",否则是一个小数形式的RGB色值,或是一个textures(贴图数组)中的某个键名; + * @var string 第二层粗糙度,一个小数形式的RGB色值,或是一个textures(贴图数组)中的某个键名; */ public $r2 = "0.9"; /** - * @var string 高光反射颜色,如果设置使用了 IOR 参数,此出只能固定为"1 1 1",否则是一个小数形式的RGB色值,或是一个textures(贴图数组)中的某个键名; + * @var string 第三层粗糙度,一个小数形式的RGB色值,或是一个textures(贴图数组)中的某个键名; */ public $r3 = "0.7"; /** - * @var string 吸收颜色,一个小数形式的RGB色值,或是一个textures(贴图数组)中的某个键名 + * @var string 吸收颜色,一个小数形式的RGB色值,或是一个textures(贴图数组)中的某个键名。这里的色值是对应UI界面色值的补色, + * 因为UI界面中的色值为了获得可见即可得直观的效果 */ public $ka = "0 0 0"; @@ -72,6 +73,9 @@ class CarPaint extends MaterialsBase */ public $d = 0; + /** + * @param array $config 接收一个数组,可以初始化当前实例化对象的各种属性 + */ public function __construct($config = []) { $this->type = self::TYPE_CARPAINT; @@ -79,6 +83,9 @@ class CarPaint extends MaterialsBase Base::__construct($config); } + /** + * @param object $color 接收一个贴图对象或小数形式的色值,设置车漆材质的漫反射颜色 + */ public function setBaseColor($color) { if( is_object($color) ) @@ -91,7 +98,10 @@ class CarPaint extends MaterialsBase } else $this->kd = $color; } - + + /** + * @param object $color 接收一个贴图对象或小数形式的色值,设置车漆材质的第一层高光反射强度 + */ public function setSpecular1($color) { if( is_object($color) ) @@ -105,6 +115,9 @@ class CarPaint extends MaterialsBase else $this->ks1 = $color; } + /** + * @param object $color 接收一个贴图对象或小数形式的色值,设置车漆材质的第二层高光反射强度 + */ public function setSpecular2($color) { if( is_object($color) ) @@ -118,6 +131,9 @@ class CarPaint extends MaterialsBase else $this->ks2 = $color; } + /** + * @param object $color 接收一个贴图对象或小数形式的色值,设置车漆材质的第三层高光反射强度 + */ public function setSpecular3($color) { if( is_object($color) ) @@ -130,7 +146,10 @@ class CarPaint extends MaterialsBase } else $this->ks3 = $color; } - + + /** + * @param object $color 接收一个贴图对象或小数形式的色值,设置车漆材质的第一层微面光泽度 + */ public function setMicrofacetRoughness1($color) { if( is_object($color) ) @@ -144,6 +163,9 @@ class CarPaint extends MaterialsBase else $this->m1 = $color; } + /** + * @param object $color 接收一个贴图对象或小数形式的色值,设置车漆材质的第二层微面光泽度 + */ public function setMicrofacetRoughness2($color) { if( is_object($color) ) @@ -157,6 +179,9 @@ class CarPaint extends MaterialsBase else $this->m2 = $color; } + /** + * @param object $color 接收一个贴图对象或小数形式的色值,设置车漆材质的第三层微面光泽度 + */ public function setMicrofacetRoughness3($color) { if( is_object($color) ) @@ -170,6 +195,9 @@ class CarPaint extends MaterialsBase else $this->m3 = $color; } + /** + * @param object $color 接收一个贴图对象或小数形式的色值,设置车漆材质的第一层光泽度 + */ public function setGlossy1($color) { if( is_object($color) ) @@ -183,6 +211,9 @@ class CarPaint extends MaterialsBase else $this->r1 = $color; } + /** + * @param object $color 接收一个贴图对象或小数形式的色值,设置车漆材质的第二层光泽度 + */ public function setGlossy2($color) { if( is_object($color) ) @@ -196,6 +227,9 @@ class CarPaint extends MaterialsBase else $this->r2 = $color; } + /** + * @param object $color 接收一个贴图对象或小数形式的色值,设置车漆材质的第三层光泽度 + */ public function setGlossy3($color) { if( is_object($color) ) @@ -209,6 +243,10 @@ class CarPaint extends MaterialsBase else $this->r3 = $color; } + /** + * @param object $color 接收一个贴图对象或小数形式的色值,设置车漆材质的吸收颜色,这里的色值是对应UI界面色值的补色, + * 因为UI界面中的色值为了获得可见即可得直观的效果 + */ public function setAbsorption($color) { if( is_object($color) ) @@ -222,6 +260,9 @@ class CarPaint extends MaterialsBase else $this->ka = $color; } + /** + * @param object $color 接收一个贴图对象或小数形式的色值,设置车漆材质的吸收颜色的吸收深度 + */ public function setAbsorptionDepht($color) { if( is_object($color) ) diff --git a/src/scene/materials/Cloth.php b/src/scene/materials/Cloth.php index be2113d..0003c41 100644 --- a/src/scene/materials/Cloth.php +++ b/src/scene/materials/Cloth.php @@ -6,7 +6,9 @@ use Blobt\Luxcore\scene\Scene; class Cloth extends MaterialsBase { - + /** + * 布料材质,高光光泽度流程 + */ const TYPE_CLOTH = 'cloth'; /** @@ -54,6 +56,9 @@ class Cloth extends MaterialsBase */ public $preset = self::TTPE_DENIM; + /** + * @param array $config 接收一个数组,可以初始化当前实例化对象的各种属性 + */ public function __construct($config = []) { $this->type = self::TYPE_CLOTH; @@ -61,6 +66,9 @@ class Cloth extends MaterialsBase Base::__construct($config); } + /** + * @param object $color 接收一个贴图对象或小数形式的色值,设置布料材质的经向漫反射颜色 + */ public function setWarpBaseColor($color) { if( is_object($color) ) @@ -74,6 +82,9 @@ class Cloth extends MaterialsBase else $this->warp_kd = $color; } + /** + * @param object $color 接收一个贴图对象或小数形式的色值,设置布料材质的纬向漫反射颜色 + */ public function setWeftBaseColor($color) { if( is_object($color) ) @@ -87,6 +98,9 @@ class Cloth extends MaterialsBase else $this->weft_kd = $color; } + /** + * @param object $color 接收一个贴图对象或小数形式的色值,设置布料材质的经向高光反射强度 + */ public function setWarpSpecular($color) { if( is_object($color) ) @@ -100,6 +114,9 @@ class Cloth extends MaterialsBase else $this->warp_ks = $color; } + /** + * @param object $color 接收一个贴图对象或小数形式的色值,设置布料材质的纬向高光反射强度 + */ public function setWeftSpecular($color) { if( is_object($color) ) diff --git a/src/scene/materials/Disney.php b/src/scene/materials/Disney.php index ea3893a..316adce 100644 --- a/src/scene/materials/Disney.php +++ b/src/scene/materials/Disney.php @@ -7,7 +7,10 @@ use Blobt\Luxcore\scene\Scene; class Disney extends MaterialsBase { - + /** + * Disney材质,这是一种金属度流程的材质,但它将漫反射、高光反射、光泽反射、吸收的基本属性进行分离控制,并加入次表面、涂层、薄膜的效果控制, + * 是满足大多数材质调节的一种通用材质。 + */ const TYPE_DISNEY = 'disney'; /** @@ -56,12 +59,12 @@ class Disney extends MaterialsBase public $sheentint = 0; /** - * @var float 清漆,一个0-1的小数,或是一个textures(贴图数组)中的某个键名 + * @var float 清漆涂层,一个0-1的小数,或是一个textures(贴图数组)中的某个键名 */ public $clearcoat = 0; /** - * @var float 透明涂层光泽,一个0-1的小数,或是一个textures(贴图数组)中的某个键名 + * @var float 透明清漆涂层光泽,一个0-1的小数,或是一个textures(贴图数组)中的某个键名 */ public $clearcoatgloss = 1; @@ -76,10 +79,13 @@ class Disney extends MaterialsBase public $filmthickness; /** - * @var float 薄膜折射率,一个0-1的小数,或是一个textures(贴图数组)中的某个键名,(默认:1.5) + * @var float 薄膜菲列尔反射率,一个0-1的小数,或是一个textures(贴图数组)中的某个键名,(默认:1.5) */ public $filmior; + /** + * @param array $config 接收一个数组,可以初始化当前实例化对象的各种属性 + */ public function __construct($config = []) { $this->type = self::TYPE_DISNEY; @@ -87,6 +93,9 @@ class Disney extends MaterialsBase core\Base::__construct($config); } + /** + * @param object $color 接收一个贴图对象或小数形式的色值,设置Disney材质的漫反射颜色 + */ public function setBaseColor($color) { if( is_object($color) ) @@ -99,7 +108,10 @@ class Disney extends MaterialsBase } else $this->basecolor = $color; } - + + /** + * @param object $color 接收一个贴图对象或小数形式的色值,设置Disney材质的次表面深度 + */ public function setSubsurface($color) { if( is_object($color) ) @@ -112,7 +124,10 @@ class Disney extends MaterialsBase } else $this->subsurface = $color; } - + + /** + * @param object $color 接收一个贴图对象或小数形式的色值,设置Disney材质的金属度 + */ public function setMetallic($color) { if( is_object($color) ) @@ -126,6 +141,9 @@ class Disney extends MaterialsBase else $this->metallic = $color; } + /** + * @param object $color 接收一个贴图对象或小数形式的色值,设置Disney材质的高光反射强度 + */ public function setSpecular($color) { if( is_object($color) ) @@ -139,6 +157,9 @@ class Disney extends MaterialsBase else $this->specular = $color; } + /** + * @param object $color 接收一个贴图对象或小数形式的色值,设置Disney材质的高光反射染色强度 + */ public function setSpeculartint($color) { if( is_object($color) ) @@ -152,6 +173,9 @@ class Disney extends MaterialsBase else $this->speculartint = $color; } + /** + * @param object $color 接收一个贴图对象或小数形式的色值,设置Disney材质的粗糙度 + */ public function setRoughness($color) { if( is_object($color) ) @@ -165,6 +189,9 @@ class Disney extends MaterialsBase else $this->roughness = $color; } + /** + * @param object $color 接收一个贴图对象或小数形式的色值,设置Disney材质的产生各向异性效果强度 + */ public function setAnisotropic($color) { if( is_object($color) ) @@ -178,6 +205,9 @@ class Disney extends MaterialsBase else $this->anisotropic = $color; } + /** + * @param object $color 接收一个贴图对象或小数形式的色值,设置Disney材质的光泽反射强度 + */ public function setSheen($color) { if( is_object($color) ) @@ -191,6 +221,9 @@ class Disney extends MaterialsBase else $this->sheen = $color; } + /** + * @param object $color 接收一个贴图对象或小数形式的色值,设置Disney材质的光泽反射染色强度 + */ public function setSheentint($color) { if( is_object($color) ) @@ -204,6 +237,9 @@ class Disney extends MaterialsBase else $this->sheentint = $color; } + /** + * @param object $color 接收一个贴图对象或小数形式的色值,为Disney材质添加清漆涂层效果,并设置其强度 + */ public function setClearcoat($color) { if( is_object($color) ) @@ -217,6 +253,9 @@ class Disney extends MaterialsBase else $this->clearcoat = $color; } + /** + * @param object $color 接收一个贴图对象或小数形式的色值,设置Disney材质的清漆涂层效果的光泽度 + */ public function setClearcoatgloss($color) { if( is_object($color) ) @@ -230,32 +269,9 @@ class Disney extends MaterialsBase else $this->clearcoatgloss = $color; } - public function setTransparencyFront($color) - { - if( is_object($color) ) - { - if( $color->registerId != null ) $this->transparencyFront = $color->registerId; - else - { - throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); - } - } - else $this->transparencyFront = $color; - } - - public function setTransparencyBack($color) - { - if( is_object($color) ) - { - if( $color->registerId != null ) $this->transparencyBack = $color->registerId; - else - { - throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); - } - } - else $this->transparencyBack = $color; - } - + /** + * @param object $color 接收一个贴图对象或小数形式的色值,为Disney材质添加清漆涂层效果,并设置其强度 + */ public function setFilmamount($color) { if( is_object($color) ) @@ -269,6 +285,9 @@ class Disney extends MaterialsBase else $this->filmamount = $color; } + /** + * @param object $color 接收一个贴图对象或小数形式的色值,设置Disney清漆涂层厚度 + */ public function setFilmthickness($color) { if( is_object($color) ) { @@ -281,6 +300,9 @@ class Disney extends MaterialsBase else $this->filmthickness = $color; } + /** + * @param object $color 接收一个贴图对象或小数形式的色值,设置Disney材质薄膜层的菲列尔反射率 + */ public function setFilmior($color) { if( is_object($color) ) @@ -294,19 +316,6 @@ class Disney extends MaterialsBase else $this->filmior = $color; } - public function setBumptex($color) - { - if( is_object($color) ) - { - if( $color->registerId != null ) $this->bumptex = $color->registerId; - else - { - throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); - } - } - else $this->bumptex = $color; - } - } ?> diff --git a/src/scene/materials/Glass.php b/src/scene/materials/Glass.php index 6e15e86..dd972af 100644 --- a/src/scene/materials/Glass.php +++ b/src/scene/materials/Glass.php @@ -8,7 +8,7 @@ class Glass extends MaterialsBase { /** - * 普通的透明材质类型 + * 普通的透明材质类型,高光光泽度流程 */ const TYPE_GLASS = 'glass'; @@ -39,11 +39,14 @@ class Glass extends MaterialsBase public $filmthickness; /** - * @var float 薄膜折射率,一个0-1的小数,或是一个textures(贴图数组)中的某个键名,(默认:1.5),如果启用此参数,则当前材质被当作一个 + * @var float 薄膜菲列尔反射率,一个0-1的小数,或是一个textures(贴图数组)中的某个键名,(默认:1.5),如果启用此参数,则当前材质被当作一个 * 内部空心的薄膜材质 */ public $filmior; + /** + * @param array $config 接收一个数组,可以初始化当前实例化对象的各种属性 + */ public function __construct($config = []) { $this->type = self::TYPE_GLASS; @@ -51,6 +54,9 @@ class Glass extends MaterialsBase Base::__construct($config); } + /** + * @param object $color 接收一个贴图对象或小数形式的色值,为玻璃材质添加薄膜层效果,并设置其厚度 + */ public function setFilmthickness($color) { if( is_object($color) ) @@ -64,6 +70,9 @@ class Glass extends MaterialsBase else $this->filmthickness = $color; } + /** + * @param object $color 接收一个贴图对象或小数形式的色值,设置玻璃材质的薄膜层的菲列尔反射率 + */ public function setFilmior($color) { if( is_object($color) ) @@ -77,6 +86,9 @@ class Glass extends MaterialsBase else $this->filmior = $color; } + /** + * @param object $color 接收一个贴图对象或小数形式的色值,设置玻璃材质的透射颜色 + */ public function setTransmission($color) { if( is_object($color) ) @@ -90,6 +102,9 @@ class Glass extends MaterialsBase else $this->kt = $color; } + /** + * @param object $color 接收一个贴图对象或小数形式的色值,设置玻璃材质的反射颜色 + */ public function setRefraction($color) { if( is_object($color) ) @@ -103,6 +118,9 @@ class Glass extends MaterialsBase else $this->kr = $color; } + /** + * @param object $color 接收一个贴图对象或小数形式的色值,设置玻璃材质的内部折射率 + */ public function setInteriorIor($color) { if( is_object($color) ) @@ -116,6 +134,9 @@ class Glass extends MaterialsBase else $this->interiorior = $color; } + /** + * @param object $color 接收一个贴图对象或小数形式的色值,设置玻璃材质的色散强度 + */ public function setCauchyb($color) { if( is_object($color) ) diff --git a/src/scene/materials/GlassArch.php b/src/scene/materials/GlassArch.php index 70195e9..047ee10 100644 --- a/src/scene/materials/GlassArch.php +++ b/src/scene/materials/GlassArch.php @@ -8,7 +8,7 @@ class GlassArch extends MaterialsBase { /** - * 一种没色散属性的薄的透明材质类型,使用这种类型的材质,色散参必须要被禁用。用于薄薄的玻璃窗,折射不重 + * 一种没色散属性的薄的透明材质类型,高光光泽度流程,使用这种类型的材质,色散参必须要被禁用。用于薄薄的玻璃,折射不重 * 要的地方(在传输过程中跳过折射,传播alpha和阴影光线。如果不使用此选项,还可以将输出节点中的阴影颜色 * 设置为白色,从而实现相同的效果,同时保持相机光线的折射,如果玻璃板的边缘可见,效果会更好。) */ @@ -36,11 +36,14 @@ class GlassArch extends MaterialsBase public $filmthickness; /** - * @var float 薄膜折射率,一个0-1的小数,或是一个textures(贴图数组)中的某个键名,(默认:1.5),如果启用此参数,则当前材质被当作一个 + * @var float 薄膜菲列尔反射率,一个0-1的小数,或是一个textures(贴图数组)中的某个键名,(默认:1.5),如果启用此参数,则当前材质被当作一个 * 内部空心的薄膜材质 */ public $filmior; + /** + * @param array $config 接收一个数组,可以初始化当前实例化对象的各种属性 + */ public function __construct($config = []) { $this->type = self::TYPE_ARCHGLASS; @@ -48,6 +51,9 @@ class GlassArch extends MaterialsBase Base::__construct($config); } + /** + * @param object $color 接收一个贴图对象或小数形式的色值,为薄薄玻璃材质添加薄膜层效果,并设置其厚度 + */ public function setFilmthickness($color) { if( is_object($color) ) @@ -61,6 +67,9 @@ class GlassArch extends MaterialsBase else $this->filmthickness = $color; } + /** + * @param object $color 接收一个贴图对象或小数形式的色值,设置薄薄玻璃材质的薄膜层的菲列尔反射率 + */ public function setFilmior($color) { if( is_object($color) ) @@ -74,6 +83,9 @@ class GlassArch extends MaterialsBase else $this->filmior = $color; } + /** + * @param object $color 接收一个贴图对象或小数形式的色值,设置薄薄玻璃材质的透射颜色 + */ public function setTransmission($color) { if( is_object($color) ) @@ -87,6 +99,9 @@ class GlassArch extends MaterialsBase else $this->kt = $color; } + /** + * @param object $color 接收一个贴图对象或小数形式的色值,设置薄薄玻璃材质的反射颜色 + */ public function setRefraction($color) { if( is_object($color) ) @@ -100,6 +115,9 @@ class GlassArch extends MaterialsBase else $this->kr = $color; } + /** + * @param object $color 接收一个贴图对象或小数形式的色值,设置薄薄玻璃材质的内部折射率 + */ public function setInteriorIor($color) { if( is_object($color) ) diff --git a/src/scene/materials/GlassRough.php b/src/scene/materials/GlassRough.php index 6ae3f11..fa43fc7 100644 --- a/src/scene/materials/GlassRough.php +++ b/src/scene/materials/GlassRough.php @@ -8,7 +8,7 @@ class GlassRough extends MaterialsBase { /** - * 粗糙度玻离材质类型 + * 粗糙玻离材质类型,高光光泽度流程 */ const TYPE_ROUGHGLASS = 'roughglass'; @@ -44,11 +44,14 @@ class GlassRough extends MaterialsBase public $filmthickness; /** - * @var float 薄膜折射率,一个0-1的小数,或是一个textures(贴图数组)中的某个键名,(默认:1.5),如果启用此参数,则当前材质被当作一个 + * @var float 薄膜菲列尔反射率,一个0-1的小数,或是一个textures(贴图数组)中的某个键名,(默认:1.5),如果启用此参数,则当前材质被当作一个 * 内部空心的薄膜材质 */ public $filmior; + /** + * @param array $config 接收一个数组,可以初始化当前实例化对象的各种属性 + */ public function __construct($config = []) { $this->type = self::TYPE_ROUGHGLASS; @@ -56,6 +59,9 @@ class GlassRough extends MaterialsBase Base::__construct($config); } + /** + * @param object $color 接收一个贴图对象或小数形式的色值,设置粗糙玻璃材质的U向粗糙度 + */ public function setUroughness($color) { if( is_object($color) ) @@ -69,6 +75,9 @@ class GlassRough extends MaterialsBase else $this->uroughness = $color; } + /** + * @param object $color 接收一个贴图对象或小数形式的色值,设置粗糙玻璃材质的U向粗糙度 + */ public function setVroughness($color) { if( is_object($color) ) @@ -82,6 +91,9 @@ class GlassRough extends MaterialsBase else $this->vroughness = $color; } + /** + * @param object $color 接收一个贴图对象或小数形式的色值,为粗糙玻璃材质添加清漆涂层效果,并设置其厚度 + */ public function setFilmthickness($color) { if( is_object($color) ) @@ -95,6 +107,9 @@ class GlassRough extends MaterialsBase else $this->filmthickness = $color; } + /** + * @param object $color 接收一个贴图对象或小数形式的色值,设置粗糙玻璃材质的薄膜层的菲列尔反射率 + */ public function setFilmior($color) { if( is_object($color) ) @@ -108,6 +123,9 @@ class GlassRough extends MaterialsBase else $this->filmior = $color; } + /** + * @param object $color 接收一个贴图对象或小数形式的色值,设置粗糙玻璃材质的透射颜色 + */ public function setTransmission($color) { if( is_object($color) ) @@ -121,6 +139,9 @@ class GlassRough extends MaterialsBase else $this->kt = $color; } + /** + * @param object $color 接收一个贴图对象或小数形式的色值,设置粗糙玻璃材质的反射颜色 + */ public function setRefraction($color) { if( is_object($color) ) @@ -134,6 +155,9 @@ class GlassRough extends MaterialsBase else $this->kr = $color; } + /** + * @param object $color 接收一个贴图对象或小数形式的色值,设置粗糙玻璃材质的内部折射率 + */ public function setInteriorIor($color) { if( is_object($color) ) diff --git a/src/scene/materials/Glossy.php b/src/scene/materials/Glossy.php index a1612d3..0b559e4 100644 --- a/src/scene/materials/Glossy.php +++ b/src/scene/materials/Glossy.php @@ -7,6 +7,9 @@ use Blobt\Luxcore\scene\Scene; class Glossy extends MaterialsBase { + /** + * Glossy材质,这是一个高光光泽度流程的材质,但它将漫反射、高光反射、光泽反射、吸收的基本属性进行分离控制,是满足大多数以 高光光泽度流程 调节材质的一种通用材质。 + */ const TYPE_GLOSSY = 'glossy2'; /** @@ -40,7 +43,7 @@ class Glossy extends MaterialsBase public $vroughness = 0.05; /** - * @var float 菲列尔折射率,如果设置为1-2的一个小数或一个textures(贴图数组)中的某个键名,表示使用这个数值的 IOR 参数, + * @var float 菲列尔反射率,如果设置为1-2的一个小数或一个textures(贴图数组)中的某个键名,表示使用这个数值的 IOR 参数, * 如果设置为"0 0 0",表示不使用 IOR 参数 */ public $index = "0 0 0"; @@ -50,6 +53,9 @@ class Glossy extends MaterialsBase */ public $multibounce = self::CLOSE; + /** + * @param array $config 接收一个数组,可以初始化当前实例化对象的各种属性 + */ public function __construct($config = []) { $this->type = self::TYPE_GLOSSY; @@ -57,6 +63,9 @@ class Glossy extends MaterialsBase Base::__construct($config); } + /** + * @param object $color 接收一个贴图对象或小数形式的色值,设置Glossy材质的U向粗糙度 + */ public function setUroughness($color) { if( is_object($color) ) @@ -70,6 +79,9 @@ class Glossy extends MaterialsBase else $this->uroughness = $color; } + /** + * @param object $color 接收一个贴图对象或小数形式的色值,设置Glossy材质的U向粗糙度 + */ public function setVroughness($color) { if( is_object($color) ) @@ -83,6 +95,9 @@ class Glossy extends MaterialsBase else $this->vroughness = $color; } + /** + * @param object $color 接收一个贴图对象或小数形式的色值,设置Glossy材质的漫反射颜色 + */ public function setBaseColor($color) { if( is_object($color) ) @@ -96,6 +111,9 @@ class Glossy extends MaterialsBase else $this->kd = $color; } + /** + * @param object $color 接收一个贴图对象或小数形式的色值,设置Glossy材质的高光颜色及反射强度 + */ public function setSpecular($color) { if( is_object($color) ) @@ -109,6 +127,10 @@ class Glossy extends MaterialsBase else $this->ks = $color; } + /** + * @param object $color 接收一个贴图对象或小数形式的色值,设置Glossy材质的吸收颜色,这里的色值是对应UI界面色值的补色, + * 因为UI界面中的色值为了获得可见即可得直观的效果 + */ public function setAbsorption($color) { if( is_object($color) ) @@ -122,6 +144,9 @@ class Glossy extends MaterialsBase else $this->ka = $color; } + /** + * @param object $color 接收一个贴图对象或小数形式的色值,设置Glossy材质的吸收颜色的吸收深度 + */ public function setAbsorptionDepht($color) { if( is_object($color) ) @@ -135,6 +160,9 @@ class Glossy extends MaterialsBase else $this->d = $color; } + /** + * @param object $color 接收一个贴图对象或小数形式的色值,设置Glossy材质的菲涅尔反射率 + */ public function setIor($color) { if( is_object($color) ) @@ -148,16 +176,6 @@ class Glossy extends MaterialsBase else $this->index = $color; } - public function openMultiBounce() - { - $this->multibounce = self::OPEN; - } - - public function closeMultiBounce() - { - $this->multibounce = self::CLOSE; - } - } ?> diff --git a/src/scene/materials/GlossyCoating.php b/src/scene/materials/GlossyCoating.php index fd77acd..179cf5c 100644 --- a/src/scene/materials/GlossyCoating.php +++ b/src/scene/materials/GlossyCoating.php @@ -8,7 +8,8 @@ class GlossyCoating extends MaterialsBase { /** - * 使用此类材质不能设置不透明度 + * GlossyCoating材质,这是一个高光光泽度流程的材质,但它将漫反射、高光反射、光泽反射、吸收的基本属性进行分离控制, + * 是满足大多数以 高光光泽度流程 调节材质的一种通用材质。使用此类材质不能设置不透明度 */ const TYPE_GLOSSYCOATING = 'glossycoating'; @@ -43,7 +44,7 @@ class GlossyCoating extends MaterialsBase public $vroughness = 0.05; /** - * @var float 菲列尔折射率,如果设置为1-2的一个小数或一个textures(贴图数组)中的某个键名,表示使用这个数值的 IOR 参数, + * @var float 菲列尔反射率,如果设置为1-2的一个小数或一个textures(贴图数组)中的某个键名,表示使用这个数值的 IOR 参数, * 如果设置为"0 0 0",表示不使用 IOR 参数 */ public $index = "0 0 0"; @@ -53,6 +54,9 @@ class GlossyCoating extends MaterialsBase */ public $multibounce = self::CLOSE; + /** + * @param array $config 接收一个数组,可以初始化当前实例化对象的各种属性 + */ public function __construct($config = []) { $this->type = self::TYPE_GLOSSYCOATING; @@ -60,6 +64,9 @@ class GlossyCoating extends MaterialsBase Base::__construct($config); } + /** + * @param object $color 接收一个贴图对象或小数形式的色值,设置GlossyCoating材质的U向粗糙度 + */ public function setUroughness($color) { if( is_object($color) ) @@ -73,6 +80,9 @@ class GlossyCoating extends MaterialsBase else $this->uroughness = $color; } + /** + * @param object $color 接收一个贴图对象或小数形式的色值,设置GlossyCoating材质的U向粗糙度 + */ public function setVroughness($color) { if( is_object($color) ) @@ -86,6 +96,9 @@ class GlossyCoating extends MaterialsBase else $this->vroughness = $color; } + /** + * @param object $Material 接收一个材质对象,设置GlossyCoating材质的基会材质 + */ public function setBase($material) { if( is_object($material) ) @@ -99,6 +112,9 @@ class GlossyCoating extends MaterialsBase else $this->base = $material; } + /** + * @param object $color 接收一个贴图对象或小数形式的色值,设置GlossyCoating材质的高光颜色及反射强度 + */ public function setSpecular($color) { if( is_object($color) ) @@ -112,6 +128,10 @@ class GlossyCoating extends MaterialsBase else $this->ks = $color; } + /** + * @param object $color 接收一个贴图对象或小数形式的色值,设置GlossyCoating材质的吸收颜色,这里的色值是对应UI界面色值的补色, + * 因为UI界面中的色值为了获得可见即可得直观的效果 + */ public function setAbsorption($color) { if( is_object($color) ) @@ -125,6 +145,9 @@ class GlossyCoating extends MaterialsBase else $this->ka = $color; } + /** + * @param object $color 接收一个贴图对象或小数形式的色值,设置GlossyCoating材质的菲涅尔反射率 + */ public function setAbsorptionDepht($color) { if( is_object($color) ) @@ -138,6 +161,9 @@ class GlossyCoating extends MaterialsBase else $this->d = $color; } + /** + * @param object $color 接收一个贴图对象或小数形式的色值,设置GlossyCoating材质的菲涅尔反射率 + */ public function setIor($color) { if( is_object($color) ) @@ -151,16 +177,6 @@ class GlossyCoating extends MaterialsBase else $this->index = $color; } - public function openMultiBounce() - { - $this->multibounce = self::OPEN; - } - - public function closeMultiBounce() - { - $this->multibounce = self::CLOSE; - } - } ?> diff --git a/src/scene/materials/GlossyTranslucent.php b/src/scene/materials/GlossyTranslucent.php index 480f28a..c5f23d4 100644 --- a/src/scene/materials/GlossyTranslucent.php +++ b/src/scene/materials/GlossyTranslucent.php @@ -4,10 +4,14 @@ namespace Blobt\Luxcore\scene\materials; use Blobt\Luxcore\core\Base; use Blobt\Luxcore\scene\Scene; -class Glossy extends MaterialsBase +class GlossyTranslucent extends MaterialsBase { - const TYPE_GLOSSY = 'glossy'; + /** + * GlossyTranslucent材质,这是一个高光光泽度流程的半透明材质,但它将漫反射、高光反射、光泽反射、吸收的基本属性进行分离控制, + * 是满足大多数以 高光光泽度流程 调节材质的一种通用材质。使用此类材质不能设置不透明度 + */ + const TYPE_GLOSSYTRANSLUCENT = 'glossytranslucent'; /** * @var string 漫反射颜色,一个小数形式的RGB色值,或是一个textures(贴图数组)中的某个键名 @@ -45,7 +49,7 @@ class Glossy extends MaterialsBase public $vroughness = 0.05; /** - * @var float 菲列尔折射率,如果设置为1-2的一个小数或一个textures(贴图数组)中的某个键名,表示使用这个数值的 IOR 参数, + * @var float 菲列尔反射率,如果设置为1-2的一个小数或一个textures(贴图数组)中的某个键名,表示使用这个数值的 IOR 参数, * 如果设置为"0 0 0",表示不使用 IOR 参数 */ public $index = "0 0 0"; @@ -84,7 +88,7 @@ class Glossy extends MaterialsBase public $vroughness_bf = 0.05; /** - * @var float BF 菲列尔折射率,如果设置为1-2的一个小数或一个textures(贴图数组)中的某个键名,表示使用这个数值的 IOR 参数, + * @var float BF 菲列尔反射率,如果设置为1-2的一个小数或一个textures(贴图数组)中的某个键名,表示使用这个数值的 IOR 参数, * 如果设置为"0 0 0",表示不使用 IOR 参数 */ public $index_bf = "0 0 0"; @@ -94,14 +98,19 @@ class Glossy extends MaterialsBase */ public $multibounce_bf = self::CLOSE; - + /** + * @param array $config 接收一个数组,可以初始化当前实例化对象的各种属性 + */ public function __construct($config = []) { - $this->type = self::TYPE_GLOSSY; + $this->type = self::TYPE_GLOSSYTRANSLUCENT; $this->id = Scene::createID(); Base::__construct($config); } + /** + * @param object $color 接收一个贴图对象或小数形式的色值,设置GlossyTranslucent材质的U向粗糙度 + */ public function setUroughness($color) { if( is_object($color) ) @@ -115,6 +124,9 @@ class Glossy extends MaterialsBase else $this->uroughness = $color; } + /** + * @param object $color 接收一个贴图对象或小数形式的色值,设置GlossyTranslucent材质的U向粗糙度 + */ public function setVroughness($color) { if( is_object($color) ) @@ -127,7 +139,10 @@ class Glossy extends MaterialsBase } else $this->vroughness = $color; } - + + /** + * @param object $color 接收一个贴图对象或小数形式的色值,设置GlossyTranslucent材质的漫反射颜色 + */ public function setBaseColor($color) { if( is_object($color) ) @@ -141,6 +156,9 @@ class Glossy extends MaterialsBase else $this->kd = $color; } + /** + * @param object $color 接收一个贴图对象或小数形式的色值,设置GlossyTranslucent材质的高光颜色及反射强度 + */ public function setSpecular($color) { if( is_object($color) ) @@ -154,6 +172,9 @@ class Glossy extends MaterialsBase else $this->ks = $color; } + /** + * @param object $color 接收一个贴图对象或小数形式的色值,设置GlossyTranslucent材质的透射颜色 + */ public function setTransmission($color) { if( is_object($color) ) @@ -167,6 +188,10 @@ class Glossy extends MaterialsBase else $this->kt = $color; } + /** + * @param object $color 接收一个贴图对象或小数形式的色值,设置GlossyTranslucent材质的吸收颜色,这里的色值是对应UI界面色值的补色, + * 因为UI界面中的色值为了获得可见即可得直观的效果 + */ public function setAbsorption($color) { if( is_object($color) ) @@ -180,6 +205,9 @@ class Glossy extends MaterialsBase else $this->ka = $color; } + /** + * @param object $color 接收一个贴图对象或小数形式的色值,设置GlossyTranslucent材质的吸收颜色的吸收深度 + */ public function setAbsorptionDepht($color) { if( is_object($color) ) @@ -193,6 +221,9 @@ class Glossy extends MaterialsBase else $this->d = $color; } + /** + * @param object $color 接收一个贴图对象或小数形式的色值,设置GlossyTranslucent材质的菲涅尔反射率 + */ public function setIor($color) { if( is_object($color) ) @@ -206,20 +237,13 @@ class Glossy extends MaterialsBase else $this->index = $color; } - public function openMultiBounce() - { - $this->multibounce = self::OPEN; - } - - public function closeMultiBounce() - { - $this->multibounce = self::CLOSE; - } - + /** + * @param object $color 接收一个贴图对象或小数形式的色值,设置GlossyTranslucent材质的BF U向粗糙度 + */ public function setUroughness_BF($color) { if( is_object($color) ) @@ -233,6 +257,9 @@ class Glossy extends MaterialsBase else $this->uroughness_bf = $color; } + /** + * @param object $color 接收一个贴图对象或小数形式的色值,设置GlossyTranslucent材质的BF V向粗糙度 + */ public function setVroughness_BF($color) { if( is_object($color) ) @@ -246,6 +273,9 @@ class Glossy extends MaterialsBase else $this->vroughness_bf = $color; } + /** + * @param object $color 接收一个贴图对象或小数形式的色值,设置GlossyTranslucent材质的BF高光颜色及反射强度 + */ public function setSpecular_BF($color) { if( is_object($color) ) @@ -259,6 +289,10 @@ class Glossy extends MaterialsBase else $this->ks_bf = $color; } + /** + * @param object $color 接收一个贴图对象或小数形式的色值,设置GlossyTranslucent材质的BF吸收颜色,这里的色值是对应UI界面色值的补色, + * 因为UI界面中的色值为了获得可见即可得直观的效果 + */ public function setAbsorption_BF($color) { if( is_object($color) ) @@ -272,6 +306,9 @@ class Glossy extends MaterialsBase else $this->ka_bf = $color; } + /** + * @param object $color 接收一个贴图对象或小数形式的色值,设置GlossyTranslucent材质的BF吸收颜色的吸收深度 + */ public function setAbsorptionDepht_BF($color) { if( is_object($color) ) @@ -285,6 +322,9 @@ class Glossy extends MaterialsBase else $this->d_bf = $color; } + /** + * @param object $color 接收一个贴图对象或小数形式的色值,设置GlossyTranslucent材质的BF菲涅尔反射率 + */ public function setIor_BF($color) { if( is_object($color) ) @@ -298,16 +338,6 @@ class Glossy extends MaterialsBase else $this->index_bf = $color; } - public function openMultiBounce_BF() - { - $this->multibounce_bf = self::OPEN; - } - - public function closeMultiBounce_BF() - { - $this->multibounce_bf = self::CLOSE; - } - } ?> diff --git a/src/scene/materials/MaterialsBase.php b/src/scene/materials/MaterialsBase.php index 07ac3f5..adeecdb 100644 --- a/src/scene/materials/MaterialsBase.php +++ b/src/scene/materials/MaterialsBase.php @@ -104,7 +104,9 @@ class MaterialsBase extends BaseCfg - + /** + * @param object $color 接收一个贴图对象或小数形式的色值,设置材质的正面透明度 + */ public function setTransparencyFront($color) { if( is_object($color) ) @@ -118,6 +120,9 @@ class MaterialsBase extends BaseCfg else $this->transparencyFront = $color; } + /** + * @param object $color 接收一个贴图对象或小数形式的色值,设置材质的背面透明度 + */ public function setTransparencyBack($color) { if( is_object($color) ) @@ -131,6 +136,9 @@ class MaterialsBase extends BaseCfg else $this->transparencyBack = $color; } + /** + * @param object $color 接收一个贴图对象或小数形式的色值,设置材质的凹凸属性 + */ public function setBumptex($color) { if( is_object($color) ) @@ -144,6 +152,9 @@ class MaterialsBase extends BaseCfg else $this->bumptex = $color; } + /** + * @param object $color 接收一个贴图对象或小数形式的色值,设置材质的自发光属性,并初始化自发光属性的配置参数 + */ public function setEmission($color,Emission $emissionCfg = null,Visibility $visibility = null) { if( is_object($color) ) @@ -162,6 +173,9 @@ class MaterialsBase extends BaseCfg else $this->visibility = new Visibility(); } + /** + * @param object $color 接收一个贴图对象或小数形式的色值,设置材质的内部体积属性 + */ public function setVolumeInterior($volumeInterior) { if( is_object( $volumeInterior ) ) @@ -175,6 +189,9 @@ class MaterialsBase extends BaseCfg else $this->volumeInterior = $volumeInterior; } + /** + * @param object $color 接收一个贴图对象或小数形式的色值,设置材质的外部体积属性 + */ public function setVolumeExterior($volumeExterior) { if( is_object( $volumeExterior ) ) diff --git a/src/scene/materials/Matte.php b/src/scene/materials/Matte.php index e905adc..7105cd9 100644 --- a/src/scene/materials/Matte.php +++ b/src/scene/materials/Matte.php @@ -7,6 +7,9 @@ use Blobt\Luxcore\scene\Scene; class Matte extends MaterialsBase { + /** + * 磨砂材质,高光光泽度流程 + */ const TYPE_MATTE = 'matte'; /** @@ -14,6 +17,9 @@ class Matte extends MaterialsBase */ public $kd = "0.7 0.7 0.7"; + /** + * @param array $config 接收一个数组,可以初始化当前实例化对象的各种属性 + */ public function __construct($config = []) { $this->type = self::TYPE_MATTE; @@ -21,6 +27,9 @@ class Matte extends MaterialsBase Base::__construct($config); } + /** + * @param object $color 接收一个贴图对象或小数形式的色值,设置磨砂材质材质的漫反射颜色 + */ public function setBaseColor($color) { if( is_object($color) ) diff --git a/src/scene/materials/MatteRough.php b/src/scene/materials/MatteRough.php index e8eb8a9..050eeb4 100644 --- a/src/scene/materials/MatteRough.php +++ b/src/scene/materials/MatteRough.php @@ -7,6 +7,9 @@ use Blobt\Luxcore\scene\Scene; class MatteRough extends MaterialsBase { + /** + * 粗糙的磨砂材质,高光光泽度流程 + */ const TYPE_ROUGHMATTE = 'roughmatte'; /** @@ -19,6 +22,9 @@ class MatteRough extends MaterialsBase */ public $sigma = 0; + /** + * @param array $config 接收一个数组,可以初始化当前实例化对象的各种属性 + */ public function __construct($config = []) { $this->type = self::TYPE_ROUGHMATTE; @@ -26,6 +32,9 @@ class MatteRough extends MaterialsBase Base::__construct($config); } + /** + * @param object $color 接收一个贴图对象或小数形式的色值,设置粗糙磨砂材质材质的漫反射颜色 + */ public function setBaseColor($color) { if( is_object($color) ) @@ -39,6 +48,9 @@ class MatteRough extends MaterialsBase else $this->kd = $color; } + /** + * @param object $color 接收一个贴图对象或小数形式的色值,设置粗糙磨砂材质材质的西格玛 + */ public function setSigma($color) { if( is_object($color) ) diff --git a/src/scene/materials/MatteTranslucent.php b/src/scene/materials/MatteTranslucent.php index 32c1f50..432d7b8 100644 --- a/src/scene/materials/MatteTranslucent.php +++ b/src/scene/materials/MatteTranslucent.php @@ -7,6 +7,9 @@ use Blobt\Luxcore\scene\Scene; class Roughmatte extends MaterialsBase { + /** + * 半透明的磨砂材质,高光光泽度流程 + */ const TYPE_MATTETRANSLUCENT = 'mattetranslucent'; /** @@ -19,6 +22,9 @@ class Roughmatte extends MaterialsBase */ public $kt = "0.7 0.7 0.7"; + /** + * @param array $config 接收一个数组,可以初始化当前实例化对象的各种属性 + */ public function __construct($config = []) { $this->type = self::TYPE_MATTETRANSLUCENT; @@ -26,6 +32,9 @@ class Roughmatte extends MaterialsBase Base::__construct($config); } + /** + * @param object $color 接收一个贴图对象或小数形式的色值,设置半透明磨砂材质的反射颜色 + */ public function setRefraction($color) { if( is_object($color) ) @@ -39,6 +48,9 @@ class Roughmatte extends MaterialsBase else $this->kr = $color; } + /** + * @param object $color 接收一个贴图对象或小数形式的色值,设置半透明磨砂材质的透射颜色 + */ public function setTransmission($color) { if( is_object($color) ) diff --git a/src/scene/materials/Metal.php b/src/scene/materials/Metal.php index 35091e4..803b024 100644 --- a/src/scene/materials/Metal.php +++ b/src/scene/materials/Metal.php @@ -7,6 +7,9 @@ use Blobt\Luxcore\scene\Scene; class Metal extends MaterialsBase { + /** + * 金属度流程的金属材质 + */ const TYPE_METAL = 'matal2'; /** @@ -25,6 +28,9 @@ class Metal extends MaterialsBase */ public $vroughness = 0.05; + /** + * @param array $config 接收一个数组,可以初始化当前实例化对象的各种属性 + */ public function __construct($config = []) { $this->type = self::TYPE_METAL; @@ -32,6 +38,10 @@ class Metal extends MaterialsBase core\Base::__construct($config); } + /** + * @param object $color 接收一个贴图对象,设置金属材质的漫反射颜色,只能是“fresnelconst(预设的菲列尔参数)”、 + * “fresnelcolor(颜色的菲列尔)”两个类型的帖图。 + */ public function setFresnel($color) { if( is_object($color) ) @@ -46,6 +56,9 @@ class Metal extends MaterialsBase } + /** + * @param object $color 接收一个贴图对象或小数形式的色值,设置金属材质的U向粗糙度 + */ public function setUroughness($color) { if( is_object($color) ) @@ -59,6 +72,9 @@ class Metal extends MaterialsBase else $this->uroughness = $color; } + /** + * @param object $color 接收一个贴图对象或小数形式的色值,设置金属材质的V向粗糙度 + */ public function setVroughness($color) { if( is_object($color) ) diff --git a/src/scene/materials/Mirror.php b/src/scene/materials/Mirror.php index f3d8617..6fd9125 100644 --- a/src/scene/materials/Mirror.php +++ b/src/scene/materials/Mirror.php @@ -7,6 +7,9 @@ use Blobt\Luxcore\scene\Scene; class Mirror extends MaterialsBase { + /** + * 镜面材质,金属度 + */ const TYPE_MIRROR = 'mirror'; /** @@ -14,6 +17,9 @@ class Mirror extends MaterialsBase */ public $kr = "0.7 0.7 0.7"; + /** + * @param array $config 接收一个数组,可以初始化当前实例化对象的各种属性 + */ public function __construct($config = []) { $this->type = self::TYPE_MIRROR; @@ -21,6 +27,9 @@ class Mirror extends MaterialsBase Base::__construct($config); } + /** + * @param object $color 接收一个贴图对象或小数形式的色值,设置镜面材质的反射颜色 + */ public function setRefraction($color) { if( is_object($color) ) diff --git a/src/scene/materials/Mix.php b/src/scene/materials/Mix.php index 5dbb2f6..85ad04a 100644 --- a/src/scene/materials/Mix.php +++ b/src/scene/materials/Mix.php @@ -5,7 +5,10 @@ use Blobt\Luxcore\core; use Blobt\Luxcore\scene\Scene; class Mix extends MaterialsBase -{ +{ + /** + * 混合材质 + */ const TYPE_MIX = 'mix'; /** @@ -23,6 +26,9 @@ class Mix extends MaterialsBase */ public $amount = 0.5; + /** + * @param array $config 接收一个数组,可以初始化当前实例化对象的各种属性 + */ public function __construct($config = []) { $this->type = self::TYPE_MIX; @@ -30,6 +36,9 @@ class Mix extends MaterialsBase core\Base::__construct($config); } + /** + * @param object $Material 接收一个材质对象,设置混合材质的第一个材质通道 + */ public function setMaterial1($Material) { if( is_object( $Material ) ) @@ -43,6 +52,9 @@ class Mix extends MaterialsBase else $this->material1 = $Material; } + /** + * @param object $Material 接收一个材质对象,设置混合材质的第一个材质通道 + */ public function setMaterial2($Material) { if( is_object( $Material ) ) @@ -56,6 +68,9 @@ class Mix extends MaterialsBase else $this->material2 = $Material; } + /** + * @param object $color 接收一个贴图对象或小数形式的色值,设置混合材质的混合系数 + */ public function setAmount($color) { if( is_object($color) ) diff --git a/src/scene/materials/NullMaterial.php b/src/scene/materials/NullMaterial.php index fdf0e16..ca59f00 100644 --- a/src/scene/materials/NullMaterial.php +++ b/src/scene/materials/NullMaterial.php @@ -7,8 +7,14 @@ use Blobt\Luxcore\scene\Scene; class NullMaterial extends MaterialsBase { + /** + * 空的材质 + */ const TYPE_NULL = 'null'; + /** + * @param array $config 接收一个数组,可以初始化当前实例化对象的各种属性 + */ public function __construct($config = []) { $this->type = self::TYPE_NULL; diff --git a/src/scene/materials/TwoSided.php b/src/scene/materials/TwoSided.php new file mode 100644 index 0000000..0324afb --- /dev/null +++ b/src/scene/materials/TwoSided.php @@ -0,0 +1,69 @@ +type = self::TYPE_TWOSIDED; + $this->id = Scene::createID(); + core\Base::__construct($config); + } + + /** + * @param object $Material 接收一个材质对象,设置双面材质的正面材质通道 + */ + public function setMaterial1($Material) + { + if( is_object( $Material ) ) + { + if( $Material->registerId != null ) $this->frontmaterial = $Material->registerId; + else + { + throw new \Exception("You use an unregistered ".$Material->getInstanceClassName()." object for the current property"); + } + } + else $this->frontmaterial = $Material; + } + + /** + * @param object $Material 接收一个材质对象,设置双面材质的背面材质通道 + */ + public function setMaterial2($Material) + { + if( is_object( $Material ) ) + { + if( $Material->registerId != null ) $this->backmaterial = $Material->registerId; + else + { + throw new \Exception("You use an unregistered ".$Material->getInstanceClassName()." object for the current property"); + } + } + else $this->backmaterial = $Material; + } + +} + +?> diff --git a/src/scene/materials/Velvet.php b/src/scene/materials/Velvet.php index 308fa68..c43b5e9 100644 --- a/src/scene/materials/Velvet.php +++ b/src/scene/materials/Velvet.php @@ -6,7 +6,9 @@ use Blobt\Luxcore\scene\Scene; class Velvet extends MaterialsBase { - + /** + * 丝绒材质,,高光光泽度流程 + */ const TYPE_VELVET = 'velvet'; /** @@ -34,6 +36,9 @@ class Velvet extends MaterialsBase */ public $thickness = "0.1"; + /** + * @param array $config 接收一个数组,可以初始化当前实例化对象的各种属性 + */ public function __construct($config = []) { $this->type = self::TYPE_VELVET; @@ -41,6 +46,9 @@ class Velvet extends MaterialsBase Base::__construct($config); } + /** + * @param object $color 接收一个贴图对象或小数形式的色值,设置丝绒材质的漫反射颜色 + */ public function setBaseColor($color) { if( is_object($color) ) @@ -54,6 +62,9 @@ class Velvet extends MaterialsBase else $this->kd = $color; } + /** + * @param object $color 接收一个贴图对象或小数形式的色值,设置丝绒材质的P1属性 + */ public function setP1($color) { if( is_object($color) ) @@ -67,6 +78,9 @@ class Velvet extends MaterialsBase else $this->p1 = $color; } + /** + * @param object $color 接收一个贴图对象或小数形式的色值,设置丝绒材质的P2属性 + */ public function setP2($color) { if( is_object($color) ) @@ -80,6 +94,9 @@ class Velvet extends MaterialsBase else $this->p2 = $color; } + /** + * @param object $color 接收一个贴图对象或小数形式的色值,设置丝绒材质的P3属性 + */ public function setP3($color) { if( is_object($color) ) @@ -93,6 +110,9 @@ class Velvet extends MaterialsBase else $this->p3 = $color; } + /** + * @param object $color 接收一个贴图对象或小数形式的色值,设置丝绒材质的厚度 + */ public function setThickness($color) { if( is_object($color) ) diff --git a/src/scene/objects/Objects.php b/src/scene/objects/Objects.php index a6c1cec..e7f0525 100644 --- a/src/scene/objects/Objects.php +++ b/src/scene/objects/Objects.php @@ -38,12 +38,18 @@ class Objects extends BaseCfg */ public $appliedtransformation; + /** + * @param array $config 接收一个数组,可以初始化当前实例化对象的各种属性 + */ public function __construct($config = []) { $this->id = Scene::createID(); core\Base::__construct($config); } + /** + * @param object $Material 接收一个材质对象,为模型的材质属性添加一个材质 + */ public function setMaterial($material) { if( is_object( $material ) ) diff --git a/src/scene/texture/mapping/Triplanar.php b/src/scene/texture/mapping/Triplanar.php index c53bc2d..1a0868d 100644 --- a/src/scene/texture/mapping/Triplanar.php +++ b/src/scene/texture/mapping/Triplanar.php @@ -8,6 +8,9 @@ use Blobt\Luxcore\core\Base; class Triplanar extends TextureBase { + /** + * 三面(三轴向)纹理映射 + */ const TYPE_TRIPLANAR = 'triplanar'; /** diff --git a/src/scene/texture/map/Blend.php b/src/scene/texture/procedural/Blend.php similarity index 95% rename from src/scene/texture/map/Blend.php rename to src/scene/texture/procedural/Blend.php index 76f0aad..dc35ec1 100644 --- a/src/scene/texture/map/Blend.php +++ b/src/scene/texture/procedural/Blend.php @@ -1,6 +1,6 @@