Browse Source
修改了“print.php”、“Scene.php”、“Emission.php”、“MaterialsBase.php”、“Objects.php”五个类文件,新增两个材质类文件“Disney.php”和“Mix.php”
master
修改了“print.php”、“Scene.php”、“Emission.php”、“MaterialsBase.php”、“Objects.php”五个类文件,新增两个材质类文件“Disney.php”和“Mix.php”
master
yuanjiajia
3 years ago
7 changed files with 228 additions and 30 deletions
-
30examples/print.php
-
5src/scene/Scene.php
-
104src/scene/materials/Disney.php
-
41src/scene/materials/Emission.php
-
29src/scene/materials/MaterialsBase.php
-
39src/scene/materials/Mix.php
-
10src/scene/objects/Objects.php
@ -0,0 +1,104 @@ |
|||||
|
<?php |
||||
|
|
||||
|
namespace Blobt\Luxcore\scene\materials; |
||||
|
use Blobt\Luxcore\core\Base; |
||||
|
|
||||
|
class Disney extends MaterialsBase |
||||
|
{ |
||||
|
|
||||
|
/** |
||||
|
* @var string 漫反射颜色,一个小数形式的RGB色值,或是一个textures(贴图数组)中的某个键名 |
||||
|
*/ |
||||
|
public $basecolor = "0.7 0.7 0.7"; |
||||
|
|
||||
|
/** |
||||
|
* @var float 次表面参数,一个0-1的小数,或是一个textures(贴图数组)中的某个键名 |
||||
|
*/ |
||||
|
public $subsurface = 0; |
||||
|
|
||||
|
/** |
||||
|
* @var float 金属度,一个0-1的小数,或是一个textures(贴图数组)中的某个键名 |
||||
|
*/ |
||||
|
public $metallic = 0; |
||||
|
|
||||
|
/** |
||||
|
* @var float 高光反射强度,一个0-1的小数,或是一个textures(贴图数组)中的某个键名 |
||||
|
*/ |
||||
|
public $specular = 0.5; |
||||
|
|
||||
|
/** |
||||
|
* @var float 高光染色,一个0-1的小数,或是一个textures(贴图数组)中的某个键名 |
||||
|
*/ |
||||
|
public $speculartint = 0; |
||||
|
|
||||
|
/** |
||||
|
* @var float 粗糙度,一个0-1的小数,或是一个textures(贴图数组)中的某个键名 |
||||
|
*/ |
||||
|
public $roughness = 0.2; |
||||
|
|
||||
|
/** |
||||
|
* @var float 各向异性反身,一个0-1的小数,或是一个textures(贴图数组)中的某个键名 |
||||
|
*/ |
||||
|
public $anisotropic = 0; |
||||
|
|
||||
|
/** |
||||
|
* @var float 光泽反射强度,一个0-1的小数,或是一个textures(贴图数组)中的某个键名 |
||||
|
*/ |
||||
|
public $sheen = 0; |
||||
|
|
||||
|
/** |
||||
|
* @var float 光泽反射染色,一个0-1的小数,或是一个textures(贴图数组)中的某个键名 |
||||
|
*/ |
||||
|
public $sheentint = 0; |
||||
|
|
||||
|
/** |
||||
|
* @var float 清漆,一个0-1的小数,或是一个textures(贴图数组)中的某个键名 |
||||
|
*/ |
||||
|
public $clearcoat = 0; |
||||
|
|
||||
|
/** |
||||
|
* @var float 透明涂层光泽,一个0-1的小数,或是一个textures(贴图数组)中的某个键名 |
||||
|
*/ |
||||
|
public $clearcoatgloss = 1; |
||||
|
|
||||
|
/** |
||||
|
* @var float 前向不透明度,一个0-1的小数,或是一个textures(贴图数组)中的某个键名 |
||||
|
*/ |
||||
|
public $transparencyFront = 1; |
||||
|
|
||||
|
/** |
||||
|
* @var float 后向不透明度,一个0-1的小数,或是一个textures(贴图数组)中的某个键名 |
||||
|
*/ |
||||
|
public $transparencyBack = 1; |
||||
|
|
||||
|
/** |
||||
|
* @var float 薄膜数量,一个0-1的小数,1表示一层,最多一层,或是一个textures(贴图数组)中的某个键名(默认:1) |
||||
|
*/ |
||||
|
public $filmamount; |
||||
|
|
||||
|
/** |
||||
|
* @var float 薄膜厚度,一个大于等于0的小数,或是一个textures(贴图数组)中的某个键名(默认:300) |
||||
|
*/ |
||||
|
public $filmthickness; |
||||
|
|
||||
|
/** |
||||
|
* @var float 薄膜折射率,一个0-1的小数,或是一个textures(贴图数组)中的某个键名,(默认:1.5) |
||||
|
*/ |
||||
|
public $filmior; |
||||
|
|
||||
|
/** |
||||
|
* @var key 是一个textures(贴图数组)中的某个键名 |
||||
|
*/ |
||||
|
public $bumptex; |
||||
|
|
||||
|
public function __construct($config = []) |
||||
|
{ |
||||
|
$this->type = 'disney'; |
||||
|
$this->emissionCfg = new Emission($config); |
||||
|
$this->visibility = new Visibility($config); |
||||
|
Base::__construct($config); |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
||||
|
?>
|
@ -0,0 +1,39 @@ |
|||||
|
<?php |
||||
|
|
||||
|
namespace Blobt\Luxcore\scene\materials; |
||||
|
use Blobt\Luxcore\core\Base; |
||||
|
|
||||
|
class Mix extends MaterialsBase |
||||
|
{ |
||||
|
|
||||
|
/** |
||||
|
* @var string 材质1,(材质数组的某个键名) |
||||
|
*/ |
||||
|
public $material1; |
||||
|
|
||||
|
/** |
||||
|
* @var string 材质2,(材质数组的某个键名) |
||||
|
*/ |
||||
|
public $material2; |
||||
|
|
||||
|
/** |
||||
|
* @var float 混合系数,一个0-1的小数,或是一个textures(贴图数组)中的某个键名 |
||||
|
*/ |
||||
|
public $amount = 0.5; |
||||
|
|
||||
|
/** |
||||
|
* @var key 是一个textures(贴图数组)中的某个键名 |
||||
|
*/ |
||||
|
public $bumptex; |
||||
|
|
||||
|
public function __construct($config = []) |
||||
|
{ |
||||
|
$this->type = 'mix'; |
||||
|
$this->emissionCfg = new Emission($config); |
||||
|
$this->visibility = new Visibility($config); |
||||
|
Base::__construct($config); |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
||||
|
?>
|
Write
Preview
Loading…
Cancel
Save
Reference in new issue