diff --git a/examples/print.php b/examples/print.php index e8e9fd1..2153645 100644 --- a/examples/print.php +++ b/examples/print.php @@ -5,15 +5,18 @@ namespace Blobt\Luxcore\scene; include dirname(dirname(__FILE__)) . "/vendor/autoload.php"; -$renderEngineType = new RenderEngine(); -echo $renderEngineType; +//设置打印渲染引擎的配置参数 +$renderEngine = new RenderEngine(); +echo $renderEngine; + +//设置打印GPU渲染设备的配置参数 $openCL = new OpenCL(); echo $openCL; -$cpuThreadsCount = new Native(['threadsCount' => 64]); - -echo $cpuThreadsCount; +//设置打印GPU渲染设备的配置参数 +$native = new Native(['threadsCount' => 64]); +echo $native; ?> diff --git a/src/scene/Native.php b/src/scene/Native.php index 1e7aae9..9140400 100644 --- a/src/scene/Native.php +++ b/src/scene/Native.php @@ -6,17 +6,8 @@ class Native extends BaseCfg { /** - * @var integer //使用多少线程数 + * @var integer //使用多少线程数(取值范围: 1 >= $threadsCount ) */ - protected $threadsCount = 4; - - /** - * 在CPU渲染模式下,设置使用多少线程数 - * @var integer $setThreadsCount 传入一个控制使用多少CPU线程数的整数 - */ - public function setThreadsCount($count) - { - $this->threadsCount = $count; - } - + public $threadsCount = 4; + } diff --git a/src/scene/OpenCL.php b/src/scene/OpenCL.php index e199ba7..212652f 100644 --- a/src/scene/OpenCL.php +++ b/src/scene/OpenCL.php @@ -13,22 +13,22 @@ class OpenCL extends BaseCfg /** * @var integral 是否使用cpu渲染,默认是 */ - protected $cpuUse = self::CLOSE; + public $cpuUse = self::CLOSE; /** * @var integral 是否使用gpu渲染,默认否 */ - protected $gpuUse = self::OPEN; + public $gpuUse = self::OPEN; /** - * @var string 在GPU渲染模式下,使用哪些GPU设备 + * @var string 控制使用哪些GPU设备的字符串(取值:是一段能标识系统中一个或多个GPU设备的ID字符串) */ - protected $devicesSelect = '10'; + public $devicesSelect = '10'; /** - * @var integral 在GPU渲染模式下,CPU是否渲染,并以多少线程渲染 + * @var integral GPU渲染模式下,设置CPU是否渲染和多少线程渲染(取值范围: 0 >= $threadsCount ) */ - protected $nativeThreadsCount = 4; + public $nativeThreadsCount = 4; /** @@ -50,22 +50,4 @@ class OpenCL extends BaseCfg } - /** - * 在GPU渲染模式下,设置使用哪些GPU设备 - * @var string $gpuIdStr 传入一个控制使用哪些GPU设备的字符串 - */ - public function selectDevices($gpuIdStr) - { - $this->devicesSelect = $gpuIdStr; - } - - /** - * 在GPU渲染模式下,设置CPU是否渲染,并以多少线程渲染 - * @var integer $nativeThreadsCount 传入一个控制CPU是否渲染,并以多少线程渲染的整数 - */ - public function setNativeThreadsCount($count) - { - $this->nativeThreadsCount = $count; - } - } diff --git a/src/scene/Path.php b/src/scene/Path.php index 8dd2ae5..a6bce24 100644 --- a/src/scene/Path.php +++ b/src/scene/Path.php @@ -4,6 +4,14 @@ namespace Blobt\Luxcore\scene; class Path extends BaseCfg { - public $pathdepth = null; - + /** + * @var integer 光线追踪的最的深度 + */ + public $pathdepthTotal = 7; + public $pathdepthDiffuse = 5; + public $pathdepthGlossy = 5; + public $pathdepthSpecular = 6; + public $hybridbackforwardEnable = 0; + public $hybridbackforwardPartition = 0; + public $hybridbackforwardGlossinessthreshold = 0.049; } diff --git a/src/scene/RenderEngine.php b/src/scene/RenderEngine.php index 54892b6..5a49732 100644 --- a/src/scene/RenderEngine.php +++ b/src/scene/RenderEngine.php @@ -4,19 +4,15 @@ namespace Blobt\Luxcore\scene; class RenderEngine extends BaseCfg { - - /** - * @var string 使用何种渲染引擎 - */ - private $type = 'PATHOCL'; + + const TYPE_PATHCPU = 'PATHCPU'; + const TYPE_PATHGPU = 'PATHGPU'; + const TYPE_BIDIRCPU = 'BIDIRCPU'; + /** - * 设置渲染引擎类型 - * @var string $engineStr 传入一个表示渲染引擎类型的字符串 + * @var string 使用何种渲染引擎(可取值是 PATHCPU、PATHGPU、BIDIRCPU 三个字符串之一) */ - public function setRenderEngineType($engineStr) - { - $this->type = $engineStr; - } + public $type = self::TYPE_PATHGPU; }