Browse Source

修改了“print.php”、“Film.php”两个类文件,新增了“CammaCorrection.php”、“Pretreatment.php”、“ToneMapCamera.php”、“ToneMapLinear.php”、“ToneMapReinhard.php”五个类文件

master
yuanjiajia 3 years ago
parent
commit
fede7e07a1
  1. 9
      examples/print.php
  2. 21
      src/scene/CammaCorrection.php
  3. 18
      src/scene/Film.php
  4. 17
      src/scene/Pretreatment.php
  5. 31
      src/scene/ToneMapCamera.php
  6. 21
      src/scene/ToneMapLinear.php
  7. 31
      src/scene/ToneMapReinhard.php

9
examples/print.php

@ -6,7 +6,7 @@ namespace Blobt\Luxcore\scene;
include dirname(dirname(__FILE__)) . "/vendor/autoload.php"; include dirname(dirname(__FILE__)) . "/vendor/autoload.php";
/*
//设置打印渲染引擎的配置参数 //设置打印渲染引擎的配置参数
$renderEngine = new RenderEngine(); $renderEngine = new RenderEngine();
echo $renderEngine; echo $renderEngine;
@ -35,9 +35,16 @@ echo $lightStrategy;
//设置打印 文件储存格式 配置参数 //设置打印 文件储存格式 配置参数
$filesaver = new FileSaver(); $filesaver = new FileSaver();
echo $filesaver; echo $filesaver;
*/
//设置打印 “胶片” 配置参数 //设置打印 “胶片” 配置参数
$film = new Film(); $film = new Film();
$film->outputs[] = new ImageSaverBase(['type' => ImageSaverBase::TYPE_RGBA ]);
$film->outputs[] = new ImageSaverBase(['type' => ImageSaverBase::TYPE_MATERIAL_ID ]);
$film->outputs[] = new ImageSaverNumber(['index' => 2 ]);
$film->imagepipelines['002'] = [new NoiseReducerOIDN(),new Pretreatment(),new ToneMapCamera(),new CammaCorrection()];
echo $film; echo $film;
?> ?>

21
src/scene/CammaCorrection.php

@ -0,0 +1,21 @@
<?php
namespace Blobt\Luxcore\scene;
class CammaCorrection extends BaseCfg
{
/**
* @var string 颜色映射类型为 线性倍增,(固定取值:TONEMAP_LINEAR)
*/
public $type = "GAMMA_CORRECTION";
/**
* @var float 亮度增益,(取值:0-100的小数)
*/
public $value = 2.2;
}
?>

18
src/scene/Film.php

@ -46,25 +46,25 @@ class Film extends BaseCfg
*/ */
public $outputs; public $outputs;
/** /**
* 实例 PathDepth类、HybridBackforWard类的两个对象,初始化数组“$imagepipelines;
* 实例 NoiseEstimation类、filter类的两个对象,配置渲染器默认的输出参数”;
*/ */
public function __construct($config = []) public function __construct($config = [])
{ {
$this->noiseEstimation = new NoiseEstimation($config); $this->noiseEstimation = new NoiseEstimation($config);
$this->filter = new Filter($config); $this->filter = new Filter($config);
$this->imagepipelines[] = new NoiseReducerOIDN();
$this->imagepipelines[] = new NoiseReducerBCD();
$this->outputs[] = new ImageSaverNumber(['index' => 0]);
$this->imagepipelines['000'] = [new Pretreatment(),new ToneMapLinear(),new CammaCorrection()];
$this->outputs[] = new ImageSaverBase();
$this->outputs[] = new ImageSaverNumber();
$this->outputs[] = new ImageSaverBase(['type' => 'ALBEDO']);
$this->outputs[] = new ImageSaverBase(['type' => 'AVG_SHADING_NORMAL']);
//var_dump($this->outputs);
$this->outputs[] = new ImageSaverNumber(['index' => 1]);
$this->imagepipelines['001'] = [new NoiseReducerOIDN(),new Pretreatment(),new ToneMapLinear(),new CammaCorrection()];
Base::__construct($config); Base::__construct($config);
} }
} }

17
src/scene/Pretreatment.php

@ -0,0 +1,17 @@
<?php
namespace Blobt\Luxcore\scene;
class Pretreatment extends BaseCfg
{
/**
* @var string TODO:本类尚未明确对 图像 产生何种具体效果,包括类名也没有代表其真实意义,只是因为在图像管线处理中,此类始终位于其他 effect类 的前面,因此
* 暂将此类命名为“Pretreatment(预处理)”。其"$type"属性,也尚未查出其他可选的值,其默认的“NOP”值,实质就表示本类没对图像施加任何效果。
*/
public $type = "NOP";
}
?>

31
src/scene/ToneMapCamera.php

@ -0,0 +1,31 @@
<?php
namespace Blobt\Luxcore\scene;
class ToneMapCamera extends BaseCfg
{
/**
* @var string 一种模拟照相机曝光参数的颜色映射类型,(固定取值:TONEMAP_LINEAR)
*/
public $type = "TONEMAP_LUXLINEAR";
/**
* @var float 光圈大小,(取值:大于0的的小数)
*/
public $fstop = 2.8;
/**
* @var float 曝光时长,(取值:大于等于0的的小数)
*/
public $exposure = 0.01;
/**
* @var float 胶片感光度,(取值:大于等于0的的小数)
*/
public $sensitivity = 100;
}
?>

21
src/scene/ToneMapLinear.php

@ -0,0 +1,21 @@
<?php
namespace Blobt\Luxcore\scene;
class ToneMapLinear extends BaseCfg
{
/**
* @var string 颜色映射类型为 线性倍增,(固定取值:TONEMAP_LINEAR)
*/
public $type = "TONEMAP_LINEAR";
/**
* @var float 亮度增益,(取值:0-100的小数)
*/
public $scale = 1;
}
?>

31
src/scene/ToneMapReinhard.php

@ -0,0 +1,31 @@
<?php
namespace Blobt\Luxcore\scene;
class ToneMapReinhard extends BaseCfg
{
/**
* @var string 一种名为 ToneMapReinhard(莱茵哈德) 的颜色映射类型,(固定取值:TONEMAP_REINHARD02)
*/
public $type = "TONEMAP_LUXLINEAR";
/**
* @var float TODO:具体作用尚未明确,(取值:0-25的小数)
*/
public $prescale = 1;
/**
* @var float TODO:具体作用尚未明确,(取值:0-25的小数)
*/
public $postscale = 1.2;
/**
* @var float TODO:具体作用尚未明确,(取值:大于0-25的小数)
*/
public $burn = 6;
}
?>
Loading…
Cancel
Save