Browse Source

新增6个程序纹理类文件,一个纹理变形类文件,三个纹理调色类文件、两个value(值)类文件,NormalMap.php文件删除了多余的use 语句

master
yuanjiajia 3 years ago
parent
commit
cef3ac5f2b
  1. 61
      src/scene/texture/deformation/Distort.php
  2. 28
      src/scene/texture/procedural/ObjectId.php
  3. 28
      src/scene/texture/procedural/ObjectIdColor.php
  4. 28
      src/scene/texture/procedural/ObjectIdNormalized.php
  5. 28
      src/scene/texture/procedural/Position.php
  6. 46
      src/scene/texture/procedural/Random.php
  7. 28
      src/scene/texture/procedural/ShadingNormal.php
  8. 69
      src/scene/texture/tint/BrightContrast.php
  9. 82
      src/scene/texture/tint/Hsv.php
  10. 56
      src/scene/texture/tint/Subtract.php
  11. 1
      src/scene/texture/transform/NormalMap.php
  12. 23
      src/scene/texture/value/ConstFloat_C.php
  13. 23
      src/scene/texture/value/ConstFloat_F.php

61
src/scene/texture/deformation/Distort.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);
}
}
?>

28
src/scene/texture/procedural/ObjectId.php

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

28
src/scene/texture/procedural/ObjectIdColor.php

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

28
src/scene/texture/procedural/ObjectIdNormalized.php

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

28
src/scene/texture/procedural/Position.php

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

46
src/scene/texture/procedural/Random.php

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

28
src/scene/texture/procedural/ShadingNormal.php

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

69
src/scene/texture/tint/BrightContrast.php

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

82
src/scene/texture/tint/Hsv.php

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

56
src/scene/texture/tint/Subtract.php

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

1
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\texture\TextureBase;
use Blobt\Luxcore\scene\Scene; use Blobt\Luxcore\scene\Scene;
use Blobt\Luxcore\core\Base; use Blobt\Luxcore\core\Base;
use Blobt\Luxcore\scene\texture\mapping\Mapping;
class ImageMap extends TextureBase class ImageMap extends TextureBase
{ {

23
src/scene/texture/value/ConstFloat_C.php

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

23
src/scene/texture/value/ConstFloat_F.php

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