diff --git a/examples/print.php b/examples/print.php index f1ba359..b83710c 100644 --- a/examples/print.php +++ b/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的材质 diff --git a/src/scene/materials/Disney.php b/src/scene/materials/Disney.php index 82ff442..5ea1e73 100644 --- a/src/scene/materials/Disney.php +++ b/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; diff --git a/src/scene/materials/Glass.php b/src/scene/materials/Glass.php new file mode 100644 index 0000000..f14da6c --- /dev/null +++ b/src/scene/materials/Glass.php @@ -0,0 +1,89 @@ +type = self::TYPE_GLASS; + $this->emissionCfg = new Emission($config); + $this->visibility = new Visibility($config); + Base::__construct($config); + } + +} + +?> diff --git a/src/scene/materials/Glossy.php b/src/scene/materials/Glossy.php new file mode 100644 index 0000000..c738dc2 --- /dev/null +++ b/src/scene/materials/Glossy.php @@ -0,0 +1,75 @@ +type = 'glossy2'; + $this->emissionCfg = new Emission($config); + $this->visibility = new Visibility($config); + Base::__construct($config); + } + +} + +?> diff --git a/src/scene/materials/Metal.php b/src/scene/materials/Metal.php new file mode 100644 index 0000000..5df183a --- /dev/null +++ b/src/scene/materials/Metal.php @@ -0,0 +1,50 @@ +type = 'metal2'; + $this->emissionCfg = new Emission($config); + $this->visibility = new Visibility($config); + Base::__construct($config); + } + +} + +?> diff --git a/src/scene/materials/NullMaterial.php b/src/scene/materials/NullMaterial.php new file mode 100644 index 0000000..028ab0f --- /dev/null +++ b/src/scene/materials/NullMaterial.php @@ -0,0 +1,34 @@ +type = 'null'; + $this->emissionCfg = new Emission($config); + $this->visibility = new Visibility($config); + Base::__construct($config); + } + +} + +?> diff --git a/src/scene/materials/Roughmatte.php b/src/scene/materials/Roughmatte.php new file mode 100644 index 0000000..0ff327f --- /dev/null +++ b/src/scene/materials/Roughmatte.php @@ -0,0 +1,44 @@ +type = 'roughmatte'; + $this->emissionCfg = new Emission($config); + $this->visibility = new Visibility($config); + Base::__construct($config); + } + +} + +?>