Browse Source

修改ImagMap、Brick类文件注释,删除一个线框贴图类文件,新增一个 Fbm(石材纹理)类文件

master
yuanjiajia 3 years ago
parent
commit
cfacfb7462
  1. 4
      src/scene/texture/procedural/Brick.php
  2. 43
      src/scene/texture/procedural/Fbm.php
  3. 16
      src/scene/texture/procedural/ImageMap.php
  4. 71
      src/scene/texture/procedural/Wireframe.php

4
src/scene/texture/procedural/Brick.php

@ -66,12 +66,12 @@ class Brick extends TextureBase
public $mortarsize = 0.01; public $mortarsize = 0.01;
/** /**
* @var float 砖块互切(错位)百分比,(取值:0-1的小数)
* @var float TODO:砖块互切(错位)百分比,(取值:0-1的小数),此参数在UI界面中渲染正常的,但在控制台下失效。
*/ */
public $brickrun = 0.75; public $brickrun = 0.75;
/** /**
* @var object 调制偏置,(取值:-1至1的小数),当值越接近-1时,以$bricktex色的砖块就越多,反之接近1时,以
* @var float 调制偏置,(取值:-1至1的小数),当值越接近-1时,以$bricktex色的砖块就越多,反之接近1时,以
* $mortartex色的砖块就越多。 * $mortartex色的砖块就越多。
*/ */
public $brickmodbias = 0; public $brickmodbias = 0;

43
src/scene/texture/procedural/Fbm.php

@ -0,0 +1,43 @@
<?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 Fbm extends TextureBase
{
/**
* 分数布朗运动的程序纹理,可以生成类似大理石、花岗岩等石材纹理效果
*/
const TYPE_FBM = 'fbm';
/**
* @var integer 白色色块随机分布 在单位面积内 的数量比率,越小值,单位面积内分布的白色色块越少(也意味着每个色块的面积越大),
* 同时 roughness参数对结果的影响力越小,反之亦然,(取值1-29的整数)
*/
public $octaves = "8";
/**
* @var string 粗糙度,控制每个色块边缘向黑色过的平滑度,值越小,越平滑,同时 octaves参数对结果的影响力越小,反之亦然,(0-1的小数)
*/
public $roughness = 0.5;
/**
* @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_FBM;
$this->id = Scene::createID();
Base::__construct($config);
}
}
?>

16
src/scene/texture/procedural/ImageMap.php

@ -10,16 +10,15 @@ class ImageMap extends TextureBase
{ {
/** /**
* 加载外部图像文件的程序纹里
* 加载外部图像文件的程序纹里
*/ */
const TYPE_IMAGEMAP = 'imagemap'; const TYPE_IMAGEMAP = 'imagemap';
/** /**
* @var string 光域网文件名及路径,如果为空,则表示不使用光域网
* @var string 一个图像文件的文件名及所在路径组成的字符串
*/ */
public $file; public $file;
/** /**
* @var string 亮度增益,当发光强度单位是 artistic 类型时,或是 坎德拉类型且坎德拉参数下勾选为(每平方米时),可以设置此参数,分别 * @var string 亮度增益,当发光强度单位是 artistic 类型时,或是 坎德拉类型且坎德拉参数下勾选为(每平方米时),可以设置此参数,分别
* 控制自发光颜色RGB三个通道的放大倍数;否则固定为 1 1 1 * 控制自发光颜色RGB三个通道的放大倍数;否则固定为 1 1 1
@ -29,7 +28,7 @@ class ImageMap extends TextureBase
/** /**
* @var float 校正光域网文件的gamma值,(固定取值:1) * @var float 校正光域网文件的gamma值,(固定取值:1)
*/ */
public $gamma;
public $gamma = 2.2;
/** /**
* @var bool 是否随机重复 * @var bool 是否随机重复
@ -37,14 +36,15 @@ class ImageMap extends TextureBase
public $randomizedtilingEnable = self::CLOSE; public $randomizedtilingEnable = self::CLOSE;
/** /**
* @var object 铺贴参数,一个Mapping类对象
* @var string 输出图片储存方式
*/ */
public $mapping;
public $storage = 'byte';
/** /**
* @var string 输出图片储存方式
* @var object 铺贴参数,一个Mapping类对象
*/ */
public $storage = 'byte';
public $mapping;
/** /**
* @param object $mapping 如需自定义铺贴参数,必须传入一个 Mapping类对象,否则使用一个默认的铺贴参数 * @param object $mapping 如需自定义铺贴参数,必须传入一个 Mapping类对象,否则使用一个默认的铺贴参数

71
src/scene/texture/procedural/Wireframe.php

@ -1,71 +0,0 @@
<?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 Wireframe extends TextureBase
{
/**
* 线框的程序纹理
*/
const TYPE_WIREFRAME = 'wireframe';
/**
* @var string 线框颜色,一个小数形式的RGB色值,或是一个textures(贴图数组)中的某个键名
*/
public $border = "0.7 0.7 0.7";
/**
* @var string 内部面颜色,一个小数形式的RGB色值,或是一个textures(贴图数组)中的某个键名
*/
public $inside = "0.2 0.2 0.2";
/**
* @param array $config 接收一个数组,可以初始化当前实例化对象的各种属性
*/
public function __construct($config = [])
{
$this->type = self::TYPE_WIREFRAME;
$this->id = Scene::createID();
Base::__construct($config);
}
/**
* @param object $color 接收一个贴图对象或小数形式的色值,设置线框纹理的线框颜色
*/
public function setBricktex($color)
{
if( is_object($color) )
{
if( $color->registerId != null ) $this->bricktex = $color->registerId;
else
{
throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property");
}
}
else $this->bricktex = $color;
}
/**
* @param object $color 接收一个贴图对象或小数形式的色值,设置线框纹理的内部面颜色
*/
public function setBrickmodtex($color)
{
if( is_object($color) )
{
if( $color->registerId != null ) $this->brickmodtex = $color->registerId;
else
{
throw new \Exception("You use an unregistered ".$color->getInstanceClassName()." object for the current property");
}
}
else $this->brickmodtex = $color;
}
}
?>
Loading…
Cancel
Save