From cef3ac5f2ba0378a67ac651737244a52e02aec4c Mon Sep 17 00:00:00 2001 From: yuanjiajia <1139393632@qq.com> Date: Wed, 16 Mar 2022 17:45:33 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E6=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=E4=B8=80?= =?UTF-8?q?=E4=B8=AA=E7=BA=B9=E7=90=86=E5=8F=98=E5=BD=A2=E7=B1=BB=E6=96=87?= =?UTF-8?q?=E4=BB=B6=EF=BC=8C=E4=B8=89=E4=B8=AA=E7=BA=B9=E7=90=86=E8=B0=83?= =?UTF-8?q?=E8=89=B2=E7=B1=BB=E6=96=87=E4=BB=B6=E3=80=81=E4=B8=A4=E4=B8=AA?= =?UTF-8?q?value(=E5=80=BC)=E7=B1=BB=E6=96=87=E4=BB=B6=EF=BC=8CNormalMap.p?= =?UTF-8?q?hp=E6=96=87=E4=BB=B6=E5=88=A0=E9=99=A4=E4=BA=86=E5=A4=9A?= =?UTF-8?q?=E4=BD=99=E7=9A=84use=20=E8=AF=AD=E5=8F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/scene/texture/deformation/Distort.php | 61 ++++++++++++++ src/scene/texture/procedural/ObjectId.php | 28 +++++++ .../texture/procedural/ObjectIdColor.php | 28 +++++++ .../texture/procedural/ObjectIdNormalized.php | 28 +++++++ src/scene/texture/procedural/Position.php | 28 +++++++ src/scene/texture/procedural/Random.php | 46 +++++++++++ .../texture/procedural/ShadingNormal.php | 28 +++++++ src/scene/texture/tint/BrightContrast.php | 69 ++++++++++++++++ src/scene/texture/tint/Hsv.php | 82 +++++++++++++++++++ src/scene/texture/tint/Subtract.php | 56 +++++++++++++ src/scene/texture/transform/NormalMap.php | 1 - src/scene/texture/value/ConstFloat_C.php | 23 ++++++ src/scene/texture/value/ConstFloat_F.php | 23 ++++++ 13 files changed, 500 insertions(+), 1 deletion(-) create mode 100644 src/scene/texture/deformation/Distort.php create mode 100644 src/scene/texture/procedural/ObjectId.php create mode 100644 src/scene/texture/procedural/ObjectIdColor.php create mode 100644 src/scene/texture/procedural/ObjectIdNormalized.php create mode 100644 src/scene/texture/procedural/Position.php create mode 100644 src/scene/texture/procedural/Random.php create mode 100644 src/scene/texture/procedural/ShadingNormal.php create mode 100644 src/scene/texture/tint/BrightContrast.php create mode 100644 src/scene/texture/tint/Hsv.php create mode 100644 src/scene/texture/tint/Subtract.php create mode 100644 src/scene/texture/value/ConstFloat_C.php create mode 100644 src/scene/texture/value/ConstFloat_F.php diff --git a/src/scene/texture/deformation/Distort.php b/src/scene/texture/deformation/Distort.php new file mode 100644 index 0000000..da0dc9d --- /dev/null +++ b/src/scene/texture/deformation/Distort.php @@ -0,0 +1,61 @@ +type = self::TYPE_DISTORT; + $this->id = Scene::createID(); + Base::__construct($config); + } + + /** + * @param object $color 接收一个贴图对象或小数形式的色值,设置颜色通道(输入源) + */ + public function setSource($color) + { + $this->texture = Scene::testAbnormal($color); + } + + /** + * @param object $color 接收一个贴图对象或小数形式的色值,设置偏移 + */ + public function setOffset($color) + { + $this->offset = Scene::testAbnormal($color); + } + +} + +?> diff --git a/src/scene/texture/procedural/ObjectId.php b/src/scene/texture/procedural/ObjectId.php new file mode 100644 index 0000000..63a1c1e --- /dev/null +++ b/src/scene/texture/procedural/ObjectId.php @@ -0,0 +1,28 @@ +type = self::TYPE_OBJECTID; + $this->id = Scene::createID(); + Base::__construct($config); + } + +} + +?> diff --git a/src/scene/texture/procedural/ObjectIdColor.php b/src/scene/texture/procedural/ObjectIdColor.php new file mode 100644 index 0000000..79ce679 --- /dev/null +++ b/src/scene/texture/procedural/ObjectIdColor.php @@ -0,0 +1,28 @@ +type = self::TYPE_OBJECTIDCOLOR; + $this->id = Scene::createID(); + Base::__construct($config); + } + +} + +?> diff --git a/src/scene/texture/procedural/ObjectIdNormalized.php b/src/scene/texture/procedural/ObjectIdNormalized.php new file mode 100644 index 0000000..f2a72f8 --- /dev/null +++ b/src/scene/texture/procedural/ObjectIdNormalized.php @@ -0,0 +1,28 @@ +type = self::TYPE_OBJECTIDNORMALIZED; + $this->id = Scene::createID(); + Base::__construct($config); + } + +} + +?> diff --git a/src/scene/texture/procedural/Position.php b/src/scene/texture/procedural/Position.php new file mode 100644 index 0000000..83a6a1f --- /dev/null +++ b/src/scene/texture/procedural/Position.php @@ -0,0 +1,28 @@ +type = self::TYPE_POSITION; + $this->id = Scene::createID(); + Base::__construct($config); + } + +} + +?> diff --git a/src/scene/texture/procedural/Random.php b/src/scene/texture/procedural/Random.php new file mode 100644 index 0000000..dff1c99 --- /dev/null +++ b/src/scene/texture/procedural/Random.php @@ -0,0 +1,46 @@ +type = self::TYPE_RANDOM; + $this->id = Scene::createID(); + Base::__construct($config); + } + + /** + * @param object $color 接收一个贴图对象或小数形式的色值,设置明度值 + */ + public function setTexture1($color) + { + $this->texture1 = Scene::testAbnormal($color); + } + +} + +?> diff --git a/src/scene/texture/procedural/ShadingNormal.php b/src/scene/texture/procedural/ShadingNormal.php new file mode 100644 index 0000000..282d8f6 --- /dev/null +++ b/src/scene/texture/procedural/ShadingNormal.php @@ -0,0 +1,28 @@ +type = self::TYPE_SHADINGNORMAL; + $this->id = Scene::createID(); + Base::__construct($config); + } + +} + +?> diff --git a/src/scene/texture/tint/BrightContrast.php b/src/scene/texture/tint/BrightContrast.php new file mode 100644 index 0000000..4b529bf --- /dev/null +++ b/src/scene/texture/tint/BrightContrast.php @@ -0,0 +1,69 @@ +type = self::TYPE_BRIGHTCONTRAST; + $this->id = Scene::createID(); + Base::__construct($config); + } + + /** + * @param object $color 接收一个贴图对象或小数形式的色值,设置颜色通道(输入源) + */ + public function setTexture($color) + { + $this->texture = Scene::testAbnormal($color); + } + + /** + * @param object $color 接收一个贴图对象或小数形式的色值,设置亮度 + */ + public function setBrightness($color) + { + $this->brightness = Scene::testAbnormal($color); + } + + /** + * @param object $color 接收一个贴图对象或小数形式的色值,设置对比度 + */ + public function setContrast($color) + { + $this->contrast = Scene::testAbnormal($color); + } + +} + +?> diff --git a/src/scene/texture/tint/Hsv.php b/src/scene/texture/tint/Hsv.php new file mode 100644 index 0000000..2be5c76 --- /dev/null +++ b/src/scene/texture/tint/Hsv.php @@ -0,0 +1,82 @@ +type = self::TYPE_HSV; + $this->id = Scene::createID(); + Base::__construct($config); + } + + /** + * @param object $color 接收一个贴图对象或小数形式的色值,设置颜色通道(输入源) + */ + public function setTexture($color) + { + $this->texture = Scene::testAbnormal($color); + } + + /** + * @param object $color 接收一个贴图对象或小数形式的色值,设置色相偏移 + */ + public function setHue($color) + { + $this->hue = Scene::testAbnormal($color); + } + + /** + * @param object $color 接收一个贴图对象或小数形式的色值,设置饱和度 + */ + public function setSaturation($color) + { + $this->saturation = Scene::testAbnormal($color); + } + + /** + * @param object $color 接收一个贴图对象或小数形式的色值,设置亮度 + */ + public function setBrightness($color) + { + $this->value = Scene::testAbnormal($color); + } + +} + +?> diff --git a/src/scene/texture/tint/Subtract.php b/src/scene/texture/tint/Subtract.php new file mode 100644 index 0000000..90774fc --- /dev/null +++ b/src/scene/texture/tint/Subtract.php @@ -0,0 +1,56 @@ +type = self::TYPE_SUBTRACT; + $this->id = Scene::createID(); + Base::__construct($config); + } + + /** + * @param object $color 接收一个贴图对象或小数形式的色值,设置颜色通道1(亮度) + */ + public function setBrightness($color) + { + $this->texture1 = Scene::testAbnormal($color); + } + + /** + * @param object $color 接收一个贴图对象或小数形式的色值,设置颜色通道2(输入源) + */ + public function setSource($color) + { + $this->texture2 = Scene::testAbnormal($color); + } + +} + +?> diff --git a/src/scene/texture/transform/NormalMap.php b/src/scene/texture/transform/NormalMap.php index abad809..1946761 100644 --- a/src/scene/texture/transform/NormalMap.php +++ b/src/scene/texture/transform/NormalMap.php @@ -4,7 +4,6 @@ namespace Blobt\Luxcore\scene\texture\transform; use Blobt\Luxcore\scene\texture\TextureBase; use Blobt\Luxcore\scene\Scene; use Blobt\Luxcore\core\Base; -use Blobt\Luxcore\scene\texture\mapping\Mapping; class ImageMap extends TextureBase { diff --git a/src/scene/texture/value/ConstFloat_C.php b/src/scene/texture/value/ConstFloat_C.php new file mode 100644 index 0000000..31d7295 --- /dev/null +++ b/src/scene/texture/value/ConstFloat_C.php @@ -0,0 +1,23 @@ + diff --git a/src/scene/texture/value/ConstFloat_F.php b/src/scene/texture/value/ConstFloat_F.php new file mode 100644 index 0000000..67d6e20 --- /dev/null +++ b/src/scene/texture/value/ConstFloat_F.php @@ -0,0 +1,23 @@ +