Browse Source

新增四个程序纹理的类文件

master
yuanjiajia 3 years ago
parent
commit
e73c300286
  1. 52
      src/scene/texture/procedural/BlenderNoise.php
  2. 99
      src/scene/texture/procedural/BlenderStucci.php
  3. 99
      src/scene/texture/procedural/BlenderVoronoi.php
  4. 112
      src/scene/texture/procedural/BlenderWood.php

52
src/scene/texture/procedural/BlenderNoise.php

@ -0,0 +1,52 @@
<?php
namespace Blobt\Luxcore\scene\texture\procedural;
use Blobt\Luxcore\scene\texture\TextureBase;
use Blobt\Luxcore\scene\Scene;
use Blobt\Luxcore\core\Base;
use Blobt\Luxcore\scene\texture\mapping\Mapping;
class BlenderNoise extends TextureBase
{
/**
* Blender原生的澡波的程序纹理
*/
const TYPE_BLENDER_NOISE = 'blender_noise';
/**
* @var integer 噪波深度,(取值:0-10的整数)
*/
public $noisedepth = 2;
/**
* @var float 亮度,(取值:大于等于0的小数)
*/
public $bright = 1;
/**
* @var float 对比度,(取值:大于等于0的小数)
*/
public $contrast = 1;
/**
* @var object 铺贴参数,一个Mapping类对象
*/
public $mapping;
/**
* @param array $config 接收一个数组,可以初始化当前实例化对象的各种属性
* @param object $mapping 如需自定义铺贴参数,必须传入一个 Mapping类对象,否则使用一个默认的铺贴参数
*/
public function __construct($config = [],Mapping $mapping = null)
{
if( $mapping != null )$this->mapping = $mapping;
else $this->mapping = new Mapping();
$this->type = self::TYPE_BLENDER_NOISE;
$this->id = Scene::createID();
Base::__construct($config);
}
}
?>

99
src/scene/texture/procedural/BlenderStucci.php

@ -0,0 +1,99 @@
<?php
namespace Blobt\Luxcore\scene\texture\procedural;
use Blobt\Luxcore\scene\texture\TextureBase;
use Blobt\Luxcore\scene\Scene;
use Blobt\Luxcore\core\Base;
use Blobt\Luxcore\scene\texture\mapping\Mapping;
class BlenderStucci extends TextureBase
{
/**
* Blender原生的斯氏分形的程序纹理
*/
const TYPE_BLENDER_STUCCI = 'blender_stucci';
/**
* 噪波的 柔和 锐利 类型
*/
const TYPE_SOFT_NOISE = 'soft_noise';
const TYPE_HARD_NOISE = 'hard_noise';
/**
* 噪波效果 原型
*/
const TYPE_BLENDER_ORIGINAL = 'blender_original';
const TYPE_ORIGINAL_PERLIN = 'original_perlin';
const TYPE_IMPROVED_PERLIN = 'oimproved_perlin';
const TYPE_VORONOI_F1 = 'voronoi_f1';
const TYPE_VORONOI_F2 = 'voronoi_f2';
const TYPE_VORONOI_F3 = 'voronoi_f3';
const TYPE_VORONOI_F4 = 'voronoi_f4';
const TYPE_VORONOI_CRACKLE = 'voronoi_crackle';
const TYPE_CELL_NOISE = 'cell_noise';
/**
* 斯氏分形
*/
const TYPE_PLASTIC = 'plastic'; //塑性
const TYPE_WALL_IN = 'wall_in'; //内凹
const TYPE_WALL_OUT = 'wall_out'; //外凸
/**
* @var string 噪波的 柔和 锐利 类型,(取值:soft_noise或hard_noise)
*/
public $noisetype = self::TYPE_SOFT_NOISE;
/**
* @var string 斯氏分形 类型,取值是一个属于 斯氏分形类型 的字符串常量
*/
public $stuccitype = self::TYPE_PLASTIC;
/**
* @var string 噪波效果 原型,取值是一个属于 噪波效果原型 的字符串常量
*/
public $noisebasis = self::TYPE_BLENDER_ORIGINAL;
/**
* @var float 噪波大小,单位跟随系统,(取值:大于0的小数)
*/
public $noisesize = 0.25;
/**
* @var float 湍流,(取值:大于0的小数)
*/
public $turbulence = 5;
/**
* @var float 亮度,(取值:大于等于0的小数)
*/
public $bright = 1;
/**
* @var float 对比度,(取值:大于等于0的小数)
*/
public $contrast = 1;
/**
* @var object 铺贴参数,一个Mapping类对象
*/
public $mapping;
/**
* @param array $config 接收一个数组,可以初始化当前实例化对象的各种属性
* @param object $mapping 如需自定义铺贴参数,必须传入一个 Mapping类对象,否则使用一个默认的铺贴参数
*/
public function __construct($config = [],Mapping $mapping = null)
{
if( $mapping != null )$this->mapping = $mapping;
else $this->mapping = new Mapping();
$this->type = self::TYPE_BLENDER_STUCCI;
$this->id = Scene::createID();
Base::__construct($config);
}
}
?>

99
src/scene/texture/procedural/BlenderVoronoi.php

@ -0,0 +1,99 @@
<?php
namespace Blobt\Luxcore\scene\texture\procedural;
use Blobt\Luxcore\scene\texture\TextureBase;
use Blobt\Luxcore\scene\Scene;
use Blobt\Luxcore\core\Base;
use Blobt\Luxcore\scene\texture\mapping\Mapping;
class BlenderVoronoi extends TextureBase
{
/**
* Blender原生的沃罗诺伊图的程序纹理
*/
const TYPE_BLENDER_VORONOI = 'blender_voronoi';
/**
* 矩阵间隔
*/
const TYPE_BLENDER_ORIGINAL = 'actual_distance'; //实际间隔
const TYPE_ORIGINAL_PERLIN = 'distance_squared'; //方形矩阵间隔
const TYPE_MANHATTAN = 'manhattan'; //曼哈顿点距
const TYPE_CHEBYCHEV = 'chebychev'; //切比雪夫
/**
* @var string 矩阵间隔 类型,取值是一个属于 矩阵间隔 的字符串常量
*/
public $distancemetric = self::TYPE_BLENDER_ORIGINAL;
/**
* @var float 强度,(固定取值:1)
*/
public $intensity = 1;
/**
* @var float 指数,(取值:任意自然数)
*/
public $exponent = 2;
/**
* @var float 噪波大小,单位跟随系统,(取值:大于0的小数)
*/
public $noisesize = 0.25;
/**
* @var float 权重1,(取值:-2至2的小数)
*/
public $w1 = 1;
/**
* @var float 权重2,(取值:-2至2的小数)
*/
public $w2 = 0;
/**
* @var float 权重3,(取值:-2至2的小数)
*/
public $w3 = 0;
/**
* @var float 权重4,(取值:-2至2的小数)
*/
public $w4 = 0;
/**
* @var float 亮度,(取值:大于等于0的小数)
*/
public $bright = 1;
/**
* @var float 对比度,(取值:大于等于0的小数)
*/
public $contrast = 1;
/**
* @var object 铺贴参数,一个Mapping类对象
*/
public $mapping;
/**
* @param array $config 接收一个数组,可以初始化当前实例化对象的各种属性
* @param object $mapping 如需自定义铺贴参数,必须传入一个 Mapping类对象,否则使用一个默认的铺贴参数
*/
public function __construct($config = [],Mapping $mapping = null)
{
if( $mapping != null )$this->mapping = $mapping;
else $this->mapping = new Mapping();
$this->type = self::TYPE_BLENDER_VORONOI;
$this->id = Scene::createID();
Base::__construct($config);
}
}
?>

112
src/scene/texture/procedural/BlenderWood.php

@ -0,0 +1,112 @@
<?php
namespace Blobt\Luxcore\scene\texture\procedural;
use Blobt\Luxcore\scene\texture\TextureBase;
use Blobt\Luxcore\scene\Scene;
use Blobt\Luxcore\core\Base;
use Blobt\Luxcore\scene\texture\mapping\Mapping;
class BlenderWood extends TextureBase
{
/**
* Blender原生的木纹的程序纹理
*/
const TYPE_BLENDER_WOOD = 'blender_wood';
/**
* 基础的木纹图形
*/
const TYPE_BANDS = 'bands'; //条带
const TYPE_RINGS = 'rings'; //环
const TYPE_BANDNOISE = 'bandnoise'; //条带噪波
const TYPE_RINGNOISE = 'ringnoise'; //环噪波
/**
* 噪波的 柔和 锐利 类型
*/
const TYPE_SOFT_NOISE = 'soft_noise';
const TYPE_HARD_NOISE = 'hard_noise';
/**
* 噪波效果 原型
*/
const TYPE_BLENDER_ORIGINAL = 'blender_original';
const TYPE_ORIGINAL_PERLIN = 'original_perlin';
const TYPE_IMPROVED_PERLIN = 'oimproved_perlin';
const TYPE_VORONOI_F1 = 'voronoi_f1';
const TYPE_VORONOI_F2 = 'voronoi_f2';
const TYPE_VORONOI_F3 = 'voronoi_f3';
const TYPE_VORONOI_F4 = 'voronoi_f4';
const TYPE_VORONOI_CRACKLE = 'voronoi_crackle';
const TYPE_CELL_NOISE = 'cell_noise';
/**
* 波形效果 原型
*/
const TYPE_SIN = 'sin'; //正玄波
const TYPE_SAW = 'saw'; //锯齿波
const TYPE_TRI = 'tri'; //三角波
/**
* @var string 基础的木纹图形,取值是一个属于 基础的木纹图形 的字符串常量
*/
public $woodtype = self::TYPE_BANDS;
/**
* @var string 噪波的 柔和 锐利 类型,(取值:soft_noise或hard_noise)
*/
public $noisetype = self::TYPE_SOFT_NOISE;
/**
* @var string 噪波效果 原型,取值是一个属于 噪波效果原型 的字符串常量
*/
public $noisebasis = self::TYPE_BLENDER_ORIGINAL;
/**
* @var string 波形效果 原型,取值是一个属于 波形效果原型 的字符串常量
*/
public $noisebasis2 = self::TYPE_SIN;
/**
* @var float 噪波大小,单位跟随系统,(取值:大于0的小数)
*/
public $noisesize = 0.25;
/**
* @var float 湍流,(取值:大于0的小数)
*/
public $turbulence = 5;
/**
* @var float 亮度,(取值:大于等于0的小数)
*/
public $bright = 1;
/**
* @var float 对比度,(取值:大于等于0的小数)
*/
public $contrast = 1;
/**
* @var object 铺贴参数,一个Mapping类对象
*/
public $mapping;
/**
* @param array $config 接收一个数组,可以初始化当前实例化对象的各种属性
* @param object $mapping 如需自定义铺贴参数,必须传入一个 Mapping类对象,否则使用一个默认的铺贴参数
*/
public function __construct($config = [],Mapping $mapping = null)
{
if( $mapping != null )$this->mapping = $mapping;
else $this->mapping = new Mapping();
$this->type = self::TYPE_BLENDER_WOOD;
$this->id = Scene::createID();
Base::__construct($config);
}
}
?>
Loading…
Cancel
Save