yuanjiajia
3 years ago
13 changed files with 500 additions and 1 deletions
-
61src/scene/texture/deformation/Distort.php
-
28src/scene/texture/procedural/ObjectId.php
-
28src/scene/texture/procedural/ObjectIdColor.php
-
28src/scene/texture/procedural/ObjectIdNormalized.php
-
28src/scene/texture/procedural/Position.php
-
46src/scene/texture/procedural/Random.php
-
28src/scene/texture/procedural/ShadingNormal.php
-
69src/scene/texture/tint/BrightContrast.php
-
82src/scene/texture/tint/Hsv.php
-
56src/scene/texture/tint/Subtract.php
-
1src/scene/texture/transform/NormalMap.php
-
23src/scene/texture/value/ConstFloat_C.php
-
23src/scene/texture/value/ConstFloat_F.php
@ -0,0 +1,61 @@ |
|||
<?php |
|||
|
|||
namespace Blobt\Luxcore\scene\texture\deformation; |
|||
use Blobt\Luxcore\scene\texture\TextureBase; |
|||
use Blobt\Luxcore\scene\Scene; |
|||
use Blobt\Luxcore\core\Base; |
|||
|
|||
class Distort extends TextureBase |
|||
{ |
|||
|
|||
/** |
|||
* 贴图变形(偏移、扭曲) |
|||
*/ |
|||
const TYPE_DISTORT = 'distort'; |
|||
|
|||
/** |
|||
* @var string 颜色通道(输入源),一个小数形式的色值,或是一个textures(贴图数组)中的某个键名 |
|||
*/ |
|||
public $texture = "1"; |
|||
|
|||
/** |
|||
* @var string 变形强度,(取值:任意自然数) |
|||
*/ |
|||
public $strength = 1; |
|||
|
|||
/** |
|||
* @var string 偏移,一个小数形式的色值,或是一个textures(贴图数组)中的某个键名 |
|||
*/ |
|||
public $offset = "0 0 0"; |
|||
|
|||
|
|||
|
|||
/** |
|||
* @param array $config 接收一个数组,可以初始化当前实例化对象的各种属性 |
|||
*/ |
|||
public function __construct($config = []) |
|||
{ |
|||
$this->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); |
|||
} |
|||
|
|||
} |
|||
|
|||
?>
|
@ -0,0 +1,28 @@ |
|||
<?php |
|||
|
|||
namespace Blobt\Luxcore\scene\texture\procedural; |
|||
use Blobt\Luxcore\scene\texture\TextureBase; |
|||
use Blobt\Luxcore\scene\Scene; |
|||
use Blobt\Luxcore\core\Base; |
|||
|
|||
class ObjectId extends TextureBase |
|||
{ |
|||
|
|||
/** |
|||
* 按模型不同ID随机以Raw着色的程序纹理 |
|||
*/ |
|||
const TYPE_OBJECTID = 'objectid'; |
|||
|
|||
/** |
|||
* @param array $config 接收一个数组,可以初始化当前实例化对象的各种属性 |
|||
*/ |
|||
public function __construct($config = []) |
|||
{ |
|||
$this->type = self::TYPE_OBJECTID; |
|||
$this->id = Scene::createID(); |
|||
Base::__construct($config); |
|||
} |
|||
|
|||
} |
|||
|
|||
?>
|
@ -0,0 +1,28 @@ |
|||
<?php |
|||
|
|||
namespace Blobt\Luxcore\scene\texture\procedural; |
|||
use Blobt\Luxcore\scene\texture\TextureBase; |
|||
use Blobt\Luxcore\scene\Scene; |
|||
use Blobt\Luxcore\core\Base; |
|||
|
|||
class ObjectIdColor extends TextureBase |
|||
{ |
|||
|
|||
/** |
|||
* 按模型不同ID随机以色值着色的程序纹理 |
|||
*/ |
|||
const TYPE_OBJECTIDCOLOR = 'objectidcolor'; |
|||
|
|||
/** |
|||
* @param array $config 接收一个数组,可以初始化当前实例化对象的各种属性 |
|||
*/ |
|||
public function __construct($config = []) |
|||
{ |
|||
$this->type = self::TYPE_OBJECTIDCOLOR; |
|||
$this->id = Scene::createID(); |
|||
Base::__construct($config); |
|||
} |
|||
|
|||
} |
|||
|
|||
?>
|
@ -0,0 +1,28 @@ |
|||
<?php |
|||
|
|||
namespace Blobt\Luxcore\scene\texture\procedural; |
|||
use Blobt\Luxcore\scene\texture\TextureBase; |
|||
use Blobt\Luxcore\scene\Scene; |
|||
use Blobt\Luxcore\core\Base; |
|||
|
|||
class ObjectIdNormalized extends TextureBase |
|||
{ |
|||
|
|||
/** |
|||
* 按模型不同ID随机规格化着色的程序纹理 |
|||
*/ |
|||
const TYPE_OBJECTIDNORMALIZED = 'objectidnormalized'; |
|||
|
|||
/** |
|||
* @param array $config 接收一个数组,可以初始化当前实例化对象的各种属性 |
|||
*/ |
|||
public function __construct($config = []) |
|||
{ |
|||
$this->type = self::TYPE_OBJECTIDNORMALIZED; |
|||
$this->id = Scene::createID(); |
|||
Base::__construct($config); |
|||
} |
|||
|
|||
} |
|||
|
|||
?>
|
@ -0,0 +1,28 @@ |
|||
<?php |
|||
|
|||
namespace Blobt\Luxcore\scene\texture\procedural; |
|||
use Blobt\Luxcore\scene\texture\TextureBase; |
|||
use Blobt\Luxcore\scene\Scene; |
|||
use Blobt\Luxcore\core\Base; |
|||
|
|||
class Position extends TextureBase |
|||
{ |
|||
|
|||
/** |
|||
* 位置着色的程序纹理 |
|||
*/ |
|||
const TYPE_POSITION = 'position'; |
|||
|
|||
/** |
|||
* @param array $config 接收一个数组,可以初始化当前实例化对象的各种属性 |
|||
*/ |
|||
public function __construct($config = []) |
|||
{ |
|||
$this->type = self::TYPE_POSITION; |
|||
$this->id = Scene::createID(); |
|||
Base::__construct($config); |
|||
} |
|||
|
|||
} |
|||
|
|||
?>
|
@ -0,0 +1,46 @@ |
|||
<?php |
|||
|
|||
namespace Blobt\Luxcore\scene\texture\procedural; |
|||
use Blobt\Luxcore\scene\texture\TextureBase; |
|||
use Blobt\Luxcore\scene\Scene; |
|||
use Blobt\Luxcore\core\Base; |
|||
|
|||
class Random extends TextureBase |
|||
{ |
|||
|
|||
/** |
|||
* 随机明度的程序纹理 |
|||
*/ |
|||
const TYPE_RANDOM = 'random'; |
|||
|
|||
/** |
|||
* @var float 明度值,一个任意的自然数,或是一个textures(贴图数组)中的某个键名 |
|||
*/ |
|||
public $texture = "0"; |
|||
|
|||
/** |
|||
* @var object 随机种子,大于等于0的整数 |
|||
*/ |
|||
public $seed = 0; |
|||
|
|||
/** |
|||
* @param array $config 接收一个数组,可以初始化当前实例化对象的各种属性 |
|||
*/ |
|||
public function __construct($config = []) |
|||
{ |
|||
$this->type = self::TYPE_RANDOM; |
|||
$this->id = Scene::createID(); |
|||
Base::__construct($config); |
|||
} |
|||
|
|||
/** |
|||
* @param object $color 接收一个贴图对象或小数形式的色值,设置明度值 |
|||
*/ |
|||
public function setTexture1($color) |
|||
{ |
|||
$this->texture1 = Scene::testAbnormal($color); |
|||
} |
|||
|
|||
} |
|||
|
|||
?>
|
@ -0,0 +1,28 @@ |
|||
<?php |
|||
|
|||
namespace Blobt\Luxcore\scene\texture\procedural; |
|||
use Blobt\Luxcore\scene\texture\TextureBase; |
|||
use Blobt\Luxcore\scene\Scene; |
|||
use Blobt\Luxcore\core\Base; |
|||
|
|||
class ShadingNormal extends TextureBase |
|||
{ |
|||
|
|||
/** |
|||
* 法线着色的程序纹理 |
|||
*/ |
|||
const TYPE_SHADINGNORMAL = 'shadingnormal'; |
|||
|
|||
/** |
|||
* @param array $config 接收一个数组,可以初始化当前实例化对象的各种属性 |
|||
*/ |
|||
public function __construct($config = []) |
|||
{ |
|||
$this->type = self::TYPE_SHADINGNORMAL; |
|||
$this->id = Scene::createID(); |
|||
Base::__construct($config); |
|||
} |
|||
|
|||
} |
|||
|
|||
?>
|
@ -0,0 +1,69 @@ |
|||
<?php |
|||
|
|||
namespace Blobt\Luxcore\scene\texture\tint; |
|||
use Blobt\Luxcore\scene\texture\TextureBase; |
|||
use Blobt\Luxcore\scene\Scene; |
|||
use Blobt\Luxcore\core\Base; |
|||
|
|||
class BrightContrast extends TextureBase |
|||
{ |
|||
|
|||
/** |
|||
* 贴图调色:亮度、对比度 |
|||
*/ |
|||
const TYPE_BRIGHTCONTRAST = 'brightcontrast'; |
|||
|
|||
/** |
|||
* @var string 颜色通道(输入源),一个小数形式的RGB色值,或是一个textures(贴图数组)中的某个键名 |
|||
*/ |
|||
public $texture = "1 1 1"; |
|||
|
|||
/** |
|||
* @var string 亮度,一个任意的自然数,或是一个textures(贴图数组)中的某个键名 |
|||
*/ |
|||
public $brightness = "0"; |
|||
|
|||
/** |
|||
* @var string 对比度,一个任意的自然数,或是一个textures(贴图数组)中的某个键名 |
|||
*/ |
|||
public $contrast = "0"; |
|||
|
|||
|
|||
|
|||
/** |
|||
* @param array $config 接收一个数组,可以初始化当前实例化对象的各种属性 |
|||
*/ |
|||
public function __construct($config = []) |
|||
{ |
|||
$this->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); |
|||
} |
|||
|
|||
} |
|||
|
|||
?>
|
@ -0,0 +1,82 @@ |
|||
<?php |
|||
|
|||
namespace Blobt\Luxcore\scene\texture\tint; |
|||
use Blobt\Luxcore\scene\texture\TextureBase; |
|||
use Blobt\Luxcore\scene\Scene; |
|||
use Blobt\Luxcore\core\Base; |
|||
|
|||
class Hsv extends TextureBase |
|||
{ |
|||
|
|||
/** |
|||
* 贴图调色:色相、饱各度、亮度 |
|||
*/ |
|||
const TYPE_HSV = 'hsv'; |
|||
|
|||
/** |
|||
* @var string 颜色通道(输入源),一个小数形式的RGB色值,或是一个textures(贴图数组)中的某个键名 |
|||
*/ |
|||
public $texture = "1 1 1"; |
|||
|
|||
/** |
|||
* @var string 色相偏移,一个 0-1 的小数,或是一个textures(贴图数组)中的某个键名 |
|||
*/ |
|||
public $hue = "0.5"; |
|||
|
|||
/** |
|||
* @var string 饱和度,一个 0-2 的小数,或是一个textures(贴图数组)中的某个键名 |
|||
*/ |
|||
public $saturation = "1"; |
|||
|
|||
/** |
|||
* @var string 亮度,一个 0-2 的小数,或是一个textures(贴图数组)中的某个键名 |
|||
*/ |
|||
public $value = "1"; |
|||
|
|||
|
|||
|
|||
/** |
|||
* @param array $config 接收一个数组,可以初始化当前实例化对象的各种属性 |
|||
*/ |
|||
public function __construct($config = []) |
|||
{ |
|||
$this->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); |
|||
} |
|||
|
|||
} |
|||
|
|||
?>
|
@ -0,0 +1,56 @@ |
|||
<?php |
|||
|
|||
namespace Blobt\Luxcore\scene\texture\tint; |
|||
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(亮度),一个大于等于0小数,或是一个textures(贴图数组)中的某个键名 |
|||
*/ |
|||
public $texture1 = "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 setBrightness($color) |
|||
{ |
|||
$this->texture1 = Scene::testAbnormal($color); |
|||
} |
|||
|
|||
/** |
|||
* @param object $color 接收一个贴图对象或小数形式的色值,设置颜色通道2(输入源) |
|||
*/ |
|||
public function setSource($color) |
|||
{ |
|||
$this->texture2 = Scene::testAbnormal($color); |
|||
} |
|||
|
|||
} |
|||
|
|||
?>
|
@ -0,0 +1,23 @@ |
|||
<?php |
|||
|
|||
namespace Blobt\Luxcore\scene\texture\deformation; |
|||
use Blobt\Luxcore\scene\texture\TextureBase; |
|||
use Blobt\Luxcore\scene\Scene; |
|||
use Blobt\Luxcore\core\Base; |
|||
|
|||
class ConstFloat_F extends TextureBase |
|||
{ |
|||
|
|||
/** |
|||
* 浮点型的RGB色值 |
|||
*/ |
|||
const TYPE_CONSTFLOAT = 'constfloat1'; |
|||
|
|||
/** |
|||
* @var string 色值,(取值:一个小数形式的色值) |
|||
*/ |
|||
public $value = "1 1 1"; |
|||
|
|||
} |
|||
|
|||
?>
|
@ -0,0 +1,23 @@ |
|||
<?php |
|||
|
|||
namespace Blobt\Luxcore\scene\texture\deformation; |
|||
use Blobt\Luxcore\scene\texture\TextureBase; |
|||
use Blobt\Luxcore\scene\Scene; |
|||
use Blobt\Luxcore\core\Base; |
|||
|
|||
class ConstFloat_F extends TextureBase |
|||
{ |
|||
|
|||
/** |
|||
* 浮点型的任意自然数 |
|||
*/ |
|||
const TYPE_CONSTFLOAT = 'constfloat1'; |
|||
|
|||
/** |
|||
* @var float 值,(取值:任意自然数) |
|||
*/ |
|||
public $value = "0.00"; |
|||
|
|||
} |
|||
|
|||
?>
|
Write
Preview
Loading…
Cancel
Save
Reference in new issue