yuanjiajia
3 years ago
29 changed files with 677 additions and 17 deletions
-
43src/scene/texture/composite/Absolute.php
-
56src/scene/texture/composite/Add.php
-
52src/scene/texture/composite/Clamp.php
-
56src/scene/texture/composite/Divide.php
-
55src/scene/texture/composite/GreaterThan.php
-
55src/scene/texture/composite/LessThan.php
-
68src/scene/texture/composite/Mix.php
-
55src/scene/texture/composite/Modulo.php
-
55src/scene/texture/composite/Power.php
-
55src/scene/texture/composite/Rounding.php
-
55src/scene/texture/composite/Scale.php
-
55src/scene/texture/composite/Subtract.php
-
2src/scene/texture/procedural/BlenderBlend.php
-
2src/scene/texture/procedural/BlenderClouds.php
-
2src/scene/texture/procedural/BlenderDistortedNoise.php
-
2src/scene/texture/procedural/BlenderMagic.php
-
2src/scene/texture/procedural/BlenderMarble.php
-
2src/scene/texture/procedural/BlenderMusgrave.php
-
2src/scene/texture/procedural/BlenderNoise.php
-
2src/scene/texture/procedural/BlenderStucci.php
-
2src/scene/texture/procedural/BlenderVoronoi.php
-
2src/scene/texture/procedural/BlenderWood.php
-
2src/scene/texture/procedural/Brick.php
-
2src/scene/texture/procedural/Checkerboard2d.php
-
2src/scene/texture/procedural/Checkerboard3d.php
-
2src/scene/texture/procedural/Fbm.php
-
2src/scene/texture/procedural/ImageMap.php
-
2src/scene/texture/procedural/Marble.php
-
2src/scene/texture/procedural/Wrinkled.php
@ -0,0 +1,43 @@ |
|||||
|
<?php |
||||
|
|
||||
|
namespace Blobt\Luxcore\scene\texture\composite; |
||||
|
use Blobt\Luxcore\scene\texture\TextureBase; |
||||
|
use Blobt\Luxcore\scene\Scene; |
||||
|
use Blobt\Luxcore\core\Base; |
||||
|
|
||||
|
class Absolute extends TextureBase |
||||
|
{ |
||||
|
|
||||
|
/** |
||||
|
* 贴图合成:绝对值 |
||||
|
*/ |
||||
|
const TYPE_ABSOLUTE = 'absolute'; |
||||
|
|
||||
|
/** |
||||
|
* @var string 颜色通道1,一个小数形式的RGB色值,或是一个textures(贴图数组)中的某个键名 |
||||
|
*/ |
||||
|
public $texture = "1 1 1"; |
||||
|
|
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* @param array $config 接收一个数组,可以初始化当前实例化对象的各种属性 |
||||
|
*/ |
||||
|
public function __construct($config = []) |
||||
|
{ |
||||
|
$this->type = self::TYPE_ABSOLUTE; |
||||
|
$this->id = Scene::createID(); |
||||
|
Base::__construct($config); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @param object $color 接收一个贴图对象或小数形式的色值,设置颜色通道 |
||||
|
*/ |
||||
|
public function setTexture($color) |
||||
|
{ |
||||
|
$this->texture = Scene::testAbnormal($color); |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
||||
|
?>
|
@ -0,0 +1,56 @@ |
|||||
|
<?php |
||||
|
|
||||
|
namespace Blobt\Luxcore\scene\texture\composite; |
||||
|
use Blobt\Luxcore\scene\texture\TextureBase; |
||||
|
use Blobt\Luxcore\scene\Scene; |
||||
|
use Blobt\Luxcore\core\Base; |
||||
|
|
||||
|
class Add extends TextureBase |
||||
|
{ |
||||
|
|
||||
|
/** |
||||
|
* 贴图合成:相加 |
||||
|
*/ |
||||
|
const TYPE_ADD = 'add'; |
||||
|
|
||||
|
/** |
||||
|
* @var string 颜色通道1,一个小数形式的RGB色值,或是一个textures(贴图数组)中的某个键名 |
||||
|
*/ |
||||
|
public $texture1 = "1 1 1"; |
||||
|
|
||||
|
/** |
||||
|
* @var string 颜色通道2,一个小数形式的RGB色值,或是一个textures(贴图数组)中的某个键名 |
||||
|
*/ |
||||
|
public $texture2 = "1 1 1"; |
||||
|
|
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* @param array $config 接收一个数组,可以初始化当前实例化对象的各种属性 |
||||
|
*/ |
||||
|
public function __construct($config = []) |
||||
|
{ |
||||
|
$this->type = self::TYPE_ADD; |
||||
|
$this->id = Scene::createID(); |
||||
|
Base::__construct($config); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @param object $color 接收一个贴图对象或小数形式的色值,设置颜色通道1 |
||||
|
*/ |
||||
|
public function setTexture1($color) |
||||
|
{ |
||||
|
$this->texture1 = Scene::testAbnormal($color); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @param object $color 接收一个贴图对象或小数形式的色值,设置颜色通道2 |
||||
|
*/ |
||||
|
public function setTexture2($color) |
||||
|
{ |
||||
|
$this->texture2 = Scene::testAbnormal($color); |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
||||
|
?>
|
@ -0,0 +1,52 @@ |
|||||
|
<?php |
||||
|
|
||||
|
namespace Blobt\Luxcore\scene\texture\composite; |
||||
|
use Blobt\Luxcore\scene\texture\TextureBase; |
||||
|
use Blobt\Luxcore\scene\Scene; |
||||
|
use Blobt\Luxcore\core\Base; |
||||
|
|
||||
|
class Clamp extends TextureBase |
||||
|
{ |
||||
|
|
||||
|
/** |
||||
|
* 贴图合成:嵌制 |
||||
|
*/ |
||||
|
const TYPE_CLAMP = 'clamp'; |
||||
|
|
||||
|
/** |
||||
|
* @var string 颜色通道,一个小数形式的RGB色值,或是一个textures(贴图数组)中的某个键名 |
||||
|
*/ |
||||
|
public $texture = "1 1 1"; |
||||
|
|
||||
|
/** |
||||
|
* @var string 像素最小色值,一个小数形式的RGB色值,或是一个textures(贴图数组)中的某个键名 |
||||
|
*/ |
||||
|
public $min = 0; |
||||
|
|
||||
|
/** |
||||
|
* @var string 像素最大色值,一个小数形式的RGB色值,或是一个textures(贴图数组)中的某个键名 |
||||
|
*/ |
||||
|
public $max = 1; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* @param array $config 接收一个数组,可以初始化当前实例化对象的各种属性 |
||||
|
*/ |
||||
|
public function __construct($config = []) |
||||
|
{ |
||||
|
$this->type = self::TYPE_CLAMP; |
||||
|
$this->id = Scene::createID(); |
||||
|
Base::__construct($config); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @param object $color 接收一个贴图对象或小数形式的色值,设置颜色通道1 |
||||
|
*/ |
||||
|
public function setTexture($color) |
||||
|
{ |
||||
|
$this->texture = Scene::testAbnormal($color); |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
||||
|
?>
|
@ -0,0 +1,56 @@ |
|||||
|
<?php |
||||
|
|
||||
|
namespace Blobt\Luxcore\scene\texture\composite; |
||||
|
use Blobt\Luxcore\scene\texture\TextureBase; |
||||
|
use Blobt\Luxcore\scene\Scene; |
||||
|
use Blobt\Luxcore\core\Base; |
||||
|
|
||||
|
class Divide extends TextureBase |
||||
|
{ |
||||
|
|
||||
|
/** |
||||
|
* 贴图合成:相除 |
||||
|
*/ |
||||
|
const TYPE_DIVIDE = 'divide'; |
||||
|
|
||||
|
/** |
||||
|
* @var string 颜色通道1,一个小数形式的RGB色值,或是一个textures(贴图数组)中的某个键名 |
||||
|
*/ |
||||
|
public $texture1 = "1 1 1"; |
||||
|
|
||||
|
/** |
||||
|
* @var string 颜色通道2,一个小数形式的RGB色值,或是一个textures(贴图数组)中的某个键名 |
||||
|
*/ |
||||
|
public $texture2 = "1 1 1"; |
||||
|
|
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* @param array $config 接收一个数组,可以初始化当前实例化对象的各种属性 |
||||
|
*/ |
||||
|
public function __construct($config = []) |
||||
|
{ |
||||
|
$this->type = self::TYPE_DIVIDE; |
||||
|
$this->id = Scene::createID(); |
||||
|
Base::__construct($config); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @param object $color 接收一个贴图对象或小数形式的色值,设置颜色通道1 |
||||
|
*/ |
||||
|
public function setTexture1($color) |
||||
|
{ |
||||
|
$this->texture1 = Scene::testAbnormal($color); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @param object $color 接收一个贴图对象或小数形式的色值,设置颜色通道2 |
||||
|
*/ |
||||
|
public function setTexture2($color) |
||||
|
{ |
||||
|
$this->texture2 = Scene::testAbnormal($color); |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
||||
|
?>
|
@ -0,0 +1,55 @@ |
|||||
|
<?php |
||||
|
|
||||
|
namespace Blobt\Luxcore\scene\texture\composite; |
||||
|
use Blobt\Luxcore\scene\texture\TextureBase; |
||||
|
use Blobt\Luxcore\scene\Scene; |
||||
|
use Blobt\Luxcore\core\Base; |
||||
|
|
||||
|
class GreaterThan extends TextureBase |
||||
|
{ |
||||
|
|
||||
|
/** |
||||
|
* 贴图合成:大于 |
||||
|
*/ |
||||
|
const TYPE_GREATERTHAN = 'greaterthan'; |
||||
|
|
||||
|
/** |
||||
|
* @var string 颜色通道1,一个小数形式的RGB色值,或是一个textures(贴图数组)中的某个键名 |
||||
|
*/ |
||||
|
public $texture1 = "1 1 1"; |
||||
|
|
||||
|
/** |
||||
|
* @var string 颜色通道2,一个小数形式的RGB色值,或是一个textures(贴图数组)中的某个键名 |
||||
|
*/ |
||||
|
public $texture2 = "1 1 1"; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* @param array $config 接收一个数组,可以初始化当前实例化对象的各种属性 |
||||
|
*/ |
||||
|
public function __construct($config = []) |
||||
|
{ |
||||
|
$this->type = self::TYPE_GREATERTHAN; |
||||
|
$this->id = Scene::createID(); |
||||
|
Base::__construct($config); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @param object $color 接收一个贴图对象或小数形式的色值,设置颜色通道1 |
||||
|
*/ |
||||
|
public function setTexture1($color) |
||||
|
{ |
||||
|
$this->texture1 = Scene::testAbnormal($color); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @param object $color 接收一个贴图对象或小数形式的色值,设置颜色通道2 |
||||
|
*/ |
||||
|
public function setTexture2($color) |
||||
|
{ |
||||
|
$this->texture2 = Scene::testAbnormal($color); |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
||||
|
?>
|
@ -0,0 +1,55 @@ |
|||||
|
<?php |
||||
|
|
||||
|
namespace Blobt\Luxcore\scene\texture\composite; |
||||
|
use Blobt\Luxcore\scene\texture\TextureBase; |
||||
|
use Blobt\Luxcore\scene\Scene; |
||||
|
use Blobt\Luxcore\core\Base; |
||||
|
|
||||
|
class LessThan extends TextureBase |
||||
|
{ |
||||
|
|
||||
|
/** |
||||
|
* 贴图合成:小于 |
||||
|
*/ |
||||
|
const TYPE_LESSTHAN = 'lessthan'; |
||||
|
|
||||
|
/** |
||||
|
* @var string 颜色通道1,一个小数形式的RGB色值,或是一个textures(贴图数组)中的某个键名 |
||||
|
*/ |
||||
|
public $texture1 = "1 1 1"; |
||||
|
|
||||
|
/** |
||||
|
* @var string 颜色通道2,一个小数形式的RGB色值,或是一个textures(贴图数组)中的某个键名 |
||||
|
*/ |
||||
|
public $texture2 = "1 1 1"; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* @param array $config 接收一个数组,可以初始化当前实例化对象的各种属性 |
||||
|
*/ |
||||
|
public function __construct($config = []) |
||||
|
{ |
||||
|
$this->type = self::TYPE_LESSTHAN; |
||||
|
$this->id = Scene::createID(); |
||||
|
Base::__construct($config); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @param object $color 接收一个贴图对象或小数形式的色值,设置颜色通道1 |
||||
|
*/ |
||||
|
public function setTexture1($color) |
||||
|
{ |
||||
|
$this->texture1 = Scene::testAbnormal($color); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @param object $color 接收一个贴图对象或小数形式的色值,设置颜色通道2 |
||||
|
*/ |
||||
|
public function setTexture2($color) |
||||
|
{ |
||||
|
$this->texture2 = Scene::testAbnormal($color); |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
||||
|
?>
|
@ -0,0 +1,68 @@ |
|||||
|
<?php |
||||
|
|
||||
|
namespace Blobt\Luxcore\scene\texture\composite; |
||||
|
use Blobt\Luxcore\scene\texture\TextureBase; |
||||
|
use Blobt\Luxcore\scene\Scene; |
||||
|
use Blobt\Luxcore\core\Base; |
||||
|
|
||||
|
class Mix extends TextureBase |
||||
|
{ |
||||
|
|
||||
|
/** |
||||
|
* 贴图合成:混合 |
||||
|
*/ |
||||
|
const TYPE_MIX = 'mix'; |
||||
|
|
||||
|
/** |
||||
|
* @var string 颜色通道1,一个小数形式的RGB色值,或是一个textures(贴图数组)中的某个键名 |
||||
|
*/ |
||||
|
public $texture1 = "1 1 1"; |
||||
|
|
||||
|
/** |
||||
|
* @var string 颜色通道2,一个小数形式的RGB色值,或是一个textures(贴图数组)中的某个键名 |
||||
|
*/ |
||||
|
public $texture2 = "1 1 1"; |
||||
|
|
||||
|
/** |
||||
|
* @var float 混合系数,一个0-1的小数,或是一个textures(贴图数组)中的某个键名 |
||||
|
*/ |
||||
|
public $amount = 0.5; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* @param array $config 接收一个数组,可以初始化当前实例化对象的各种属性 |
||||
|
*/ |
||||
|
public function __construct($config = []) |
||||
|
{ |
||||
|
$this->type = self::TYPE_MIX; |
||||
|
$this->id = Scene::createID(); |
||||
|
Base::__construct($config); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @param object $color 接收一个贴图对象或小数形式的色值,设置颜色通道1 |
||||
|
*/ |
||||
|
public function setTexture1($color) |
||||
|
{ |
||||
|
$this->texture1 = Scene::testAbnormal($color); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @param object $color 接收一个贴图对象或小数形式的色值,设置颜色通道2 |
||||
|
*/ |
||||
|
public function setTexture2($color) |
||||
|
{ |
||||
|
$this->texture2 = Scene::testAbnormal($color); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @param object $color 接收一个贴图对象或小数形式的色值,设置混合系数 |
||||
|
*/ |
||||
|
public function setAmount($color) |
||||
|
{ |
||||
|
$this->amount = Scene::testAbnormal($color); |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
||||
|
?>
|
@ -0,0 +1,55 @@ |
|||||
|
<?php |
||||
|
|
||||
|
namespace Blobt\Luxcore\scene\texture\composite; |
||||
|
use Blobt\Luxcore\scene\texture\TextureBase; |
||||
|
use Blobt\Luxcore\scene\Scene; |
||||
|
use Blobt\Luxcore\core\Base; |
||||
|
|
||||
|
class Modulo extends TextureBase |
||||
|
{ |
||||
|
|
||||
|
/** |
||||
|
* 贴图合成:取模 |
||||
|
*/ |
||||
|
const TYPE_MODULO = 'modulo'; |
||||
|
|
||||
|
/** |
||||
|
* @var string 颜色通道1,一个小数形式的RGB色值,或是一个textures(贴图数组)中的某个键名 |
||||
|
*/ |
||||
|
public $texture1 = "1 1 1"; |
||||
|
|
||||
|
/** |
||||
|
* @var string 颜色通道2,一个小数形式的RGB色值,或是一个textures(贴图数组)中的某个键名 |
||||
|
*/ |
||||
|
public $texture2 = "1 1 1"; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* @param array $config 接收一个数组,可以初始化当前实例化对象的各种属性 |
||||
|
*/ |
||||
|
public function __construct($config = []) |
||||
|
{ |
||||
|
$this->type = self::TYPE_MODULO; |
||||
|
$this->id = Scene::createID(); |
||||
|
Base::__construct($config); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @param object $color 接收一个贴图对象或小数形式的色值,设置颜色通道1 |
||||
|
*/ |
||||
|
public function setTexture1($color) |
||||
|
{ |
||||
|
$this->texture1 = Scene::testAbnormal($color); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @param object $color 接收一个贴图对象或小数形式的色值,设置颜色通道2 |
||||
|
*/ |
||||
|
public function setTexture2($color) |
||||
|
{ |
||||
|
$this->texture2 = Scene::testAbnormal($color); |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
||||
|
?>
|
@ -0,0 +1,55 @@ |
|||||
|
<?php |
||||
|
|
||||
|
namespace Blobt\Luxcore\scene\texture\composite; |
||||
|
use Blobt\Luxcore\scene\texture\TextureBase; |
||||
|
use Blobt\Luxcore\scene\Scene; |
||||
|
use Blobt\Luxcore\core\Base; |
||||
|
|
||||
|
class Power extends TextureBase |
||||
|
{ |
||||
|
|
||||
|
/** |
||||
|
* 贴图合成:能量乘方 |
||||
|
*/ |
||||
|
const TYPE_POWER = 'power'; |
||||
|
|
||||
|
/** |
||||
|
* @var string 颜色通道1,一个小数形式的RGB色值,或是一个textures(贴图数组)中的某个键名 |
||||
|
*/ |
||||
|
public $texture1 = "1 1 1"; |
||||
|
|
||||
|
/** |
||||
|
* @var string 颜色通道2,一个小数形式的RGB色值,或是一个textures(贴图数组)中的某个键名 |
||||
|
*/ |
||||
|
public $texture2 = "1 1 1"; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* @param array $config 接收一个数组,可以初始化当前实例化对象的各种属性 |
||||
|
*/ |
||||
|
public function __construct($config = []) |
||||
|
{ |
||||
|
$this->type = self::TYPE_POWER; |
||||
|
$this->id = Scene::createID(); |
||||
|
Base::__construct($config); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @param object $color 接收一个贴图对象或小数形式的色值,设置颜色通道1 |
||||
|
*/ |
||||
|
public function setTexture1($color) |
||||
|
{ |
||||
|
$this->texture1 = Scene::testAbnormal($color); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @param object $color 接收一个贴图对象或小数形式的色值,设置颜色通道2 |
||||
|
*/ |
||||
|
public function setTexture2($color) |
||||
|
{ |
||||
|
$this->texture2 = Scene::testAbnormal($color); |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
||||
|
?>
|
@ -0,0 +1,55 @@ |
|||||
|
<?php |
||||
|
|
||||
|
namespace Blobt\Luxcore\scene\texture\composite; |
||||
|
use Blobt\Luxcore\scene\texture\TextureBase; |
||||
|
use Blobt\Luxcore\scene\Scene; |
||||
|
use Blobt\Luxcore\core\Base; |
||||
|
|
||||
|
class Rounding extends TextureBase |
||||
|
{ |
||||
|
|
||||
|
/** |
||||
|
* 贴图合成:四舍五入 |
||||
|
*/ |
||||
|
const TYPE_ROUNDING = 'rounding'; |
||||
|
|
||||
|
/** |
||||
|
* @var string 颜色通道,一个小数形式的RGB色值,或是一个textures(贴图数组)中的某个键名 |
||||
|
*/ |
||||
|
public $texture = "1 1 1"; |
||||
|
|
||||
|
/** |
||||
|
* @var string 增量,一个小数形式的RGB色值,或是一个textures(贴图数组)中的某个键名 |
||||
|
*/ |
||||
|
public $increment = "1"; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* @param array $config 接收一个数组,可以初始化当前实例化对象的各种属性 |
||||
|
*/ |
||||
|
public function __construct($config = []) |
||||
|
{ |
||||
|
$this->type = self::TYPE_ROUNDING; |
||||
|
$this->id = Scene::createID(); |
||||
|
Base::__construct($config); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @param object $color 接收一个贴图对象或小数形式的色值,设置颜色通道 |
||||
|
*/ |
||||
|
public function setTexture($color) |
||||
|
{ |
||||
|
$this->texture = Scene::testAbnormal($color); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @param object $color 接收一个贴图对象或小数形式的色值,设置增量 |
||||
|
*/ |
||||
|
public function setIncrement($color) |
||||
|
{ |
||||
|
$this->increment = Scene::testAbnormal($color); |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
||||
|
?>
|
@ -0,0 +1,55 @@ |
|||||
|
<?php |
||||
|
|
||||
|
namespace Blobt\Luxcore\scene\texture\composite; |
||||
|
use Blobt\Luxcore\scene\texture\TextureBase; |
||||
|
use Blobt\Luxcore\scene\Scene; |
||||
|
use Blobt\Luxcore\core\Base; |
||||
|
|
||||
|
class Scale extends TextureBase |
||||
|
{ |
||||
|
|
||||
|
/** |
||||
|
* 贴图合成:相减正片叠底 |
||||
|
*/ |
||||
|
const TYPE_SCALE = 'scale'; |
||||
|
|
||||
|
/** |
||||
|
* @var string 颜色通道1,一个小数形式的RGB色值,或是一个textures(贴图数组)中的某个键名 |
||||
|
*/ |
||||
|
public $texture1 = "1 1 1"; |
||||
|
|
||||
|
/** |
||||
|
* @var string 颜色通道2,一个小数形式的RGB色值,或是一个textures(贴图数组)中的某个键名 |
||||
|
*/ |
||||
|
public $texture2 = "1 1 1"; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* @param array $config 接收一个数组,可以初始化当前实例化对象的各种属性 |
||||
|
*/ |
||||
|
public function __construct($config = []) |
||||
|
{ |
||||
|
$this->type = self::TYPE_SCALE; |
||||
|
$this->id = Scene::createID(); |
||||
|
Base::__construct($config); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @param object $color 接收一个贴图对象或小数形式的色值,设置颜色通道1 |
||||
|
*/ |
||||
|
public function setTexture1($color) |
||||
|
{ |
||||
|
$this->texture1 = Scene::testAbnormal($color); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @param object $color 接收一个贴图对象或小数形式的色值,设置颜色通道2 |
||||
|
*/ |
||||
|
public function setTexture2($color) |
||||
|
{ |
||||
|
$this->texture2 = Scene::testAbnormal($color); |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
||||
|
?>
|
@ -0,0 +1,55 @@ |
|||||
|
<?php |
||||
|
|
||||
|
namespace Blobt\Luxcore\scene\texture\composite; |
||||
|
use Blobt\Luxcore\scene\texture\TextureBase; |
||||
|
use Blobt\Luxcore\scene\Scene; |
||||
|
use Blobt\Luxcore\core\Base; |
||||
|
|
||||
|
class Subtract extends TextureBase |
||||
|
{ |
||||
|
|
||||
|
/** |
||||
|
* 贴图合成:相减 |
||||
|
*/ |
||||
|
const TYPE_SUBTRACT = 'subtract'; |
||||
|
|
||||
|
/** |
||||
|
* @var string 颜色通道1,一个小数形式的RGB色值,或是一个textures(贴图数组)中的某个键名 |
||||
|
*/ |
||||
|
public $texture1 = "1 1 1"; |
||||
|
|
||||
|
/** |
||||
|
* @var string 颜色通道2,一个小数形式的RGB色值,或是一个textures(贴图数组)中的某个键名 |
||||
|
*/ |
||||
|
public $texture2 = "1 1 1"; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* @param array $config 接收一个数组,可以初始化当前实例化对象的各种属性 |
||||
|
*/ |
||||
|
public function __construct($config = []) |
||||
|
{ |
||||
|
$this->type = self::TYPE_SUBTRACT; |
||||
|
$this->id = Scene::createID(); |
||||
|
Base::__construct($config); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @param object $color 接收一个贴图对象或小数形式的色值,设置颜色通道1 |
||||
|
*/ |
||||
|
public function setTexture1($color) |
||||
|
{ |
||||
|
$this->texture1 = Scene::testAbnormal($color); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @param object $color 接收一个贴图对象或小数形式的色值,设置颜色通道2 |
||||
|
*/ |
||||
|
public function setTexture2($color) |
||||
|
{ |
||||
|
$this->texture2 = Scene::testAbnormal($color); |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
||||
|
?>
|
Write
Preview
Loading…
Cancel
Save
Reference in new issue