From cfacfb7462e0e1f3cc9afcd55e89df451abb7dad Mon Sep 17 00:00:00 2001 From: yuanjiajia <1139393632@qq.com> Date: Fri, 11 Mar 2022 19:42:58 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9ImagMap=E3=80=81Brick?= =?UTF-8?q?=E7=B1=BB=E6=96=87=E4=BB=B6=E6=B3=A8=E9=87=8A=EF=BC=8C=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E4=B8=80=E4=B8=AA=E7=BA=BF=E6=A1=86=E8=B4=B4=E5=9B=BE?= =?UTF-8?q?=E7=B1=BB=E6=96=87=E4=BB=B6=EF=BC=8C=E6=96=B0=E5=A2=9E=E4=B8=80?= =?UTF-8?q?=E4=B8=AA=20Fbm(=E7=9F=B3=E6=9D=90=E7=BA=B9=E7=90=86)=E7=B1=BB?= =?UTF-8?q?=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/scene/texture/procedural/Brick.php | 4 +- src/scene/texture/procedural/Fbm.php | 43 +++++++++++++ src/scene/texture/procedural/ImageMap.php | 18 +++--- src/scene/texture/procedural/Wireframe.php | 71 ---------------------- 4 files changed, 54 insertions(+), 82 deletions(-) create mode 100644 src/scene/texture/procedural/Fbm.php delete mode 100644 src/scene/texture/procedural/Wireframe.php diff --git a/src/scene/texture/procedural/Brick.php b/src/scene/texture/procedural/Brick.php index f4167a7..7aeee33 100644 --- a/src/scene/texture/procedural/Brick.php +++ b/src/scene/texture/procedural/Brick.php @@ -66,12 +66,12 @@ class Brick extends TextureBase public $mortarsize = 0.01; /** - * @var float 砖块互切(错位)百分比,(取值:0-1的小数) + * @var float TODO:砖块互切(错位)百分比,(取值:0-1的小数),此参数在UI界面中渲染正常的,但在控制台下失效。 */ public $brickrun = 0.75; /** - * @var object 调制偏置,(取值:-1至1的小数),当值越接近-1时,以$bricktex色的砖块就越多,反之接近1时,以 + * @var float 调制偏置,(取值:-1至1的小数),当值越接近-1时,以$bricktex色的砖块就越多,反之接近1时,以 * $mortartex色的砖块就越多。 */ public $brickmodbias = 0; diff --git a/src/scene/texture/procedural/Fbm.php b/src/scene/texture/procedural/Fbm.php new file mode 100644 index 0000000..e7bb950 --- /dev/null +++ b/src/scene/texture/procedural/Fbm.php @@ -0,0 +1,43 @@ +mapping = $mapping; + else $this->mapping = new Mapping(); + $this->type = self::TYPE_FBM; + $this->id = Scene::createID(); + Base::__construct($config); + } + +} + +?> diff --git a/src/scene/texture/procedural/ImageMap.php b/src/scene/texture/procedural/ImageMap.php index 8733eaf..32d6797 100644 --- a/src/scene/texture/procedural/ImageMap.php +++ b/src/scene/texture/procedural/ImageMap.php @@ -10,15 +10,14 @@ class ImageMap extends TextureBase { /** - * 加载外部图像文件的程序纹里 + * 加载外部图像文件的程序纹里, */ const TYPE_IMAGEMAP = 'imagemap'; /** - * @var string 光域网文件名及路径,如果为空,则表示不使用光域网 + * @var string 一个图像文件的文件名及所在路径组成的字符串 */ public $file; - /** * @var string 亮度增益,当发光强度单位是 artistic 类型时,或是 坎德拉类型且坎德拉参数下勾选为(每平方米时),可以设置此参数,分别 @@ -29,22 +28,23 @@ class ImageMap extends TextureBase /** * @var float 校正光域网文件的gamma值,(固定取值:1) */ - public $gamma; + public $gamma = 2.2; /** * @var bool 是否随机重复 */ public $randomizedtilingEnable = self::CLOSE; - - /** - * @var object 铺贴参数,一个Mapping类对象 - */ - public $mapping; /** * @var string 输出图片储存方式 */ public $storage = 'byte'; + + + /** + * @var object 铺贴参数,一个Mapping类对象 + */ + public $mapping; /** * @param object $mapping 如需自定义铺贴参数,必须传入一个 Mapping类对象,否则使用一个默认的铺贴参数 diff --git a/src/scene/texture/procedural/Wireframe.php b/src/scene/texture/procedural/Wireframe.php deleted file mode 100644 index 6bed3c9..0000000 --- a/src/scene/texture/procedural/Wireframe.php +++ /dev/null @@ -1,71 +0,0 @@ -type = self::TYPE_WIREFRAME; - $this->id = Scene::createID(); - Base::__construct($config); - } - - /** - * @param object $color 接收一个贴图对象或小数形式的色值,设置线框纹理的线框颜色 - */ - public function setBricktex($color) - { - if( is_object($color) ) - { - if( $color->registerId != null ) $this->bricktex = $color->registerId; - else - { - throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); - } - } - else $this->bricktex = $color; - } - - /** - * @param object $color 接收一个贴图对象或小数形式的色值,设置线框纹理的内部面颜色 - */ - public function setBrickmodtex($color) - { - if( is_object($color) ) - { - if( $color->registerId != null ) $this->brickmodtex = $color->registerId; - else - { - throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property"); - } - } - else $this->brickmodtex = $color; - } - -} - -?>