yuanjiajia
3 years ago
4 changed files with 178 additions and 1 deletions
-
2src/scene/texture/composite/Clamp.php
-
56src/scene/texture/composite/Dotproduct.php
-
68src/scene/texture/composite/MakeFloat3.php
-
53src/scene/texture/composite/SplitFloat3.php
@ -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 Dotproduct extends TextureBase |
||||
|
{ |
||||
|
|
||||
|
/** |
||||
|
* 贴图合成:累积 |
||||
|
*/ |
||||
|
const TYPE_DOTPRODUCT = 'dotproduct'; |
||||
|
|
||||
|
/** |
||||
|
* @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_DOTPRODUCT; |
||||
|
$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 MakeFloat3 extends TextureBase |
||||
|
{ |
||||
|
|
||||
|
/** |
||||
|
* 贴图合成:通道合并(三个输入颜色别分抽出一个通道,然后合并) |
||||
|
*/ |
||||
|
const TYPE_MAKEFLOAT3 = 'makefloat3'; |
||||
|
|
||||
|
/** |
||||
|
* @var string 颜色通道1,一个小数形式的RGB色值,或是一个textures(贴图数组)中的某个键名 |
||||
|
*/ |
||||
|
public $texture1 = "1 1 1"; |
||||
|
|
||||
|
/** |
||||
|
* @var string 颜色通道2,一个小数形式的RGB色值,或是一个textures(贴图数组)中的某个键名 |
||||
|
*/ |
||||
|
public $texture2 = "1 1 1"; |
||||
|
|
||||
|
/** |
||||
|
* @var string 颜色通道3,一个小数形式的RGB色值,或是一个textures(贴图数组)中的某个键名 |
||||
|
*/ |
||||
|
public $texture3 = "1 1 1"; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* @param array $config 接收一个数组,可以初始化当前实例化对象的各种属性 |
||||
|
*/ |
||||
|
public function __construct($config = []) |
||||
|
{ |
||||
|
$this->type = self::TYPE_MAKEFLOAT3; |
||||
|
$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 接收一个贴图对象或小数形式的色值,设置颜色通道3 |
||||
|
*/ |
||||
|
public function setTexture3($color) |
||||
|
{ |
||||
|
$this->texture3 = Scene::testAbnormal($color); |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
||||
|
?>
|
@ -0,0 +1,53 @@ |
|||||
|
<?php |
||||
|
|
||||
|
namespace Blobt\Luxcore\scene\texture\composite; |
||||
|
use Blobt\Luxcore\scene\texture\TextureBase; |
||||
|
use Blobt\Luxcore\scene\Scene; |
||||
|
use Blobt\Luxcore\core\Base; |
||||
|
|
||||
|
class SplitFloat3 extends TextureBase |
||||
|
{ |
||||
|
|
||||
|
/** |
||||
|
* 贴图合成:通道分离(单通道输出) |
||||
|
*/ |
||||
|
const TYPE_SPLITFLOAT3 = 'splitfloat3'; |
||||
|
|
||||
|
/** |
||||
|
* 三原色通道 |
||||
|
*/ |
||||
|
const CHANNEL_R = 0; //红色通道
|
||||
|
const CHANNEL_G = 1; //绿色通道
|
||||
|
const CHANNEL_B = 2; //蓝色通道
|
||||
|
|
||||
|
/** |
||||
|
* @var string 颜色通道,一个小数形式的RGB色值,或是一个textures(贴图数组)中的某个键名 |
||||
|
*/ |
||||
|
public $texture = "1 1 1"; |
||||
|
|
||||
|
/** |
||||
|
* @var string 输出的单通道 |
||||
|
*/ |
||||
|
public $channel = self::CHANNEL_R; |
||||
|
|
||||
|
/** |
||||
|
* @param array $config 接收一个数组,可以初始化当前实例化对象的各种属性 |
||||
|
*/ |
||||
|
public function __construct($config = []) |
||||
|
{ |
||||
|
$this->type = self::TYPE_SPLITFLOAT3; |
||||
|
$this->id = Scene::createID(); |
||||
|
Base::__construct($config); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @param object $color 接收一个贴图对象或小数形式的色值,设置颜色通道 |
||||
|
*/ |
||||
|
public function setTexture($color) |
||||
|
{ |
||||
|
$this->texture = Scene::testAbnormal($color); |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
||||
|
?>
|
Write
Preview
Loading…
Cancel
Save
Reference in new issue