From e779de1128f61bcfc6ad6635f9b96d3af1df7c52 Mon Sep 17 00:00:00 2001 From: yuanjiajia <1139393632@qq.com> Date: Sun, 13 Mar 2022 19:11:33 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E3=E4=B8=AA=E7=A8=8B=E5=BA=8F?= =?UTF-8?q?=E7=BA=B9=E7=90=86=E7=B1=BB=E6=96=87=E4=BB=B6=EF=BC=8C=E5=8F=A6?= =?UTF-8?q?=E6=9C=89=E4=B8=A4=E4=B8=AA=E7=A8=8B=E5=BA=8F=E7=BA=B9=E7=90=86?= =?UTF-8?q?=E7=B1=BB=E6=96=87=E4=BB=B6=E4=BF=AE=E6=94=B9=E4=BA=86=E9=83=A8?= =?UTF-8?q?=E5=88=86=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/scene/texture/procedural/Fbm.php | 2 +- src/scene/texture/procedural/Fresnelcolor.php | 42 ++++++++++++++ src/scene/texture/procedural/Fresnelconst.php | 55 +++++++++++++++++++ src/scene/texture/procedural/Marble.php | 6 +- src/scene/texture/procedural/Wrinkled.php | 43 +++++++++++++++ 5 files changed, 144 insertions(+), 4 deletions(-) create mode 100644 src/scene/texture/procedural/Fresnelcolor.php create mode 100644 src/scene/texture/procedural/Fresnelconst.php create mode 100644 src/scene/texture/procedural/Wrinkled.php diff --git a/src/scene/texture/procedural/Fbm.php b/src/scene/texture/procedural/Fbm.php index 0ee865a..15fe7df 100644 --- a/src/scene/texture/procedural/Fbm.php +++ b/src/scene/texture/procedural/Fbm.php @@ -10,7 +10,7 @@ class Fbm extends TextureBase { /** - * 分数布朗运动的程序纹理,可以生成类似大理石、花岗岩等石材纹理效果 + * 分数布朗运动的程序纹理,可以生成类似白色云团、及类似白色云团纹理的大理石纹效果 */ const TYPE_FBM = 'fbm'; diff --git a/src/scene/texture/procedural/Fresnelcolor.php b/src/scene/texture/procedural/Fresnelcolor.php new file mode 100644 index 0000000..af65626 --- /dev/null +++ b/src/scene/texture/procedural/Fresnelcolor.php @@ -0,0 +1,42 @@ +type = self::TYPE_FRESNELCOLOR; + $this->id = Scene::createID(); + Base::__construct($config); + } + + /** + * @param object $color 接收一个贴图对象或小数形式的色值,设置反射颜色 + */ + public function setRefraction($color) + { + $this->kr = Scene::testAbnormal($color); + } + +} + +?> diff --git a/src/scene/texture/procedural/Fresnelconst.php b/src/scene/texture/procedural/Fresnelconst.php new file mode 100644 index 0000000..c15c26c --- /dev/null +++ b/src/scene/texture/procedural/Fresnelconst.php @@ -0,0 +1,55 @@ +type = self::TYPE_FRESNELCONST; + $this->id = Scene::createID(); + Base::__construct($config); + } + + /** + * @param object $color 接收一个贴图对象或小数形式的色值,设置反射属性 n + */ + public function setRefractionN($color) + { + $this->n = Scene::testAbnormal($color); + } + + /** + * @param object $color 接收一个贴图对象或小数形式的色值,设置反射属性 k + */ + public function setRefractionK($color) + { + $this->k = Scene::testAbnormal($color); + } + +} + +?> diff --git a/src/scene/texture/procedural/Marble.php b/src/scene/texture/procedural/Marble.php index 018cd3a..25d7d35 100644 --- a/src/scene/texture/procedural/Marble.php +++ b/src/scene/texture/procedural/Marble.php @@ -10,18 +10,18 @@ class Marble extends TextureBase { /** - * 大理石模拟的程序纹理,以分数布朗运动生成类似大理石纹理 + * 大理石模拟的程序纹理,以分数布朗运动生成类似大理石条形纹理 */ const TYPE_MARBLE = 'marble'; /** - * @var integer 花纹随机分布 在单位面积内 的数量比率,越小值,单位面积内分布的花纹块越少(也意味着每个花纹块的面积越大), + * @var integer 花纹条随机分布 在单位面积内 的数量比率,越小值,单位面积内分布的花纹条越少(也意味着每个花纹条的面积越大), * 同时 roughness参数对结果的影响力越小,反之亦然,(取值1-29的整数) */ public $octaves = "8"; /** - * @var float 粗糙度,控制每个花纹块边缘向邻近花纹块过渡的平滑度,值越小,越平滑,同时 octaves参数对结果的影响力越小,反之亦然,(0-1的小数) + * @var float 粗糙度,控制每个花纹条边缘向邻近花纹块过渡的平滑度,值越小,越平滑,同时 octaves参数对结果的影响力越小,反之亦然,(0-1的小数) */ public $roughness = 0.5; diff --git a/src/scene/texture/procedural/Wrinkled.php b/src/scene/texture/procedural/Wrinkled.php new file mode 100644 index 0000000..d009c5b --- /dev/null +++ b/src/scene/texture/procedural/Wrinkled.php @@ -0,0 +1,43 @@ +mapping = $mapping; + else $this->mapping = new Mapping(); + $this->type = self::TYPE_WRINKLED; + $this->id = Scene::createID(); + Base::__construct($config); + } + +} + +?>