yuanjiajia
3 years ago
4 changed files with 203 additions and 6 deletions
-
86src/scene/lights/CorlorConst.php
-
104src/scene/lights/HdrImage.php
-
5src/scene/lights/LightBase.php
-
12src/scene/lights/Sky.php
@ -0,0 +1,86 @@ |
|||||
|
<?php |
||||
|
|
||||
|
namespace Blobt\Luxcore\scene\ligths; |
||||
|
use Blobt\Luxcore\scene\Scene; |
||||
|
use Blobt\Luxcore\core\Base; |
||||
|
use Blobt\Luxcore\scene\render\cache\VisibilityMapCache; |
||||
|
|
||||
|
class CorlorConst extends LightBase |
||||
|
{ |
||||
|
|
||||
|
/** |
||||
|
* 天光 |
||||
|
*/ |
||||
|
const TYPE_CONSTANTINFINITE = 'constantinfinite'; |
||||
|
|
||||
|
/** |
||||
|
* @var string 增益,色彩模式的色值($color) 或 色温模式的色温值(会规格化为一个普通色值) 的增益倍数,这个倍数是 |
||||
|
* 由 UI界面中曝光参数(如果开启)、与UI界面中增益倍数的计算结果 |
||||
|
*/ |
||||
|
public $gain = "1 1 1"; |
||||
|
|
||||
|
/** |
||||
|
* @var string 天光颜色,分两种情况:1、当色彩模式开启,色温模式半闭时,这里的参数是一组小数形式RGB三通道的色值 |
||||
|
* 2、当色彩模式关闭,色温模式开启时,这里只能取一个固定的色值 ”1 1 1“ |
||||
|
*/ |
||||
|
public $color = "1 1 1"; |
||||
|
|
||||
|
/** |
||||
|
* @var float 色温模式,开关状态与色彩互斥,1、当取值为0-13000的小数时(会被转化为一个普通色值),色温模式开启,色彩模式关闭。 |
||||
|
* 2、当取值为-1时,色温模式关闭,色彩模式启。 |
||||
|
*/ |
||||
|
public $temperature = -1; |
||||
|
|
||||
|
/** |
||||
|
* @var bool 是否将色温模式下的色温值规格化为小数形式的RGB色值,色温模式开启,色彩模式关闭 |
||||
|
*/ |
||||
|
public $temperatureNormalize = self::CLOSE; |
||||
|
|
||||
|
/** |
||||
|
* @var string 一个由16个数据组成模型的空间位置参数,包抱位置坐标,旋转参数,缩放参数 |
||||
|
*/ |
||||
|
public $transformation = "1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1"; |
||||
|
|
||||
|
/** |
||||
|
* @var bool 是否使用天光缓存 |
||||
|
*/ |
||||
|
public $visibilitymapcacheEnable = self::CLOSE; |
||||
|
|
||||
|
/** |
||||
|
* @var object 一个天光缓存对象 |
||||
|
*/ |
||||
|
public $envLightCache; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* @param array $config 接收一个数组,可以初始化当前实例化对象的各种属性 |
||||
|
*/ |
||||
|
public function __construct($config = [],Visibility $visibility = null) |
||||
|
{ |
||||
|
if( $visibility != null )$this->visibility = $visibility; |
||||
|
else $this->visibility = new Visibility(); |
||||
|
$this->type = self::TYPE_CONSTANTINFINITE; |
||||
|
$this->id = Scene::createID(); |
||||
|
Base::__construct($config); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 打开天光缓存 |
||||
|
*/ |
||||
|
public function openCache() |
||||
|
{ |
||||
|
$this->visibilitymapcacheEnable = self::OPEN; |
||||
|
$this->envLightCache = new VisibilityMapCache; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 关闭天光缓存 |
||||
|
*/ |
||||
|
public function closeCache() |
||||
|
{ |
||||
|
$this->visibilitymapcacheEnable = self::CLOSE; |
||||
|
$this->envLightCache = null; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
?>
|
@ -0,0 +1,104 @@ |
|||||
|
<?php |
||||
|
|
||||
|
namespace Blobt\Luxcore\scene\ligths; |
||||
|
use Blobt\Luxcore\scene\Scene; |
||||
|
use Blobt\Luxcore\core\Base; |
||||
|
use Blobt\Luxcore\scene\render\cache\VisibilityMapCache; |
||||
|
|
||||
|
class HdrImage extends LightBase |
||||
|
{ |
||||
|
|
||||
|
/** |
||||
|
* 天光 |
||||
|
*/ |
||||
|
const TYPE_INFINITE = 'infinite'; |
||||
|
|
||||
|
/** |
||||
|
* @var string 增益,分两种情况:1、当色彩模式开启,色温模式半闭时,这里的参数是一个HDR图像文件色值的倍数,这个倍数是由 UI界面中 |
||||
|
* 色彩模式的色值、UI界面中曝光参数(如果开启)、与UI界面中增益倍数的计算结果。 |
||||
|
* 2、当色彩模式关闭,色温模式开启时,这里的参数就是 色温值与HDR图像文件色值合成结果 的倍数,这个倍数是由 UI |
||||
|
* 界面中曝光参数(如果开启)、与UI界面中增益倍数的计算结果。 |
||||
|
*/ |
||||
|
public $gain = "1 1 1"; |
||||
|
|
||||
|
/** |
||||
|
* @var float 色温模式,开关状态与色彩互斥,1、当取值为0-13000的小数时,色温模式开启,色彩模式关闭,这个色温值值会被转化为一个普通色值与HDR |
||||
|
* 图像文件色值进行合成。 |
||||
|
* 2、当取值为-1时,色温模式关闭,色彩模式启。 |
||||
|
*/ |
||||
|
public $temperature = -1; |
||||
|
|
||||
|
/** |
||||
|
* @var bool 是否将色温模式下的色温值规格化为小数形式的RGB色值,色温模式开启,色彩模式关闭 |
||||
|
*/ |
||||
|
public $temperatureNormalize = self::CLOSE; |
||||
|
|
||||
|
/** |
||||
|
* @var string HDR图你文件,分两种情况:1、当色彩模式开启,色温模式半闭时,这个 HDR图像文件的色值 不与 UI界面中色彩模式的色值 合成 |
||||
|
* 2、当色彩模式关闭,色温模式开启时,这个 HDR图像文件的色值 将与 色温值(会被转化为一个普通色值) 合成 |
||||
|
*/ |
||||
|
public $file = "1 1 1"; |
||||
|
|
||||
|
/** |
||||
|
* @var float 咖玛值,是$file 的校正参数 |
||||
|
*/ |
||||
|
public $gamma = 1; |
||||
|
|
||||
|
/** |
||||
|
* @var string 一个由16个数据组成模型的空间位置参数,包抱位置坐标,旋转参数,缩放参数 |
||||
|
*/ |
||||
|
public $transformation = "1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1"; |
||||
|
|
||||
|
/** |
||||
|
* @var string 输出图片储存方式 |
||||
|
*/ |
||||
|
public $storage = "float"; |
||||
|
|
||||
|
/** |
||||
|
* @var bool 是否半球采样(取值:默认false) |
||||
|
*/ |
||||
|
public $sampleupperhemisphereonly = self::CLOSE; |
||||
|
|
||||
|
/** |
||||
|
* @var bool 是否使用天光缓存 |
||||
|
*/ |
||||
|
public $visibilitymapcacheEnable = self::CLOSE; |
||||
|
|
||||
|
/** |
||||
|
* @var object 一个天光缓存对象 |
||||
|
*/ |
||||
|
public $envLightCache; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* @param array $config 接收一个数组,可以初始化当前实例化对象的各种属性 |
||||
|
*/ |
||||
|
public function __construct($config = [],Visibility $visibility = null) |
||||
|
{ |
||||
|
if( $visibility != null )$this->visibility = $visibility; |
||||
|
else $this->visibility = new Visibility(); |
||||
|
$this->type = self::TYPE_INFINITE; |
||||
|
$this->id = Scene::createID(); |
||||
|
Base::__construct($config); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 打开天光缓存 |
||||
|
*/ |
||||
|
public function openCache() |
||||
|
{ |
||||
|
$this->visibilitymapcacheEnable = self::OPEN; |
||||
|
$this->envLightCache = new VisibilityMapCache; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 关闭天光缓存 |
||||
|
*/ |
||||
|
public function closeCache() |
||||
|
{ |
||||
|
$this->visibilitymapcacheEnable = self::CLOSE; |
||||
|
$this->envLightCache = null; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
?>
|
Write
Preview
Loading…
Cancel
Save
Reference in new issue