Browse Source

新增三个纹理合成的类文件,Clamp.php文件修改了注释

master
yuanjiajia 3 years ago
parent
commit
2a4cf382c6
  1. 2
      src/scene/texture/composite/Clamp.php
  2. 56
      src/scene/texture/composite/Dotproduct.php
  3. 68
      src/scene/texture/composite/MakeFloat3.php
  4. 53
      src/scene/texture/composite/SplitFloat3.php

2
src/scene/texture/composite/Clamp.php

@ -40,7 +40,7 @@ class Clamp extends TextureBase
} }
/** /**
* @param object $color 接收一个贴图对象或小数形式的色值,设置颜色通道1
* @param object $color 接收一个贴图对象或小数形式的色值,设置颜色通道
*/ */
public function setTexture($color) public function setTexture($color)
{ {

56
src/scene/texture/composite/Dotproduct.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);
}
}
?>

68
src/scene/texture/composite/MakeFloat3.php

@ -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);
}
}
?>

53
src/scene/texture/composite/SplitFloat3.php

@ -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);
}
}
?>
Loading…
Cancel
Save