From 58e9e79bfd4c33e4df0fe9266289322531707801 Mon Sep 17 00:00:00 2001 From: yuanjiajia <1139393632@qq.com> Date: Thu, 17 Feb 2022 14:00:20 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=80=E6=9C=89=E5=85=B3=E4=BA=8E=E7=81=AF?= =?UTF-8?q?=E5=85=89=E7=BC=93=E5=AD=98=E7=9A=84=E7=B1=BB=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E5=B7=B2=E7=BB=8F=E7=A7=BB=E5=8A=A8=E5=88=B0=E2=80=9Ccache?= =?UTF-8?q?=E2=80=9D=E7=9B=AE=E4=B8=8B=EF=BC=8C=E4=BF=AE=E6=94=B9=E4=BA=86?= =?UTF-8?q?=E2=80=9Cprint=E2=80=9D=E3=80=81=E2=80=9CFilm=E2=80=9D=E3=80=81?= =?UTF-8?q?=E2=80=9CLightStrategy=E2=80=9D=E3=80=81=E2=80=9CPath=E2=80=9D?= =?UTF-8?q?=E5=9B=9B=E4=B8=AA=E7=B1=BB=E6=96=87=E4=BB=B6=EF=BC=8Cluxcore?= =?UTF-8?q?=E6=B8=B2=E6=9F=93=E5=99=A8=E6=89=80=E6=9C=89=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E7=9A=84=E7=B1=BB=E6=96=87=E4=BB=B6=E5=B7=B2=E7=BB=8F=E5=86=99?= =?UTF-8?q?=E5=AE=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- examples/print.php | 5 ++- src/scene/Film.php | 2 +- src/scene/LightStrategy.php | 49 +---------------------------- src/scene/Path.php | 8 +++-- src/scene/{ => cache}/Caustic.php | 4 +-- src/scene/{ => cache}/Entry.php | 4 ++- src/scene/{ => cache}/Indirect.php | 4 +-- src/scene/cache/LightStrategy.php | 50 ++++++++++++++++++++++++++++++ src/scene/{ => cache}/PhotonGI.php | 5 +-- 9 files changed, 69 insertions(+), 62 deletions(-) rename src/scene/{ => cache}/Caustic.php (94%) rename src/scene/{ => cache}/Entry.php (93%) rename src/scene/{ => cache}/Indirect.php (92%) create mode 100644 src/scene/cache/LightStrategy.php rename src/scene/{ => cache}/PhotonGI.php (88%) diff --git a/examples/print.php b/examples/print.php index 095f58a..9d12938 100644 --- a/examples/print.php +++ b/examples/print.php @@ -16,7 +16,7 @@ echo $openCL; //设置打印光线跟踪的配置参数 $path = new Path(); -$path->photonGI = new PhotonGI(); +$path->photonGI = new cache\PhotonGI(); echo $path; //设置打印 采样器 配置参数 @@ -24,8 +24,7 @@ $sampler = new Sampler(); echo $sampler; //设置打印 灯光策略 配置参数 -$lightStrategy = new LightStrategy(); -$lightStrategy->openLightCache(); +$lightStrategy = new cache\LightStrategy(); echo $lightStrategy; //设置打印 文件储存格式 配置参数 diff --git a/src/scene/Film.php b/src/scene/Film.php index 9518384..d9b7b37 100644 --- a/src/scene/Film.php +++ b/src/scene/Film.php @@ -30,7 +30,7 @@ class Film extends BaseCfg /** - * @var object 一个 NoiseEstimation类 的实例对象 + * @var object 一个 NoiseEstimation类 的实例对象,当采样器实设置为“Metropolis ”,此项参数不需要输出 */ public $noiseEstimation; diff --git a/src/scene/LightStrategy.php b/src/scene/LightStrategy.php index 7393532..65c5afb 100644 --- a/src/scene/LightStrategy.php +++ b/src/scene/LightStrategy.php @@ -11,57 +11,10 @@ class LightStrategy extends BaseCfg const TYPE_DLS_CACHE = 'DLS_CACHE'; /** - * @var string 使用何种灯光策略(可取值是 LOG_POWER、POWER、UNIFORM、DLS_CACHE 四个字符串之一,当值是DLS_CACHE时,直接光子缓存配置参数开启) + * @var string 使用何种灯光策略(可取值是 LOG_POWER、POWER、UNIFORM、DLS_CACHE 四个字符串之一,当值是 DLS_CACHE 时,直接光子缓存配置参数开启) */ public $type = self::TYPE_LOG_POWER; - /** - * @var float 光照阈值,(取值:0-1的小数) - */ - public $lightthreshold; - - /** - * @var float 目标缓存比率,(取值:0-1的小数) - */ - public $targetcachehitratio; - - /** - * @var integer 最大深度,(取值:大于等于0的整数) - */ - public $maxdepth; - - /** - * @var integer 最大采样数,(取值:大于等于0的整数,默认1000万) - */ - public $maxsamplescount; - - /** - * @var string 直接光缓存文件的路径用文件名 - */ - public $persistentFile; - - /** - * @var object 储存个Entry类对象 - */ - public $entry; - - public function openLightCache() - { - $this->type = self::TYPE_DLS_CACHE; - $this->maxdepth = 4; - $this->maxsamplescount = 1e+07; - $this->persistentFile = "C:\Users\ADMINI~1\AppData\Local\Temp\Untitled.dlsc"; - $this->entry = new Entry(); - } - - public function closeLightCache() - { - $this->type = self::TYPE_LOG_POWER; - $this->maxdepth = null; - $this->maxsamplescount = null; - $this->persistentFile = null; - $this->entry = null; - } } ?> diff --git a/src/scene/Path.php b/src/scene/Path.php index e03a12a..0f52ed8 100644 --- a/src/scene/Path.php +++ b/src/scene/Path.php @@ -12,10 +12,14 @@ class Path extends BaseCfg public $pathDepth; /** - * @var object 存储一个 HybridBackforWard类 对象 + * @var object 存储一个 HybridBackforWard类 对象,在调试模式下不需要输出这些字符串 */ public $hybridBackforWard; + + + + /** * @var bool 是否限制 单象素光线 最大跟踪数量 */ @@ -37,8 +41,6 @@ class Path extends BaseCfg - - /** * 实例 PathDepth类、HybridBackforWard类的两个对象 */ diff --git a/src/scene/Caustic.php b/src/scene/cache/Caustic.php similarity index 94% rename from src/scene/Caustic.php rename to src/scene/cache/Caustic.php index a784a91..e7b087e 100644 --- a/src/scene/Caustic.php +++ b/src/scene/cache/Caustic.php @@ -1,7 +1,7 @@ type = self::TYPE_DLS_CACHE; + $this->entry = new Entry($config); + Base::__construct($config); + } + +} + +?> diff --git a/src/scene/PhotonGI.php b/src/scene/cache/PhotonGI.php similarity index 88% rename from src/scene/PhotonGI.php rename to src/scene/cache/PhotonGI.php index ab1c4c3..e09c02d 100644 --- a/src/scene/PhotonGI.php +++ b/src/scene/cache/PhotonGI.php @@ -1,6 +1,7 @@