Browse Source

增加了类“renderEngine”,修改了文件“printf.php”

master
yuanjiajia 3 years ago
parent
commit
47d33dc664
  1. 14
      examples/print.php
  2. 12
      src/scene/OpenCL.php
  3. 52
      src/scene/RenderEngine.php

14
examples/print.php

@ -4,14 +4,16 @@ namespace Blobt\Luxcore\scene;
include dirname(dirname(__FILE__)) . "/vendor/autoload.php";
$temp = new Native();
//$temp->usePidir();
echo $temp;
$renderDevices = new RenderDevices();
$trackerEngine = new TrackerEngine();
$renderEngine = new RenderEngine;
echo $renderEngine;
$openCL = new OpenCL;
echo $openCL;
$native = new Native;
echo $native;
?>

12
src/scene/OpenCL.php

@ -2,8 +2,6 @@
namespace Blobt\Luxcore\scene;
use ParentIterator;
class OpenCL extends BaseCfg
{
@ -20,7 +18,7 @@ class OpenCL extends BaseCfg
/**
* @var string 在GPU渲染模式下,使用哪些GPU设备
*/
public $devicesSelect = '10';
private $devicesSelect = '10';
/**
* @var integer 在GPU渲染模式下,CPU是否渲染,并以多少线程渲染
@ -30,14 +28,16 @@ class OpenCL extends BaseCfg
/**
* RenderDevices类 的两个静态属性初始化变量 $cpuUse”和“$gpuUse”
* RenderDevices类 的两个静态属性初始化变量 $cpuUse”和“$gpuUse”参数
*/
public function __construct()
{
self::$cpuUse = RenderDevices::$cpuSwitch;
self::$gpuUse = RenderDevices::$gpuSwitch;
self::refreshConfig();
}
/**
* RenderDevices类 的两个静态属性刷新变量 $cpuUse”和“$gpuUse”参数
*/
public static function refreshConfig()
{
self::$cpuUse = RenderDevices::$cpuSwitch;

52
src/scene/RenderEngine.php

@ -0,0 +1,52 @@
<?php
namespace Blobt\Luxcore\scene;
class RenderEngine extends BaseCfg
{
//打开或关闭
const OPEN = 1;
const CLOSE = 0;
/**
* @var string 使用何种渲染引擎
*/
private static $type = 'PATHOCL';
public function __construct()
{
self::refreshConfig();
}
/**
* 更新字符串变量“$type”
*/
public static function refreshConfig()
{
if( TrackerEngine::$Engine == 'PATH')
{
self::$type = TrackerEngine::$Engine;
if( RenderDevices::$cpuSwitch == self::OPEN )
{
self::$type = self::$type.'CPU';
}
else if ( RenderDevices::$gpuSwitch == self::OPEN )
{
self::$type = self::$type.'CPU';
}
else;
}
else if( TrackerEngine::$Engine == 'BIDIR')
{
self::$type = TrackerEngine::$Engine;
if( RenderDevices::$cpuSwitch == self::OPEN )
{
self::$type = self::$type.'CPU';
}
}
}
}
Loading…
Cancel
Save