diff --git a/examples/print.php b/examples/print.php index cf206de..095f58a 100644 --- a/examples/print.php +++ b/examples/print.php @@ -16,6 +16,7 @@ echo $openCL; //设置打印光线跟踪的配置参数 $path = new Path(); +$path->photonGI = new PhotonGI(); echo $path; //设置打印 采样器 配置参数 @@ -24,6 +25,7 @@ echo $sampler; //设置打印 灯光策略 配置参数 $lightStrategy = new LightStrategy(); +$lightStrategy->openLightCache(); echo $lightStrategy; //设置打印 文件储存格式 配置参数 diff --git a/src/scene/Entry.php b/src/scene/Entry.php new file mode 100644 index 0000000..0c1bae7 --- /dev/null +++ b/src/scene/Entry.php @@ -0,0 +1,40 @@ + diff --git a/src/scene/LightStrategy.php b/src/scene/LightStrategy.php index f79091e..7393532 100644 --- a/src/scene/LightStrategy.php +++ b/src/scene/LightStrategy.php @@ -8,11 +8,60 @@ class LightStrategy extends BaseCfg const TYPE_LOG_POWER = 'LOG_POWER'; const TYPE_POWER = 'POWER'; const TYPE_UNIFORM = 'UNIFORM'; + const TYPE_DLS_CACHE = 'DLS_CACHE'; /** - * @var string 使用何种灯光策略(可取值是 LOG_POWER、POWER、UNIFORM 三个字符串之一) + * @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; + } } -?> \ No newline at end of file +?> diff --git a/src/scene/Path.php b/src/scene/Path.php index a156993..e03a12a 100644 --- a/src/scene/Path.php +++ b/src/scene/Path.php @@ -16,14 +16,6 @@ class Path extends BaseCfg */ public $hybridBackforWard; - /** - * @var object 存储一个 GhotonGI类 对象 - */ - public $photonGI; - - - - /** * @var bool 是否限制 单象素光线 最大跟踪数量 */ @@ -36,6 +28,15 @@ class Path extends BaseCfg + + /** + * @var object 存储一个 GhotonGI类 对象 + */ + public $photonGI; + + + + /**