yuanjiajia
3 years ago
6 changed files with 152 additions and 24 deletions
-
2.gitignore
-
16examples/print.php
-
22src/scene/Native.php
-
56src/scene/OpenCL.php
-
46src/scene/RenderDevices.php
-
34src/scene/TrackerEngine.php
@ -0,0 +1,22 @@ |
|||||
|
<?php |
||||
|
|
||||
|
namespace Blobt\Luxcore\scene; |
||||
|
|
||||
|
class Native extends BaseCfg |
||||
|
{ |
||||
|
|
||||
|
/** |
||||
|
* @var integer //使用多少线程数
|
||||
|
*/ |
||||
|
private $threadsCount = 4; |
||||
|
|
||||
|
/** |
||||
|
* 在CPU渲染模式下,设置使用多少线程数 |
||||
|
* @var integer $setThreadsCount 传入一个控制使用多少CPU线程数的整数 |
||||
|
*/ |
||||
|
public function setThreadsCount($threadsCount = 4) |
||||
|
{ |
||||
|
$this->threadsCount = $threadsCount; |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,46 @@ |
|||||
|
<?php |
||||
|
|
||||
|
namespace Blobt\Luxcore\scene; |
||||
|
|
||||
|
class RenderDevices extends BaseCfg |
||||
|
{ |
||||
|
|
||||
|
public function __toString() |
||||
|
{ |
||||
|
return "错误,不能返回当前类的属性。\n"; |
||||
|
} |
||||
|
|
||||
|
//打开或关闭
|
||||
|
const OPEN = 1; |
||||
|
const CLOSE = 0; |
||||
|
|
||||
|
/** |
||||
|
* @var integral 是否使用cpu渲染,默认是 |
||||
|
*/ |
||||
|
public static $cpuSwitch = self::OPEN; |
||||
|
|
||||
|
/** |
||||
|
* @var integral 是否使用gpu渲染,默认否 |
||||
|
*/ |
||||
|
public static $gpuSwitch = self::CLOSE; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 使用cpu渲染 |
||||
|
*/ |
||||
|
public function useCpu() |
||||
|
{ |
||||
|
self::$cpuSwitch = self::OPEN; |
||||
|
self::$gpuSwitch = self::CLOSE; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 使用gpu渲染 |
||||
|
*/ |
||||
|
public function useGpu() |
||||
|
{ |
||||
|
self::$cpuSwitch = self::CLOSE; |
||||
|
self::$gpuSwitch = self::OPEN; |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,34 @@ |
|||||
|
<?php |
||||
|
|
||||
|
namespace Blobt\Luxcore\scene; |
||||
|
|
||||
|
class TrackerEngine extends BaseCfg |
||||
|
{ |
||||
|
|
||||
|
public function __toString() |
||||
|
{ |
||||
|
return "错误,不能返回当前类的属性。\n"; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* @var integral 使用何种光线跟踪引擎 |
||||
|
*/ |
||||
|
public static $Engine = 'PATH'; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 设置使用 “PATH” 光线跟踪引擎 |
||||
|
*/ |
||||
|
public function usePath(){ |
||||
|
self::$Engine = 'PATH'; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 设置使用 “BIDIR” 光线跟踪引擎 |
||||
|
*/ |
||||
|
public function usePidir(){ |
||||
|
self::$Engine = 'BIDIR'; |
||||
|
} |
||||
|
|
||||
|
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue