Browse Source

修改了“print.php”、“Disney.php”两个类文件,新增了“Glass.php”、“Glossy.php”、“Metal.php”、“NullMaterial.php”、“Roughmatte.php”五个材质相关的类文件

master
yuanjiajia 3 years ago
parent
commit
26646cf248
  1. 3
      examples/print.php
  2. 2
      src/scene/materials/Disney.php
  3. 89
      src/scene/materials/Glass.php
  4. 75
      src/scene/materials/Glossy.php
  5. 50
      src/scene/materials/Metal.php
  6. 34
      src/scene/materials/NullMaterial.php
  7. 44
      src/scene/materials/Roughmatte.php

3
examples/print.php

@ -76,7 +76,8 @@ $scene->objects[0]->appliedtransformation = '1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1';
$scene->materials[8] = new materials\Disney(); //在场景中创建一个编号为8的 Disney材质,
$scene->materials[8] = new materials\Metal(); //在场景中创建一个编号为8的 Metal材质,
$scene->materials[8]->fresnel = "2517393611944Fresnel"; //指定金属材质菲列尔参数为一个颜色类型的贴图
$scene->objects[1] = new Objects(); //在场景中创建一个编号为1的模型,
$scene->objects[1]->material = 8; //为模型指定编号为8的材质

2
src/scene/materials/Disney.php

@ -37,7 +37,7 @@ class Disney extends MaterialsBase
public $roughness = 0.2;
/**
* @var float 各向异性反,一个0-1的小数,或是一个textures(贴图数组)中的某个键名
* @var float 各向异性反,一个0-1的小数,或是一个textures(贴图数组)中的某个键名
*/
public $anisotropic = 0;

89
src/scene/materials/Glass.php

@ -0,0 +1,89 @@
<?php
namespace Blobt\Luxcore\scene\materials;
use Blobt\Luxcore\core\Base;
class Glass extends MaterialsBase
{
/**
* 一种没色散属性的薄的透明材质类型,使用这种类型的材质,色散参必须要被禁用。用于薄薄的玻璃窗,折射不重
* 要的地方(在传输过程中跳过折射,传播alpha和阴影光线。如果不使用此选项,还可以将输出节点中的阴影颜色
* 设置为白色,从而实现相同的效果,同时保持相机光线的折射,如果玻璃板的边缘可见,效果会更好。)
*/
const TYPE_ARCHGLASS = 'archglass';
/**
* 普通的透明材质类型
*/
const TYPE_GLASS = 'glass';
/**
* @var string 透射颜色,一个小数形式的RGB色值,或是一个textures(贴图数组)中的某个键名
*/
public $kt = "1 1 1";
/**
* @var string 反射颜色,一个小数形式的RGB色值,或是一个textures(贴图数组)中的某个键名
*/
public $kr = "1 1 1";
/**
* @var float 菲列尔折射率,一个1-2的小数或一个textures(贴图数组)中的某个键名,
*/
public $interiorior = 1.5;
/**
* @var float 色散,一个0-0.01342的小数,或是一个textures(贴图数组)中的某个键名,如果设置为0,则不使用此参数,也不需要输出此字符串
* 当此玻下材质被设置为 archglass类型时,此参数必须禁用
*/
public $cauchyb;
/**
* @var float U向粗糙度,一个0-0.8的小数,或是一个textures(贴图数组)中的某个键名
*/
public $uroughness;
/**
* @var float V向粗糙度,一个0-0.8的小数,或是一个textures(贴图数组)中的某个键名
*/
public $vroughness;
/**
* @var float 薄膜厚度,一个大于等于0的小数,或是一个textures(贴图数组)中的某个键名(默认:300),如果启用此参数,则当前材质被当作一个
* 内部空心的薄膜材质
*/
public $filmthickness;
/**
* @var float 薄膜折射率,一个0-1的小数,或是一个textures(贴图数组)中的某个键名,(默认:1.5),如果启用此参数,则当前材质被当作一个
* 内部空心的薄膜材质
*/
public $filmior;
/**
* @var float 前向不透明度,一个0-1的小数,或是一个textures(贴图数组)中的某个键名
*/
public $transparencyFront = 1;
/**
* @var float 后向不透明度,一个0-1的小数,或是一个textures(贴图数组)中的某个键名
*/
public $transparencyBack = 1;
/**
* @var key 是一个textures(贴图数组)中的某个键名
*/
public $bumptex;
public function __construct($config = [])
{
$this->type = self::TYPE_GLASS;
$this->emissionCfg = new Emission($config);
$this->visibility = new Visibility($config);
Base::__construct($config);
}
}
?>

75
src/scene/materials/Glossy.php

@ -0,0 +1,75 @@
<?php
namespace Blobt\Luxcore\scene\materials;
use Blobt\Luxcore\core\Base;
class Glossy extends MaterialsBase
{
/**
* @var string 漫反射颜色,一个小数形式的RGB色值,或是一个textures(贴图数组)中的某个键名
*/
public $kd = "0.7 0.7 0.7";
/**
* @var string 高光反射颜色,如果设置使用了 IOR 参数,此出只能固定为"1 1 1",否则是一个小数形式的RGB色值,或是一个textures(贴图数组)中的某个键名;
*/
public $ks = "0.5 0.5 0.5";
/**
* @var string 吸收颜色,一个小数形式的RGB色值,或是一个textures(贴图数组)中的某个键名
*/
public $ka = "0 0 0";
/**
* @var float 吸收颜色深度,一个大于等于0的小数,或是一个textures(贴图数组)中的某个键名
*/
public $d = 0;
/**
* @var float U向粗糙度,一个0-0.8的小数,或是一个textures(贴图数组)中的某个键名
*/
public $uroughness = 0.05;
/**
* @var float V向粗糙度,一个0-0.8的小数,或是一个textures(贴图数组)中的某个键名
*/
public $vroughness = 0.05;
/**
* @var float 菲列尔折射率,如果设置为1-2的一个小数或一个textures(贴图数组)中的某个键名,表示使用这个数值的 IOR 参数,
* 如果设置为"0 0 0",表示不使用 IOR 参数
*/
public $index = "0 0 0";
/**
* @var bool TODO:否是使用多弹射,具体作用尚未明确,(默认取值:false)
*/
public $multibounce = false;
/**
* @var float 前向不透明度,一个0-1的小数,或是一个textures(贴图数组)中的某个键名
*/
public $transparencyFront = 1;
/**
* @var float 后向不透明度,一个0-1的小数,或是一个textures(贴图数组)中的某个键名
*/
public $transparencyBack = 1;
/**
* @var key 是一个textures(贴图数组)中的某个键名
*/
public $bumptex;
public function __construct($config = [])
{
$this->type = 'glossy2';
$this->emissionCfg = new Emission($config);
$this->visibility = new Visibility($config);
Base::__construct($config);
}
}
?>

50
src/scene/materials/Metal.php

@ -0,0 +1,50 @@
<?php
namespace Blobt\Luxcore\scene\materials;
use Blobt\Luxcore\core\Base;
class Metal extends MaterialsBase
{
/**
* @var string 菲列尔参数,一个textures(贴图数组)中的某个键名,只能是“fresnelconst(预设的菲列尔参数)”、
* “fresnelcolor(颜色的菲列尔)”两个类型的帖图。
*/
public $fresnel;
/**
* @var float U向粗糙度,一个0-0.8的小数,或是一个textures(贴图数组)中的某个键名
*/
public $uroughness = 0.05;
/**
* @var float V向粗糙度,一个0-0.8的小数,或是一个textures(贴图数组)中的某个键名
*/
public $vroughness = 0.05;
/**
* @var float 前向不透明度,一个0-1的小数,或是一个textures(贴图数组)中的某个键名
*/
public $transparencyFront = 1;
/**
* @var float 后向不透明度,一个0-1的小数,或是一个textures(贴图数组)中的某个键名
*/
public $transparencyBack = 1;
/**
* @var key 是一个textures(贴图数组)中的某个键名
*/
public $bumptex;
public function __construct($config = [])
{
$this->type = 'metal2';
$this->emissionCfg = new Emission($config);
$this->visibility = new Visibility($config);
Base::__construct($config);
}
}
?>

34
src/scene/materials/NullMaterial.php

@ -0,0 +1,34 @@
<?php
namespace Blobt\Luxcore\scene\materials;
use Blobt\Luxcore\core\Base;
class NullMaterial extends MaterialsBase
{
/**
* @var float 前向不透明度,一个0-1的小数,或是一个textures(贴图数组)中的某个键名
*/
public $transparencyFront = 1;
/**
* @var float 后向不透明度,一个0-1的小数,或是一个textures(贴图数组)中的某个键名
*/
public $transparencyBack = 1;
/**
* @var key 是一个textures(贴图数组)中的某个键名
*/
public $bumptex;
public function __construct($config = [])
{
$this->type = 'null';
$this->emissionCfg = new Emission($config);
$this->visibility = new Visibility($config);
Base::__construct($config);
}
}
?>

44
src/scene/materials/Roughmatte.php

@ -0,0 +1,44 @@
<?php
namespace Blobt\Luxcore\scene\materials;
use Blobt\Luxcore\core\Base;
class Roughmatte extends MaterialsBase
{
/**
* @var string 漫反射颜色,一个小数形式的RGB色值,或是一个textures(贴图数组)中的某个键名
*/
public $kd = "0.7 0.7 0.7";
/**
* @var float TODO:西格玛,具体作用尚未明确,(取值:0-45的不数)
*/
public $sigma = 0;
/**
* @var float 前向不透明度,一个0-1的小数,或是一个textures(贴图数组)中的某个键名
*/
public $transparencyFront = 1;
/**
* @var float 后向不透明度,一个0-1的小数,或是一个textures(贴图数组)中的某个键名
*/
public $transparencyBack = 1;
/**
* @var key 是一个textures(贴图数组)中的某个键名
*/
public $bumptex;
public function __construct($config = [])
{
$this->type = 'roughmatte';
$this->emissionCfg = new Emission($config);
$this->visibility = new Visibility($config);
Base::__construct($config);
}
}
?>
Loading…
Cancel
Save