From fede7e07a1bf12b6f167afc533778f1decaef05f Mon Sep 17 00:00:00 2001 From: yuanjiajia <1139393632@qq.com> Date: Mon, 14 Feb 2022 13:49:33 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=86=E2=80=9Cprint.php?= =?UTF-8?q?=E2=80=9D=E3=80=81=E2=80=9CFilm.php=E2=80=9D=E4=B8=A4=E4=B8=AA?= =?UTF-8?q?=E7=B1=BB=E6=96=87=E4=BB=B6=EF=BC=8C=E6=96=B0=E5=A2=9E=E4=BA=86?= =?UTF-8?q?=E2=80=9CCammaCorrection.php=E2=80=9D=E3=80=81=E2=80=9CPretreat?= =?UTF-8?q?ment.php=E2=80=9D=E3=80=81=E2=80=9CToneMapCamera.php=E2=80=9D?= =?UTF-8?q?=E3=80=81=E2=80=9CToneMapLinear.php=E2=80=9D=E3=80=81=E2=80=9CT?= =?UTF-8?q?oneMapReinhard.php=E2=80=9D=E4=BA=94=E4=B8=AA=E7=B1=BB=E6=96=87?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- examples/print.php | 9 ++++++++- src/scene/CammaCorrection.php | 21 +++++++++++++++++++++ src/scene/Film.php | 18 +++++++++--------- src/scene/Pretreatment.php | 17 +++++++++++++++++ src/scene/ToneMapCamera.php | 31 +++++++++++++++++++++++++++++++ src/scene/ToneMapLinear.php | 21 +++++++++++++++++++++ src/scene/ToneMapReinhard.php | 31 +++++++++++++++++++++++++++++++ 7 files changed, 138 insertions(+), 10 deletions(-) create mode 100644 src/scene/CammaCorrection.php create mode 100644 src/scene/Pretreatment.php create mode 100644 src/scene/ToneMapCamera.php create mode 100644 src/scene/ToneMapLinear.php create mode 100644 src/scene/ToneMapReinhard.php 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 @@ +