diff --git a/examples/print.php b/examples/print.php index 2153645..7b004ac 100644 --- a/examples/print.php +++ b/examples/print.php @@ -18,5 +18,8 @@ echo $openCL; $native = new Native(['threadsCount' => 64]); echo $native; +//设置打印光线跟踪的配置参数 +$path = new Path(['glossinessthreshold' => 0.999]); +echo $path; ?> diff --git a/src/scene/BaseCfg.php b/src/scene/BaseCfg.php index eb7c224..68ad050 100644 --- a/src/scene/BaseCfg.php +++ b/src/scene/BaseCfg.php @@ -18,6 +18,8 @@ class BaseCfg extends Base $object = new \ReflectionClass($this); $properties = $object->getProperties(); + + //获取类名 -> 去除命名空间 -> 转成全小写 $className = get_called_class(); $className = strtolower(array_reverse(explode('\\', $className))[0]); @@ -36,7 +38,6 @@ class BaseCfg extends Base $name = implode(".", array_map('strtolower', StringHelper::camelStrToArray($name))); $value = $item->getValue($this); - if (is_string($value)) { $ret .= "{$className}.{$name} = \"{$value}\"\n"; } else if (is_integer($value)) { @@ -48,8 +49,9 @@ class BaseCfg extends Base $ret .= $value->toString($className); } else if(is_null($value)){ $ret .= "{$className}.{$name} = \"null\"\n"; - } else - { + } else if(is_float($value)){ + $ret .= "{$className}.{$name} = {$value}\n"; + }else{ $ret .= "{$className}.{$name} = \"unknow type\"\n"; } } diff --git a/src/scene/HybridBackforWard.php b/src/scene/HybridBackforWard.php new file mode 100644 index 0000000..5287dc2 --- /dev/null +++ b/src/scene/HybridBackforWard.php @@ -0,0 +1,27 @@ += $threadsCount ) + * @var integer //使用多少线程数(取值范围: 大于或等于1的整数) */ public $threadsCount = 4; diff --git a/src/scene/OpenCL.php b/src/scene/OpenCL.php index 212652f..f99fb07 100644 --- a/src/scene/OpenCL.php +++ b/src/scene/OpenCL.php @@ -26,7 +26,7 @@ class OpenCL extends BaseCfg public $devicesSelect = '10'; /** - * @var integral GPU渲染模式下,设置CPU是否渲染和多少线程渲染(取值范围: 0 >= $threadsCount ) + * @var integral GPU渲染模式下,设置CPU是否渲染和多少线程渲染(取值范围: 大于或等于0的整数) */ public $nativeThreadsCount = 4; diff --git a/src/scene/Path.php b/src/scene/Path.php index a6bce24..22a1b5f 100644 --- a/src/scene/Path.php +++ b/src/scene/Path.php @@ -1,17 +1,45 @@ pathDepth = new PathDepth($config); + $this->hybridBackforWard= new HybridBackforWard($config); + Base::__construct($config); + } + } diff --git a/src/scene/PathDepth.php b/src/scene/PathDepth.php index 8805113..59180a9 100644 --- a/src/scene/PathDepth.php +++ b/src/scene/PathDepth.php @@ -4,11 +4,24 @@ namespace Blobt\Luxcore\scene; class PathDepth extends BaseCfg { - public $total = 11; - + + /** + * @var integer 整体限制 漫反射、光泽反射、高光反射 的最大跟踪深度为 $total (取值:大于或等于1的整数) + */ + public $total = 6; + + /** + * 限制 漫反射光线 最大跟踪深度为(取值:大于或等于1的整数) + */ public $diffuse = 5; - public $glossy = 11; + /** + * 限制 光泽反射光线 最大跟踪深度为(取值:大于或等于1的整数) + */ + public $glossy = 5; - public $specular = 10; + /** + * 限制 光泽反射光线 最大跟踪深度为(取值:大于或等于1的整数) + */ + public $specular = 6; }