yuanjiajia
3 years ago
10 changed files with 211 additions and 23 deletions
-
7examples/print.php
-
7src/core/Base.php
-
26src/scene/BaseCfg.php
-
4src/scene/HybridBackforWard.php
-
26src/scene/Metropolis.php
-
9src/scene/OpenCL.php
-
9src/scene/Path.php
-
52src/scene/Random.php
-
43src/scene/Sampler.php
-
51src/scene/Sobol.php
@ -0,0 +1,26 @@ |
|||
<?php |
|||
|
|||
namespace Blobt\Luxcore\scene; |
|||
use Blobt\Luxcore\core\Base; |
|||
|
|||
class Metropolis extends BaseCfg |
|||
{ |
|||
|
|||
/** |
|||
* @var float TODO:具体作用尚不明确,(取值:0-1) |
|||
*/ |
|||
public $largesteprate = 0.4; |
|||
|
|||
/** |
|||
* @var integer TODO:具体作用尚不明确,(取值:大于0的整数) |
|||
*/ |
|||
public $maxconsecutivereject = 512; |
|||
|
|||
/** |
|||
* @var float TODO:具体作用尚不明确,(取值:0-1) |
|||
*/ |
|||
public $imagemutationrate = 0.1; |
|||
|
|||
} |
|||
|
|||
?>
|
@ -0,0 +1,52 @@ |
|||
<?php |
|||
|
|||
namespace Blobt\Luxcore\scene; |
|||
use Blobt\Luxcore\core\Base; |
|||
|
|||
class Random extends BaseCfg |
|||
{ |
|||
|
|||
/** |
|||
* “progressive”的优化类型,每过程每像素采样1个样本 |
|||
*/ |
|||
const PROGRESSIVE = 1; |
|||
/** |
|||
* “cache-friendly”的优化类型,每过程每像素采样32个样本 |
|||
*/ |
|||
const CACHE_FRIENDLY = 32; |
|||
|
|||
//2的n次方
|
|||
const POW_TWO_ZERO = 1; |
|||
const POW_TWO_TWO = 4; |
|||
const POW_TWO_THREE = 8; |
|||
const POW_TWO_FOUR = 16; |
|||
const POW_TWO_FIVE = 32; |
|||
const POW_TWO_SIX = 64; |
|||
|
|||
/** |
|||
* @var integer TODO:初步分析为每过程每像素采样的样本数 |
|||
*/ |
|||
public $overlapping = self::PROGRESSIVE; |
|||
|
|||
/** |
|||
* @var integer 这是 “$overlapping”参数的倍数 |
|||
*/ |
|||
public $superSampling = self::POW_TWO_ZERO; |
|||
|
|||
/** |
|||
* @var integer TODO:具体作用尚不明确, |
|||
*/ |
|||
public $tileSize = 16; |
|||
|
|||
/** |
|||
* @var integer TODO:具体作用尚不明确, |
|||
*/ |
|||
public $bucketSize = 1; |
|||
|
|||
/** |
|||
* @var float 区分完全采样与自适应彩样的阀值(取值0-0.95的小数) |
|||
*/ |
|||
public $adaptiveStrength = 0.9; |
|||
} |
|||
|
|||
?>
|
@ -0,0 +1,43 @@ |
|||
<?php |
|||
|
|||
namespace Blobt\Luxcore\scene; |
|||
use Blobt\Luxcore\core\Base; |
|||
|
|||
class Sampler extends BaseCfg |
|||
{ |
|||
|
|||
//渲染器的两个采样类型:SOBOL和RANDOM
|
|||
const TYPE_SOBOL = 'SOBOL'; |
|||
const TYPE_METROPOLIS = 'METROPOLIS'; |
|||
const TYPE_RANDOM = 'RANDOM'; |
|||
const TYPE_TILEPATHSAMPLER = 'TILEPATHSAMPLER'; |
|||
|
|||
|
|||
|
|||
|
|||
/** |
|||
* @var string 使用何种采样类型,默认是 SOBOL |
|||
*/ |
|||
public $type = self::TYPE_SOBOL; |
|||
|
|||
/** |
|||
* @var object 一个 Random类 或 Sobol类 的实例对象 |
|||
*/ |
|||
public $sobol; |
|||
public $random; |
|||
public $metropolis; |
|||
|
|||
|
|||
|
|||
/** |
|||
* 实例 PathDepth类、HybridBackforWard类的两个对象 |
|||
*/ |
|||
public function __construct($config = []) |
|||
{ |
|||
$this->sobol = new Sobol($config); |
|||
$this->random = new Random($config); |
|||
$this->metropolis = new Metropolis($config); |
|||
Base::__construct($config); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,51 @@ |
|||
<?php |
|||
|
|||
namespace Blobt\Luxcore\scene; |
|||
use Blobt\Luxcore\core\Base; |
|||
|
|||
class Sobol extends BaseCfg |
|||
{ |
|||
/** |
|||
* “progressive”的优化类型,每过程每像素采样1个样本 |
|||
*/ |
|||
const PROGRESSIVE = 1; |
|||
/** |
|||
* “cache-friendly”的优化类型,每过程每像素采样32个样本 |
|||
*/ |
|||
const CACHE_FRIENDLY = 32; |
|||
|
|||
//2的n次方
|
|||
const POW_TWO_ZERO = 1; |
|||
const POW_TWO_TWO = 4; |
|||
const POW_TWO_THREE = 8; |
|||
const POW_TWO_FOUR = 16; |
|||
const POW_TWO_FIVE = 32; |
|||
const POW_TWO_SIX = 64; |
|||
|
|||
/** |
|||
* @var integer TODO:初步判断为每过程每像素采样的样本数 |
|||
*/ |
|||
public $overlapping = self::PROGRESSIVE; |
|||
|
|||
/** |
|||
* @var integer 这是 “$overlapping”参数的倍数 |
|||
*/ |
|||
public $superSampling = self::POW_TWO_ZERO; |
|||
|
|||
/** |
|||
* @var integer TODO:具体作用尚不明确 |
|||
*/ |
|||
public $tileSize = 16; |
|||
|
|||
/** |
|||
* @var integer TODO:具体作用尚不明确 |
|||
*/ |
|||
public $bucketSize = 1; |
|||
|
|||
/** |
|||
* @var float 在图像中区分完全采样与自适应彩样的阀值(取值0-0.95的小数) |
|||
*/ |
|||
public $adaptiveStrength = 0.9; |
|||
} |
|||
|
|||
?>
|
Write
Preview
Loading…
Cancel
Save
Reference in new issue