diff --git a/examples/print.php b/examples/print.php index 714ae93..a44f846 100644 --- a/examples/print.php +++ b/examples/print.php @@ -6,7 +6,7 @@ namespace Blobt\Luxcore\scene; include dirname(dirname(__FILE__)) . "/vendor/autoload.php"; - +/* //设置打印渲染引擎的配置参数 $renderEngine = new RenderEngine(); echo $renderEngine; @@ -35,9 +35,16 @@ echo $lightStrategy; //设置打印 文件储存格式 配置参数 $filesaver = new FileSaver(); echo $filesaver; +*/ //设置打印 “胶片” 配置参数 $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; ?> diff --git a/src/scene/CammaCorrection.php b/src/scene/CammaCorrection.php new file mode 100644 index 0000000..d5f7779 --- /dev/null +++ b/src/scene/CammaCorrection.php @@ -0,0 +1,21 @@ + diff --git a/src/scene/Film.php b/src/scene/Film.php index 7bf0768..5e6ac4c 100644 --- a/src/scene/Film.php +++ b/src/scene/Film.php @@ -46,25 +46,25 @@ class Film extends BaseCfg */ public $outputs; - - /** - * 实例 PathDepth类、HybridBackforWard类的两个对象,初始化数组“$imagepipelines”; + * 实例 NoiseEstimation类、filter类的两个对象,配置渲染器默认的输出参数”; */ public function __construct($config = []) { + $this->noiseEstimation = new NoiseEstimation($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); + } } diff --git a/src/scene/Pretreatment.php b/src/scene/Pretreatment.php new file mode 100644 index 0000000..0b444a5 --- /dev/null +++ b/src/scene/Pretreatment.php @@ -0,0 +1,17 @@ + diff --git a/src/scene/ToneMapCamera.php b/src/scene/ToneMapCamera.php new file mode 100644 index 0000000..b796bdd --- /dev/null +++ b/src/scene/ToneMapCamera.php @@ -0,0 +1,31 @@ + diff --git a/src/scene/ToneMapLinear.php b/src/scene/ToneMapLinear.php new file mode 100644 index 0000000..03ac436 --- /dev/null +++ b/src/scene/ToneMapLinear.php @@ -0,0 +1,21 @@ + diff --git a/src/scene/ToneMapReinhard.php b/src/scene/ToneMapReinhard.php new file mode 100644 index 0000000..046165c --- /dev/null +++ b/src/scene/ToneMapReinhard.php @@ -0,0 +1,31 @@ +