yuanjiajia
3 years ago
16 changed files with 104 additions and 54 deletions
-
2.vscode/launch.json
-
29examples/configLightStrategy.php
-
2examples/configNative.php
-
4examples/configOpenCL.php
-
10examples/configPath.php
-
27examples/configSampler.php
-
1src/scene/render/Film.php
-
1src/scene/render/HaltThresHold.php
-
2src/scene/render/Image.php
-
5src/scene/render/Native.php
-
7src/scene/render/OpenCL.php
-
19src/scene/render/Path.php
-
37src/scene/render/Sampler.php
-
1src/scene/render/cache/LightStrategy.php
-
9src/scene/render/cache/PhotonGI.php
@ -0,0 +1,29 @@ |
|||||
|
<?php |
||||
|
|
||||
|
|
||||
|
|
||||
|
namespace Blobt\Luxcore\scene; |
||||
|
|
||||
|
|
||||
|
include dirname(dirname(__FILE__)) . "/vendor/autoload.php"; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 配置灯光策略 |
||||
|
*/ |
||||
|
$lightStrategy = new render\LightStrategy(); //实例一个LightStrategy类对象,默认的灯光策略为 LOG_POWER
|
||||
|
|
||||
|
$lightStrategy->type = render\LightStrategy::TYPE_UNIFORM; //修改灯光策略为 UNIFORM;
|
||||
|
|
||||
|
|
||||
|
|
||||
|
// 现在修改灯光策略为 DLS_CACHE,并开启直接光缓存
|
||||
|
$lightStrategy = new render\cache\LightStrategy(); //当需要开启开直接光缓存时,灯光策略类型必须为 DLS_CACHE类型,因此cache\LightStrategy类 继承了 LightStrategy类,
|
||||
|
//并在重写的构造函数中设置 $type属性为 DLS_CACHE类型。
|
||||
|
|
||||
|
$lightStrategy->persistentFile = "../Untitled.dlsc"; //设置设置直接光缓存文件保存路径
|
||||
|
|
||||
|
echo $lightStrategy; //输出灯光策略配置参数
|
||||
|
|
||||
|
|
||||
|
?>
|
@ -0,0 +1,27 @@ |
|||||
|
<?php |
||||
|
|
||||
|
|
||||
|
|
||||
|
namespace Blobt\Luxcore\scene; |
||||
|
|
||||
|
|
||||
|
include dirname(dirname(__FILE__)) . "/vendor/autoload.php"; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 配置采样参数 |
||||
|
*/ |
||||
|
$sampler = new render\Sampler(); //实例一个Sampler类对象,当前默认的采样器类型为 Sobol
|
||||
|
|
||||
|
|
||||
|
|
||||
|
// 现在修改采样器类型为 RANDOM
|
||||
|
$sampler->type = render\Sampler::TYPE_RANDOM; //设置采样器类型为 RANDOM,采样器类型有三个可选的类型,分别为 sobol、RANDOM、METROPOLIS。
|
||||
|
|
||||
|
$sampler->sampling = new render\Random(); //为 RANDOM类型采样器 配置参数,其 RANDOM类中的各种属性,可以查看 RANDOM类 的注释说明。其值为三个可选的
|
||||
|
//采样器类(分别是 Sobol、Random类、Metropolis类)的实例化对象,需要与 $type 的値保持对应。
|
||||
|
|
||||
|
echo $sampler; //输出采样器配置参数
|
||||
|
|
||||
|
|
||||
|
?>
|
Write
Preview
Loading…
Cancel
Save
Reference in new issue