|
|
@ -1,9 +1,11 @@ |
|
|
|
<?php |
|
|
|
|
|
|
|
namespace Blobt\Luxcore\scene; |
|
|
|
use Blobt\Luxcore\core\Base; |
|
|
|
|
|
|
|
class ImageSaverBase extends BaseCfg |
|
|
|
{ |
|
|
|
|
|
|
|
/** |
|
|
|
* 序列输出,根据需要的效果,进行相应的管线处理。文件保存格式:png |
|
|
|
*/ |
|
|
@ -22,8 +24,6 @@ class ImageSaverBase extends BaseCfg |
|
|
|
const TYPE_DIRECT_SHADOW_MASK = 'DIRECT_SHADOW_MASK'; |
|
|
|
const TYPE_INDIRECT_SHADOW_MASK = 'INDIRECT_SHADOW_MASK'; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
* Basic informatin(基本信息)不需要管线处理,文件保存格式:exr |
|
|
@ -51,15 +51,75 @@ class ImageSaverBase extends BaseCfg |
|
|
|
const TYPE_SAMPLECOUNT = 'SAMPLECOUNT'; |
|
|
|
const TYPE_CONVERGENCE = 'CONVERGENCE'; |
|
|
|
const TYPE_NOISE = 'NOISE'; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const PNG = [ |
|
|
|
self::TYPE_RGB_IMAGEPIPELINE, |
|
|
|
self::TYPE_MATERIAL_ID, |
|
|
|
self::TYPE_OBJECT_ID, |
|
|
|
self::TYPE_MATERIAL_ID_COLOR, |
|
|
|
self::TYPE_DIRECT_SHADOW_MASK, |
|
|
|
self::TYPE_INDIRECT_SHADOW_MASK |
|
|
|
]; |
|
|
|
|
|
|
|
const EXR = [ |
|
|
|
self::TYPE_ALBEDO, |
|
|
|
self::TYPE_RGB, |
|
|
|
self::TYPE_DEPTH, |
|
|
|
self::TYPE_RGBA, |
|
|
|
self::TYPE_ALPHA, |
|
|
|
self::TYPE_POSITION, |
|
|
|
self::TYPE_GEOMETRY_NORMAL, |
|
|
|
self::TYPE_SHADING_NORMAL, |
|
|
|
self::TYPE_UV, |
|
|
|
self::TYPE_AVG_SHADING_NORMAL, |
|
|
|
self::TYPE_IRRADIANCE, |
|
|
|
self::TYPE_RAYCOUNT, |
|
|
|
self::TYPE_SAMPLECOUNT, |
|
|
|
self::TYPE_CONVERGENCE, |
|
|
|
self::TYPE_NOISE |
|
|
|
]; |
|
|
|
|
|
|
|
/** |
|
|
|
* @var string 使用何种渲染引擎(可取值是 PATHCPU、PATHGPU、BIDIRCPU 三个字符串之一) |
|
|
|
* @var string 渲染的图像类型 |
|
|
|
*/ |
|
|
|
public $type = self::TYPE_RGB_IMAGEPIPELINE; |
|
|
|
|
|
|
|
/** |
|
|
|
* @var float 随机种子(取值:大于0的整数) |
|
|
|
* @var string 图像输出文件名及格式 |
|
|
|
*/ |
|
|
|
public $filename = self::TYPE_RGB_IMAGEPIPELINE."png"; |
|
|
|
public $filename; |
|
|
|
|
|
|
|
/** |
|
|
|
* 设置默认的图像输出文件名及格式 |
|
|
|
*/ |
|
|
|
public function __construct($config = []) |
|
|
|
{ |
|
|
|
|
|
|
|
Base::__construct($config); |
|
|
|
if( in_array($this->type,self::PNG ) ) |
|
|
|
{ |
|
|
|
$this->filename = "{$this->type}.png"; |
|
|
|
} |
|
|
|
else if ( in_array($this->type,self::EXR) ) |
|
|
|
{ |
|
|
|
$this->filename = "{$this->type}.exr"; |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
$this->filename = "{$this->type}.jpg"; |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
* 用户自定的图像输出文件名及格式 |
|
|
|
*/ |
|
|
|
public function setFileName($nameStr) |
|
|
|
{ |
|
|
|
$this->filename = $nameStr; |
|
|
|
} |
|
|
|
} |
|
|
|
?>
|