yuanjiajia
3 years ago
15 changed files with 180 additions and 36 deletions
-
2.vscode/launch.json
-
36examples/configNative.php
-
43examples/configOpenCL.php
-
58examples/configPath.php
-
3examples/printRender.php
-
5src/scene/render/Batch.php
-
4src/scene/render/HybridBackforWard.php
-
18src/scene/render/OpenCL.php
-
8src/scene/render/Path.php
-
2src/scene/render/PathDepth.php
-
2src/scene/render/Random.php
-
9src/scene/render/Sobol.php
-
4src/scene/render/cache/Caustic.php
-
4src/scene/render/cache/Indirect.php
-
16src/scene/render/cache/PhotonGI.php
@ -0,0 +1,36 @@ |
|||
<?php |
|||
|
|||
|
|||
|
|||
namespace Blobt\Luxcore\scene; |
|||
|
|||
|
|||
include dirname(dirname(__FILE__)) . "/vendor/autoload.php"; |
|||
|
|||
/** |
|||
* 配置CPU渲染参数,需要使用CPU设备渲染时,必须先设置渲染引擎类型为 PATHCPU |
|||
*/ |
|||
|
|||
|
|||
/** |
|||
* 配置渲染引擎参数 |
|||
*/ |
|||
$renderengine = new render\RenderEngine(); //实例一个RenderEngine类对象
|
|||
|
|||
$renderengine->type = render\RenderEngine::TYPE_PATHCPU; //设置渲染引擎类型为 PATHCPU
|
|||
|
|||
echo $renderengine; //输出渲染引擎参数
|
|||
|
|||
|
|||
|
|||
/** |
|||
* 配置CPU渲染参数 |
|||
*/ |
|||
$device = new render\Native(); //实例一个Path类对象
|
|||
|
|||
$device->threadsCount = 32; //设置CPU参与渲染的线程数,如果设置的值大于实际的物理线程数,渲染引擎则使用实际的线程数参与渲染
|
|||
//如果设置为0,渲染引擎则默认使用1个线程数参与渲染
|
|||
|
|||
echo $device; //输出GPU渲染参数
|
|||
|
|||
?>
|
@ -0,0 +1,43 @@ |
|||
<?php |
|||
|
|||
|
|||
|
|||
namespace Blobt\Luxcore\scene; |
|||
|
|||
|
|||
include dirname(dirname(__FILE__)) . "/vendor/autoload.php"; |
|||
|
|||
/** |
|||
* 配置GPU渲染参数,需要使用GPU设备渲染时,必须先设置渲染引擎类型为 PATHOCL |
|||
* 使用GPU渲染时,同时也可以使用CPU同时渲染,只需将OpenCL类的$nativeThreadsCount属性设置设置为null、或大于0的整数既可 |
|||
*/ |
|||
|
|||
|
|||
/** |
|||
* 配置渲染引擎参数 |
|||
*/ |
|||
$renderengine = new render\RenderEngine(); //实例一个RenderEngine类对象
|
|||
|
|||
$renderengine->type = render\RenderEngine::TYPE_PATHGPU; //设置渲染引擎类型为 PATHOCL
|
|||
|
|||
echo $renderengine; //输出渲染引擎参数
|
|||
|
|||
|
|||
|
|||
/** |
|||
* 配置GPU渲染参数 |
|||
*/ |
|||
$device = new render\OpenCL(); //实例一个Path类对象
|
|||
|
|||
$device->gpuUse = baseCfg::OPEN; //使用GPU
|
|||
|
|||
$device->devicesSelect = "1"; //设置使用GPU设备的ID号
|
|||
|
|||
$device->cpuUse = baseCfg::OPEN; //使用CPU
|
|||
|
|||
$device->nativeThreadsCount = 32; //设置CPU参与渲染的线程数,如果设置的值大于实际的物理线程数,渲染引擎则使用实际的线程数参与渲染
|
|||
//如果设置为0,则关闭CPU渲染
|
|||
|
|||
echo $device; //输出GPU渲染参数
|
|||
|
|||
?>
|
@ -0,0 +1,58 @@ |
|||
<?php |
|||
|
|||
|
|||
|
|||
namespace Blobt\Luxcore\scene; |
|||
|
|||
|
|||
include dirname(dirname(__FILE__)) . "/vendor/autoload.php"; |
|||
|
|||
|
|||
/** |
|||
* @var object 配置光线跟综参数 |
|||
* 当渲染器开启了全局光缘存并处于调试模式下,自适应跟踪参数不能设置与输出。 |
|||
*/ |
|||
$path = new render\Path(); //实例一个Path类对象
|
|||
|
|||
|
|||
|
|||
|
|||
$path->pathDepth = new render\PathDepth(); //实例一个 PathDepth(光线跟踪深度)类对象,使光线跟踪参数可以设置
|
|||
|
|||
$path->pathDepth->total = 12; //设置 漫反射、光泽反射、高光反射 的最大跟踪不能超过12,如果漫反射、光泽反射、高光反射当中有高于这个值的设置,
|
|||
//那么其实际最大跟踪深度则限制为这个数值
|
|||
|
|||
$path->pathDepth->diffuse = 8; //设置 漫反射跟踪深度为 8
|
|||
|
|||
$path->pathDepth->glossy = 8; //设置 光泽反射跟踪深度为 8
|
|||
|
|||
$path->pathDepth->glossy = 15; //设置 高光反射跟踪深度为 15,但受 total的限制,其实际跟踪深度为 12
|
|||
|
|||
|
|||
|
|||
|
|||
$path->hybridBackforWard = new render\HybridBackforWard(); //实例一个 HybridBackforWard类对象,使自适应光线跟踪 参数可以设置
|
|||
|
|||
$path->hybridBackforWard->enable = BaseCfg::OPEN; //开启 自适应光线跟踪
|
|||
|
|||
$path->hybridBackforWard->partition = 0.2; //设置 不跟踪光线 为百分之20
|
|||
|
|||
$path->hybridBackforWard->glossinessthreshold = 0.02; //设置区分图像的 平坦区域和非平坦区域 的阀值为0.02
|
|||
|
|||
|
|||
|
|||
|
|||
$path->forceblackbackgroundEnable = BaseCfg::OPEN; //开启 限制 每个象素最大 光线跟踪数量
|
|||
|
|||
$path->clampingVarianceMaxvalue = 1200; //设置 每个像素 最大跟踪光线 数量为1200
|
|||
|
|||
|
|||
|
|||
|
|||
$path->photonGI = new render\cache\PhotonGI(); //实例一个PhotonGI类对象,开启全局光缓存功能
|
|||
|
|||
$path->photonGI->persistentFile = "../temp.pgi"; //将全局光缓存保个子为 temp.pgi
|
|||
|
|||
echo $path; //输出光线跟综参数
|
|||
|
|||
?>
|
Write
Preview
Loading…
Cancel
Save
Reference in new issue