Browse Source

所有关于灯光缓存的类文件已经移动到“cache”目下,修改了“print”、“Film”、“LightStrategy”、“Path”四个类文件,luxcore渲染器所有参数的类文件已经写完

master
yuanjiajia 3 years ago
parent
commit
58e9e79bfd
  1. 5
      examples/print.php
  2. 2
      src/scene/Film.php
  3. 49
      src/scene/LightStrategy.php
  4. 8
      src/scene/Path.php
  5. 4
      src/scene/cache/Caustic.php
  6. 4
      src/scene/cache/Entry.php
  7. 4
      src/scene/cache/Indirect.php
  8. 50
      src/scene/cache/LightStrategy.php
  9. 5
      src/scene/cache/PhotonGI.php

5
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;
//设置打印 文件储存格式 配置参数

2
src/scene/Film.php

@ -30,7 +30,7 @@ class Film extends BaseCfg
/**
* @var object 一个 NoiseEstimation类 的实例对象
* @var object 一个 NoiseEstimation类 的实例对象,当采样器实设置为“Metropolis ”,此项参数不需要输出
*/
public $noiseEstimation;

49
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;
}
}
?>

8
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类的两个对象
*/

src/scene/Caustic.php → src/scene/cache/Caustic.php

src/scene/Entry.php → src/scene/cache/Entry.php

src/scene/Indirect.php → src/scene/cache/Indirect.php

50
src/scene/cache/LightStrategy.php

@ -0,0 +1,50 @@
<?php
namespace Blobt\Luxcore\scene\cache;
use Blobt\Luxcore\scene;
use Blobt\Luxcore\core\Base;
class LightStrategy extends scene\LightStrategy
{
/**
* @var float 光照阈值,(取值:0-1的小数)
*/
public $lightthreshold = 0.01;
/**
* @var float 目标缓存比率,(取值:0-1的小数)
*/
public $targetcachehitratio = 0.995;
/**
* @var integer 最大深度,(取值:大于等于0的整数)
*/
public $maxdepth = 4;
/**
* @var integer 最大采样数,(取值:大于等于0的整数,默认1000万)
*/
public $maxsamplescount = 1e+07;
/**
* @var string 直接光缓存文件的路径用文件名
*/
public $persistentFile = './tmp/Untitled.dlsc';
/**
* @var object 储存个Entry类对象
*/
public $entry;
public function __construct($config = [])
{
$this->type = self::TYPE_DLS_CACHE;
$this->entry = new Entry($config);
Base::__construct($config);
}
}
?>

src/scene/PhotonGI.php → src/scene/cache/PhotonGI.php

Loading…
Cancel
Save